added LDAP config to set filter for finding user attributes (#877)

This commit is contained in:
Kevin Papst
2019-06-23 12:38:11 +02:00
committed by GitHub
parent 9fbbaf9b88
commit 7b95750dcf
5 changed files with 5 additions and 2 deletions

View File

@@ -106,7 +106,6 @@ class LdapManager
public function updateUser(User $user)
{
$baseDn = $user->getPreferenceValue('ldap.dn');
$filter = '(objectClass=*)';
if (null === $baseDn) {
throw new LdapDriverException('This account is not a registered LDAP user');
@@ -119,7 +118,7 @@ class LdapManager
}
$user->setPreferenceValue('ldap.dn', $baseDn);
$entries = $this->driver->search($baseDn, $filter);
$entries = $this->driver->search($baseDn, $this->params['attributesFilter']);
if ($entries['count'] > 1) {
throw new LdapDriverException('This search must only return a single user');