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
pull/2/head
Christian Boltz 9 years ago
parent 64c6e9f0a0
commit 63d9b45dc7

@ -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 {

Loading…
Cancel
Save