From 23631c8f3964df813541b4a2c9f7ce3319d4d41e Mon Sep 17 00:00:00 2001 From: Aaron Collins Date: Tue, 22 Sep 2015 13:04:32 -0700 Subject: [PATCH] changed order of posix check refs #9950 Signed-off-by: Eric Lippmann --- .../Authentication/UserGroup/LdapUserGroupBackend.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/Icinga/Authentication/UserGroup/LdapUserGroupBackend.php b/library/Icinga/Authentication/UserGroup/LdapUserGroupBackend.php index 037588992..9cd607c58 100644 --- a/library/Icinga/Authentication/UserGroup/LdapUserGroupBackend.php +++ b/library/Icinga/Authentication/UserGroup/LdapUserGroupBackend.php @@ -486,6 +486,8 @@ class LdapUserGroupBackend extends LdapRepository implements UserGroupBackendInt */ public function getMemberships(User $user) { + $queryUsername = $user->getUsername(); + if (($userDn = $user->getAdditional('ldap_dn')) === null) { $userQuery = $this->ds ->select() @@ -497,10 +499,7 @@ class LdapUserGroupBackend extends LdapRepository implements UserGroupBackendInt $userQuery->where(new Expression($this->userFilter)); } - if ($this->groupClass == 'posixGroup') { - $queryUsername = $user->getUsername(); - } - else { + if ($this->groupClass != 'posixGroup') { if (($queryUsername = $userQuery->fetchDn()) === null) { return array(); }