summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-04-21 12:38:08 +0545
committerRenato Botelho <garga@FreeBSD.org>2015-04-27 09:09:40 -0300
commitd7d6342c41361bfdb4b247e7b6f3730a4164e25f (patch)
tree0e9522c0d42d2833b1bb64d699d7d42597971ed0 /etc
parent73bbcaed4d62d336224bd069876bc0e3d2e21d1f (diff)
downloadpfsense-d7d6342c41361bfdb4b247e7b6f3730a4164e25f.zip
pfsense-d7d6342c41361bfdb4b247e7b6f3730a4164e25f.tar.gz
Fall back to getting local user pages and groups
if the groups could not be found from LDAP and there is a local user.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/priv.inc12
1 files changed, 7 insertions, 5 deletions
diff --git a/etc/inc/priv.inc b/etc/inc/priv.inc
index 8d1a736..c6b244f 100644
--- a/etc/inc/priv.inc
+++ b/etc/inc/priv.inc
@@ -253,14 +253,16 @@ function getAllowedPages($username) {
// obtain ldap groups if we are in ldap mode
if ($authcfg['type'] == "ldap")
$allowed_groups = @ldap_get_groups($username, $authcfg);
- else {
+
+ if (!$allowed_groups) {
// search for a local user by name
$local_user = getUserEntry($username);
- getPrivPages($local_user, $allowed_pages);
- // obtain local groups if we have a local user
- if ($local_user)
+ // obtain local user pages and groups if we have a local user
+ if ($local_user) {
+ getPrivPages($local_user, $allowed_pages);
$allowed_groups = local_user_get_groups($local_user);
+ }
}
// build a list of allowed pages
@@ -288,4 +290,4 @@ function sort_user_privs($privs) {
return array_merge($fprivs, $sprivs);
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud