Merge pull request #1186 from evbevz/ldap-auth-fix

LDAP fix: handle legal boolean return result from searchUsers()
This commit is contained in:
Ad Schellevis 2016-09-15 15:26:04 +02:00 committed by GitHub
commit 190ac1064d

View File

@ -333,7 +333,7 @@ class LDAP implements IAuthConnector
$ldap_is_connected = $this->connect($this->ldapBindURL, $this->ldapBindDN, $this->ldapBindPassword);
if ($ldap_is_connected) {
$result = $this->searchUsers($username, $this->ldapAttributeUser, $this->ldapExtendedQuery);
if (count($result) > 0) {
if ($result !== false && count($result) > 0) {
$ldap_is_connected = $this->connect($this->ldapBindURL, $result[0]['dn'], $password);
return $ldap_is_connected;
}