mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
make code more backward-compatible
This commit is contained in:
@ -204,11 +204,14 @@ function get_membername ($username)
|
|||||||
function get_group_list() {
|
function get_group_list() {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$ldap_groups = [];
|
$ldap_groups = array();
|
||||||
$ldap_groups[] = $config['auth_ldap_groupbase'];
|
$default_group = 'cn=groupname,ou=groups,dc=example,dc=com';
|
||||||
|
if($config['auth_ldap_group'] !== $default_group) {
|
||||||
|
array_push($ldap_groups, $config['auth_ldap_group']);
|
||||||
|
}
|
||||||
foreach($config['auth_ldap_groups'] as $key => $value) {
|
foreach($config['auth_ldap_groups'] as $key => $value) {
|
||||||
$dn = "cn=$key," . $config['auth_ldap_groupbase'];
|
$dn = "cn=$key," . $config['auth_ldap_groupbase'];
|
||||||
$ldap_groups[] = $dn;
|
array_push($ldap_groups, $dn);
|
||||||
}
|
}
|
||||||
return $ldap_groups;
|
return $ldap_groups;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user