[Security] LdapUserProvider uidKey could be null

This commit is contained in:
louhde 2018-07-04 17:38:36 +02:00
parent 4ce5a1bbc0
commit c77625988d

View File

@ -35,8 +35,12 @@ 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 = 'sAMAccountName', string $filter = '({uid_key}={username})', string $passwordAttribute = null)
{
if (null === $uidKey) {
$uidKey = 'sAMAccountName';
}
$this->ldap = $ldap;
$this->baseDn = $baseDn;
$this->searchDn = $searchDn;