From 63d9b45dc748ff603c1c510e5c08d119f82cb54d Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Tue, 17 Mar 2015 22:22:28 +0000 Subject: [PATCH] list.php: - the 'simulate admin' dropdown doesn't make sense for superadmin-only modules, therefore don't fill/display it in this case (usecase: AdminHandler) git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1752 a1433add-5e2c-0410-b055-b7f2511e0802 --- list.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/list.php b/list.php index 40e8f38e..09b26bc8 100644 --- a/list.php +++ b/list.php @@ -30,11 +30,9 @@ if ( !preg_match('/^[a-z]+$/', $table) || !file_exists("model/$handlerclass.php" } # default: domain admin restrictions -$list_admins = array($username); $is_superadmin = 0; if (authentication_has_role('global-admin')) { # more permissions? Fine! - $list_admins = array_keys(list_admins()); $is_superadmin = 1; $username = safepost('username', safeget('username', $username)); # prefer POST over GET variable } @@ -45,6 +43,11 @@ $handler = new $handlerclass(0, $username, $is_admin); $formconf = $handler->webformConfig(); +$list_admins = array($username); +if ($is_superadmin && $formconf['required_role'] != 'global-admin') { # 'simulate admin' dropdown doesn't make sense for superadmin-only modules + $list_admins = array_keys(list_admins()); +} + if ($is_admin) { authentication_require_role($formconf['required_role']); } else {