bug #27847 [Security] Fix accepting null as $uidKey in LdapUserProvider (louhde)
This PR was merged into the 4.0 branch. Discussion ---------- [Security] Fix accepting null as $uidKey in LdapUserProvider | Q | A | ------------- | --- | Branch? | 4.0 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Fixing the hard BC break introduced inafeb89fa06 (diff-96df7b4cb1c79ec0877d79ae2b61899dL40)
Commits -------c776259
[Security] LdapUserProvider uidKey could be null
This commit is contained in:
commit
8a96fdcd5e
@ -35,8 +35,12 @@ class LdapUserProvider implements UserProviderInterface
|
|||||||
private $defaultSearch;
|
private $defaultSearch;
|
||||||
private $passwordAttribute;
|
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->ldap = $ldap;
|
||||||
$this->baseDn = $baseDn;
|
$this->baseDn = $baseDn;
|
||||||
$this->searchDn = $searchDn;
|
$this->searchDn = $searchDn;
|
||||||
|
Reference in New Issue
Block a user