Commit 190ac106 authored by Ad Schellevis's avatar Ad Schellevis Committed by GitHub

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

LDAP fix: handle legal boolean return result from searchUsers()
parents f107116e 652089dd
...@@ -333,7 +333,7 @@ class LDAP implements IAuthConnector ...@@ -333,7 +333,7 @@ class LDAP implements IAuthConnector
$ldap_is_connected = $this->connect($this->ldapBindURL, $this->ldapBindDN, $this->ldapBindPassword); $ldap_is_connected = $this->connect($this->ldapBindURL, $this->ldapBindDN, $this->ldapBindPassword);
if ($ldap_is_connected) { if ($ldap_is_connected) {
$result = $this->searchUsers($username, $this->ldapAttributeUser, $this->ldapExtendedQuery); $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); $ldap_is_connected = $this->connect($this->ldapBindURL, $result[0]['dn'], $password);
return $ldap_is_connected; 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