[Security] Allow passing null as $filter in LdapUserProvider to get the default filter
This commit is contained in:
parent
7135aa4338
commit
c6f87c6e3a
@ -11,6 +11,7 @@ CHANGELOG
|
||||
custom anonymous and remember me token classes is deprecated. To
|
||||
use custom tokens, extend the existing `Symfony\Component\Security\Core\Authentication\Token\AnonymousToken`
|
||||
or `Symfony\Component\Security\Core\Authentication\Token\RememberMeToken`.
|
||||
* allow passing null as $filter in LdapUserProvider to get the default filter
|
||||
|
||||
4.1.0
|
||||
-----
|
||||
|
@ -35,12 +35,16 @@ class LdapUserProvider implements UserProviderInterface
|
||||
private $defaultSearch;
|
||||
private $passwordAttribute;
|
||||
|
||||
public function __construct(LdapInterface $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), ?string $uidKey = 'sAMAccountName', string $filter = '({uid_key}={username})', string $passwordAttribute = null)
|
||||
public function __construct(LdapInterface $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), string $uidKey = null, string $filter = null, string $passwordAttribute = null)
|
||||
{
|
||||
if (null === $uidKey) {
|
||||
$uidKey = 'sAMAccountName';
|
||||
}
|
||||
|
||||
if (null === $filter) {
|
||||
$filter = '({uid_key}={username})';
|
||||
}
|
||||
|
||||
$this->ldap = $ldap;
|
||||
$this->baseDn = $baseDn;
|
||||
$this->searchDn = $searchDn;
|
||||
|
Reference in New Issue
Block a user