Commit 74108220 authored by Ad Schellevis's avatar Ad Schellevis

(ldap) disable anonymous binds

parent 77f3cfa8
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment