[ingo] patch for ingo/templates/menu/menu.inc

Gary Windham windhamg at email.arizona.edu
Thu Nov 13 13:55:26 PST 2003


ingo/templates/menu/menu.inc doesn't properly handle the PEAR_Error
objects returned by Registry::link when the whitelist/blacklist features
are disabled in the registry.  This causes the links for these features
to be displayed on the menu bar, even when they are disabled.

Attached is a trivial patch that corrects this behavior.

-- 
Gary Windham
Systems Programmer, Principal
The University of Arizona, CCIT
-------------- next part --------------
--- menu.inc	2003-11-13 14:34:46.000000000 -0700
+++ menu.inc.new	2003-11-13 14:36:35.000000000 -0700
@@ -4,10 +4,10 @@
 
 /* Ingo menu items */
 Menu::printItem(Horde::applicationUrl('filters.php'), _("Rules"), 'ingo.gif');
-if (($whitelist_url = $GLOBALS['registry']->link('mail/showWhitelist'))) {
+if (! is_a($whitelist_url = $GLOBALS['registry']->link('mail/showWhitelist'), 'PEAR_Error')) {
     Menu::printItem(Horde::url($whitelist_url), _("Whitelist"), 'whitelist.gif');
 }
-if (($blacklist_url = $GLOBALS['registry']->link('mail/showBlacklist'))) {
+if (! is_a($blacklist_url = $GLOBALS['registry']->link('mail/showBlacklist'), 'PEAR_Error')) {
     Menu::printItem(Horde::url($blacklist_url), _("Blacklist"), 'blacklist.gif');
 }
 if (in_array(INGO_STORAGE_ACTION_VACATION, $_SESSION['ingo']['script_categories'])) {


More information about the ingo mailing list