summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorsullrich <sullrich@pfsense.org>2009-12-02 23:59:01 -0500
committersullrich <sullrich@pfsense.org>2009-12-02 23:59:01 -0500
commitdff909d87eb03de53dc817b9a3db4d6dad4663b2 (patch)
treefcfb0fed7f557cbd70848273c7b3f52b97e132cd /etc
parent99f98b8009f7a5ce48b17c5295aad11c535610db (diff)
downloadpfsense-dff909d87eb03de53dc817b9a3db4d6dad4663b2.zip
pfsense-dff909d87eb03de53dc817b9a3db4d6dad4663b2.tar.gz
Revert isAllowedUser commit and duplicate function to isAllowedPageUser()
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/priv.inc27
1 files changed, 24 insertions, 3 deletions
diff --git a/etc/inc/priv.inc b/etc/inc/priv.inc
index 3d5adb3..88cc883 100644
--- a/etc/inc/priv.inc
+++ b/etc/inc/priv.inc
@@ -175,11 +175,32 @@ function get_user_privdesc(& $user) {
return $privs;
}
-function isAllowedPage($page, $username) {
+function isAllowedPageUser($username, $page) {
global $_SESSION;
- if($username == "")
- $username = $_SESSION['Username'];
+ if (!isset($username))
+ return false;
+
+ /* admin/root access check */
+ $user = getUserEntry($username);
+ if (isset($user))
+ if (isset($user['uid']))
+ if ($user['uid']==0)
+ return true;
+
+ /* user privelege access check */
+ if (cmp_page_matches($page, $_SESSION['page-match']))
+ return true;
+
+ return false;
+}
+
+
+function isAllowedPage($page) {
+ global $_SESSION;
+
+
+ $username = $_SESSION['Username'];
if (!isset($username))
return false;
OpenPOWER on IntegriCloud