diff options
author | sullrich <sullrich@pfsense.org> | 2009-12-02 23:59:01 -0500 |
---|---|---|
committer | sullrich <sullrich@pfsense.org> | 2009-12-02 23:59:01 -0500 |
commit | dff909d87eb03de53dc817b9a3db4d6dad4663b2 (patch) | |
tree | fcfb0fed7f557cbd70848273c7b3f52b97e132cd /etc/inc/priv.inc | |
parent | 99f98b8009f7a5ce48b17c5295aad11c535610db (diff) | |
download | pfsense-dff909d87eb03de53dc817b9a3db4d6dad4663b2.zip pfsense-dff909d87eb03de53dc817b9a3db4d6dad4663b2.tar.gz |
Revert isAllowedUser commit and duplicate function to isAllowedPageUser()
Diffstat (limited to 'etc/inc/priv.inc')
-rw-r--r-- | etc/inc/priv.inc | 27 |
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; |