Revision 5574e742
Added by Jim Pingle almost 14 years ago
etc/inc/priv.inc | ||
---|---|---|
287 | 287 |
return $allowed_pages; |
288 | 288 |
} |
289 | 289 |
|
290 |
function sort_user_privs($privs) { |
|
291 |
// Privileges to place first, to redirect properly. |
|
292 |
$priority_privs = array("page-dashboard-all", "page-system-login/logout"); |
|
293 |
|
|
294 |
$fprivs = array_intersect($privs, $priority_privs); |
|
295 |
$sprivs = array_diff($privs, $priority_privs); |
|
296 |
|
|
297 |
return array_merge($fprivs, $sprivs); |
|
298 |
} |
|
290 | 299 |
?> |
usr/local/www/system_usermanager_addprivs.php | ||
---|---|---|
101 | 101 |
else |
102 | 102 |
$a_user['priv'] = array_merge($a_user['priv'], $pconfig['sysprivs']); |
103 | 103 |
|
104 |
$a_user['priv'] = sort_user_privs($a_user['priv']); |
|
104 | 105 |
admin_users_sort(); |
105 | 106 |
local_user_set($a_user); |
106 | 107 |
$retval = write_config(); |
Also available in: Unified diff
Sort user privileges so dashboard/index.php come first, so if a user has those permissions, they get redirected there first and not to another page.