diff --git a/admin/inc/class.admin_hooks.inc.php b/admin/inc/class.admin_hooks.inc.php index 4b62c420a3..1f5e3b04a7 100644 --- a/admin/inc/class.admin_hooks.inc.php +++ b/admin/inc/class.admin_hooks.inc.php @@ -176,4 +176,33 @@ class admin_hooks $GLOBALS['egw']->redirect_link('/admin/index.php'); } + + /** + * Actions for context menu of users + * + * @return array of actions + */ + public static function edit_user() + { + $actions = array(); + + if (!$GLOBALS['egw']->acl->check('current_sessions_access',1,'admin')) // no rights to view + { + $actions[] = array( + 'description' => 'Login History', + 'url' => '/index.php', + 'extradata' => 'menuaction=admin.admin_accesslog.index' + ); + } + + if (!$GLOBALS['egw']->acl->check('account_access',64,'admin')) // no rights to set ACL-rights + { + $actions[] = array( + 'description' => 'Deny access', + 'url' => '/index.php', + 'extradata' => 'menuaction=admin.uiaclmanager.list_apps' + ); + } + return $actions; + } } diff --git a/admin/setup/setup.inc.php b/admin/setup/setup.inc.php index e043f62f83..7980b327dc 100755 --- a/admin/setup/setup.inc.php +++ b/admin/setup/setup.inc.php @@ -39,8 +39,9 @@ $setup_info['admin']['hooks'] = array( 'deleteaccount', 'topmenu_info' ); -$setup_info['admin']['hooks']['admin'] = 'admin.admin_hooks.all_hooks'; -$setup_info['admin']['hooks']['sidebox_menu'] = 'admin.admin_hooks.all_hooks'; +$setup_info['admin']['hooks']['admin'] = 'admin_hooks::all_hooks'; +$setup_info['admin']['hooks']['sidebox_menu'] = 'admin_hooks::all_hooks'; +$setup_info['admin']['hooks']['edit_user'] = 'admin_hooks::edit_user'; // add account tab to addressbook.edit $setup_info['admin']['hooks']['addressbook_edit'] = 'admin.admin_account.addressbook_edit';