Fixed LDAP connection when name containt space and data login is false

This commit is contained in:
m-lopez-f 2015-07-30 16:10:21 +02:00
parent 0d37ef20de
commit fd7fc4eb00
1 changed files with 5 additions and 2 deletions

View File

@ -545,10 +545,13 @@ function ldap_process_user_login ($login, $password) {
}
}
$ldap_login_attr = isset($config["ldap_login_attr"]) ? io_safe_output($config["ldap_login_attr"]) . "=" : '';
$ldap_base_dn = isset($config["ldap_base_dn"]) ? "," . io_safe_output($config["ldap_base_dn"]) : '';
if (strlen($password) == 0 ||
!@ldap_bind($ds,
io_safe_output($config["ldap_login_attr"]) . "=" . $login . "," . io_safe_output($config["ldap_base_dn"]),
$password)) {
$ldap_login_attr. io_safe_output($login) . $ldap_base_dn,
$password)) {
$config["auth_error"] = 'User not found in database or incorrect password';
@ldap_close ($ds);