summaryrefslogtreecommitdiffstats
path: root/etc/inc/priv.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-08-11 14:02:21 -0400
committerjim-p <jimp@pfsense.org>2011-08-11 14:02:21 -0400
commit3f1097004e12701b6ce6712a0f4702089baa5e53 (patch)
tree4a748c83fb0615a3ab38196f7eeaf6c9c2dcc2b4 /etc/inc/priv.inc
parent5457129fc90bc0275ef7d5db6608b309907a15f6 (diff)
downloadpfsense-3f1097004e12701b6ce6712a0f4702089baa5e53.zip
pfsense-3f1097004e12701b6ce6712a0f4702089baa5e53.tar.gz
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.
Diffstat (limited to 'etc/inc/priv.inc')
-rw-r--r--etc/inc/priv.inc9
1 files changed, 9 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
OpenPOWER on IntegriCloud