Added ldap adv conf v2

This commit is contained in:
Arturo Gonzalez 2017-09-25 13:13:11 +02:00
parent f738fa2fce
commit 89ba75f466
1 changed files with 7 additions and 2 deletions

View File

@ -702,10 +702,15 @@ function ldap_process_user_login ($login, $password) {
$correct = false;
foreach ($ldap_adv_perms as $perm) {
$groups = $perm['groups_ldap'];
$groups = "cn=" . implode(",cn=", $groups);
if ($groups[0] == '') {
$groups = "";
}
else {
$groups = ",cn=" . str_replace(",", ",cn=", $groups[0]);
}
if(!empty($ldap_base_dn)) {
if (strlen($password) != 0 && @ldap_bind($ds, $ldap_login_attr.io_safe_output($login).",".$groups.$ldap_base_dn, $password) ) {
if (strlen($password) != 0 && @ldap_bind($ds, $ldap_login_attr.io_safe_output($login).$groups.$ldap_base_dn, $password) ) {
$correct = true;
}
}