summaryrefslogtreecommitdiffstats
path: root/etc/inc/auth.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-12-28 02:36:31 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-12-28 02:36:31 +0000
commit7e4a4513a330b9731e6c9b1e6e571defc2c4c73b (patch)
treeeb7d66d36aebfc22257680c525e1debe96ff758d /etc/inc/auth.inc
parent9d265058e7693c830f80be173ab09d3ee850ec00 (diff)
downloadpfsense-7e4a4513a330b9731e6c9b1e6e571defc2c4c73b.zip
pfsense-7e4a4513a330b9731e6c9b1e6e571defc2c4c73b.tar.gz
Allow multiple groups to be assigned per user.
Work sponsored-by: Centipede Networks
Diffstat (limited to 'etc/inc/auth.inc')
-rw-r--r--etc/inc/auth.inc21
1 files changed, 21 insertions, 0 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index 0245a1c..41882bf 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -57,6 +57,27 @@ function logout_session() {
$scriptName = $scriptName[$scriptElms-1];
}
+function getAllowedGroups($logged_in_user) {
+ global $g, $config;
+
+ $final_allowed = array();
+
+ foreach($config['system']['user'] as $username) {
+ if($username['name'] = $logged_in_user)
+ $allowed_groups = explode(",", $username['groupname']);
+ }
+
+ foreach($config['system']['group'] as $group) {
+ if(in_array($group['name'], $allowed_groups)) {
+ foreach($group['pages'] as $page) {
+ $allowed[] = $page;
+ }
+ }
+ }
+
+ return $allowed;
+}
+
function &getSystemAdminNames() {
global $config, $g, $userindex;
$adminUsers = array();
OpenPOWER on IntegriCloud