[dev] Option button availability for anonymous users

Jean-Charles Godien Jean-Charles.Godien@unice.fr
Fri, 20 Sep 2002 10:51:23 +0200


Allmost all applications have an option button in the menu bar.
This button is alway shown even when user is not authentified
which is a non sense (exept when preference driver is set to
'session' ?).

I suggest adding two additionnals functions in Menu class for
handling :
- automatic generation of option button
- anonymous users

in $HORDE_BASE/lib/Menu.php

     function createOptionItem() {
       global $conf, $registry;

       if ( (Auth::getAuth() && ($conf['prefs']['driver'] != '') && ($conf['prefs']['driver'] != 'none')) ||
            ($conf['prefs']['driver'] == 'session') )
         return Menu::createItem(Horde::applicationUrl('prefs.php'), _("Options"), 'prefs.gif', $registry->getParam('graphics', 'horde'));
       else
         return "";
     }

     function printOptionItem() {
       echo Menu::createOptionItem();
     }