Update LdapBindAuthenticationProvider.php
This commit is contained in:
parent
62565a1b66
commit
4bda68a9a2
@ -87,9 +87,8 @@ class LdapBindAuthenticationProvider extends UserAuthenticationProvider
|
||||
}
|
||||
|
||||
try {
|
||||
$username = $this->ldap->escape($username, '', LdapInterface::ESCAPE_DN);
|
||||
|
||||
if ($this->queryString) {
|
||||
$username = $this->ldap->escape($username, '', LdapInterface::ESCAPE_FILTER);
|
||||
$query = str_replace('{username}', $username, $this->queryString);
|
||||
$result = $this->ldap->query($this->dnString, $query)->execute();
|
||||
if (1 !== $result->count()) {
|
||||
@ -98,6 +97,7 @@ class LdapBindAuthenticationProvider extends UserAuthenticationProvider
|
||||
|
||||
$dn = $result[0]->getDn();
|
||||
} else {
|
||||
$username = $this->ldap->escape($username, '', LdapInterface::ESCAPE_DN);
|
||||
$dn = str_replace('{username}', $username, $this->dnString);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user