(ldap) disable anonymous binds

This commit is contained in:
Ad Schellevis 2017-02-23 23:30:06 +01:00
parent 77f3cfa87e
commit 7410822082

View File

@ -369,7 +369,10 @@ class LDAP extends Base implements IAuthConnector
{
// todo: implement SSL parts (legacy : ldap_setup_caenv)
// authenticate user
if (array_key_exists($username, $this->userDNmap)) {
if (empty($password)) {
// prevent anonymous bind
return false;
} elseif (array_key_exists($username, $this->userDNmap)) {
// we can map $username to distinguished name, just feed to connect
$ldap_is_connected = $this->connect($this->ldapBindURL, $this->userDNmap[$username], $password);
return $ldap_is_connected;