feature: Add an option for ad authentication to have a default level (#4801)

* Add an option for ad authentication to have a default level

* rework as a flag indicating unspecified access is global read

* Fix indentation
This commit is contained in:
jonathon-k
2016-10-21 10:22:13 -06:00
committed by Tony Murray
parent 61b461503c
commit 65f74215d3
2 changed files with 7 additions and 2 deletions

View File

@@ -156,6 +156,11 @@ function get_userlevel($username)
global $config, $ldap_connection;
$userlevel = 0;
if (isset($config['auth_ad_require_groupmembership']) && $config['auth_ad_require_groupmembership'] == 0) {
if (isset($config['auth_ad_global_read']) && $config['auth_ad_global_read'] === 1) {
$userlevel = 5;
}
}
// Find all defined groups $username is in
$search = ldap_search(
@@ -254,7 +259,7 @@ function get_userlist()
'email' => $userhash[$key]['email']
);
}
return $userlist;
}