diff --git a/src/etc/inc/auth.inc b/src/etc/inc/auth.inc index ad228492be..78b9d69caa 100644 --- a/src/etc/inc/auth.inc +++ b/src/etc/inc/auth.inc @@ -331,7 +331,7 @@ function get_user_privileges(& $user) { global $config, $_SESSION; $authcfg = auth_get_authserver($config['system']['webgui']['authmode']); - $allowed_groups = array('all'); + $allowed_groups = array(); $privs = $user['priv']; if (!is_array($privs)) { @@ -369,12 +369,16 @@ function get_user_privileges(& $user) { $allowed_groups = local_user_get_groups($user, true); } - if (is_array($allowed_groups)) { - foreach ($allowed_groups as $name) { - $group = getGroupEntry($name); - if (is_array($group['priv'])) { - $privs = array_merge($privs, $group['priv']); - } + if (!is_array($allowed_groups)) { + $allowed_groups = array('all'); + } else { + $allowed_groups[] = 'all'; + } + + foreach ($allowed_groups as $name) { + $group = getGroupEntry($name); + if (is_array($group['priv'])) { + $privs = array_merge($privs, $group['priv']); } } diff --git a/src/etc/inc/priv.inc b/src/etc/inc/priv.inc index a06217c11c..730b672f01 100644 --- a/src/etc/inc/priv.inc +++ b/src/etc/inc/priv.inc @@ -239,7 +239,7 @@ function getAllowedPages($username, &$attributes = array()) { } $allowed_pages = array(); - $allowed_groups = array('all'); + $allowed_groups = array(); phpsession_begin(); if ($_SESSION['remoteauth']) { @@ -283,6 +283,12 @@ function getAllowedPages($username, &$attributes = array()) { } } + if (!is_array($allowed_groups)) { + $allowed_groups = array('all'); + } else { + $allowed_groups[] = 'all'; + } + // build a list of allowed pages if (is_array($config['system']['group']) && is_array($allowed_groups)) { foreach ($config['system']['group'] as $group) {