mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Fix processing of the 'all' group. Fixes #9051
All the 'all' group to the list of groups at the end, rather than the start. This way it will be considered no matter how users login. This also fixes issues some users had with the original changes.
This commit is contained in:
parent
3be699295e
commit
4de1585438
@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user