<?php // add the logut menu if authed_user is set API::DEBUG("[Auth_NIS] init.php: authed_user = "******"[Auth_NIS] init.php: adding menu item."); API::addMenuItem(9999, 'Logout', 'auth_nis', 'logout'); }
<?php // add the logut menu if authed_user is set API::DEBUG("[Auth_LDAP] init.php: authed_user = "******"[Auth_LDAP] init.php: adding menu item."); API::addMenuItem(9999, 'Logout', 'auth_ldap', 'logout'); }
<?php // add the permissions managment option to the left nav if the logged in user // is a sysadmin $this->Perms->registerPerm('perms_admin', 'Permissions Management'); if ($this->Perms->checkPerm($this->authed_user, 'perms_admin')) { API::addMenuItem(90, 'Permissions Management', 'perms'); }
<?php // can't use globals stuff here, because it's init.php which happens out of order // of other init.php's so declare and destroy our own version of the Perms object. $tmp_perms = new Perms(); $tmp_perms->registerPerm('hosts', 'Host Admin'); if ($tmp_perms->checkPerm($this->authed_user, 'hosts')) { // register a menu item for this module API::addMenuItem(11, "Host Admin", "hosts"); } unset($tmp_perms);
<?php $this->Perms->registerPerm('user_admin', 'User Management'); if (!empty($this->authed_user)) { API::addMenuItem(91, 'My Preferences', 'prefs'); }