mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
parent
3b135c6b6f
commit
17e8f01d24
@ -364,7 +364,12 @@ class LdapUserBackend extends LdapRepository implements UserBackendInterface, In
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->ds->testCredentials($userDn, $password);
|
$testCredentialsResult = $this->ds->testCredentials($userDn, $password);
|
||||||
|
if ($testCredentialsResult) {
|
||||||
|
$user->setAdditional('ldap_dn', $userDn);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $testCredentialsResult;
|
||||||
} catch (LdapException $e) {
|
} catch (LdapException $e) {
|
||||||
throw new AuthenticationException(
|
throw new AuthenticationException(
|
||||||
'Failed to authenticate user "%s" against backend "%s". An exception was thrown:',
|
'Failed to authenticate user "%s" against backend "%s". An exception was thrown:',
|
||||||
|
@ -532,18 +532,20 @@ class LdapUserGroupBackend /*extends LdapRepository*/ implements UserGroupBacken
|
|||||||
*/
|
*/
|
||||||
public function getMemberships(User $user)
|
public function getMemberships(User $user)
|
||||||
{
|
{
|
||||||
$userQuery = $this->ds
|
if (($userDn = $user->getAdditional('ldap_dn')) === null) {
|
||||||
->select()
|
$userQuery = $this->ds
|
||||||
->from($this->userClass)
|
->select()
|
||||||
->where($this->userNameAttribute, $user->getUsername())
|
->from($this->userClass)
|
||||||
->setBase($this->userBaseDn)
|
->where($this->userNameAttribute, $user->getUsername())
|
||||||
->setUsePagedResults(false);
|
->setBase($this->userBaseDn)
|
||||||
if ($this->userFilter) {
|
->setUsePagedResults(false);
|
||||||
$userQuery->where(new Expression($this->userFilter));
|
if ($this->userFilter) {
|
||||||
}
|
$userQuery->where(new Expression($this->userFilter));
|
||||||
|
}
|
||||||
|
|
||||||
if (($userDn = $userQuery->fetchDn()) === null) {
|
if (($userDn = $userQuery->fetchDn()) === null) {
|
||||||
return array();
|
return array();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$groupQuery = $this->ds
|
$groupQuery = $this->ds
|
||||||
|
Loading…
x
Reference in New Issue
Block a user