diff options
-rw-r--r-- | etc/inc/priv.inc | 9 | ||||
-rw-r--r-- | usr/local/www/system_usermanager_addprivs.php | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/etc/inc/priv.inc b/etc/inc/priv.inc index 16dd112..4321c44 100644 --- a/etc/inc/priv.inc +++ b/etc/inc/priv.inc @@ -287,4 +287,13 @@ function getAllowedPages($username) { return $allowed_pages; } +function sort_user_privs($privs) { + // Privileges to place first, to redirect properly. + $priority_privs = array("page-dashboard-all", "page-system-login/logout"); + + $fprivs = array_intersect($privs, $priority_privs); + $sprivs = array_diff($privs, $priority_privs); + + return array_merge($fprivs, $sprivs); +} ?>
\ No newline at end of file diff --git a/usr/local/www/system_usermanager_addprivs.php b/usr/local/www/system_usermanager_addprivs.php index 6716036..edfb2ad 100644 --- a/usr/local/www/system_usermanager_addprivs.php +++ b/usr/local/www/system_usermanager_addprivs.php @@ -101,6 +101,7 @@ if ($_POST) { else $a_user['priv'] = array_merge($a_user['priv'], $pconfig['sysprivs']); + $a_user['priv'] = sort_user_privs($a_user['priv']); admin_users_sort(); local_user_set($a_user); $retval = write_config(); |