changed order of posix check

refs #9950

Signed-off-by: Eric Lippmann <eric.lippmann@netways.de>
This commit is contained in:
Aaron Collins 2015-09-22 13:04:32 -07:00 committed by Eric Lippmann
parent 73715c94b1
commit 23631c8f39
1 changed files with 3 additions and 4 deletions

View File

@ -486,6 +486,8 @@ class LdapUserGroupBackend extends LdapRepository implements UserGroupBackendInt
*/ */
public function getMemberships(User $user) public function getMemberships(User $user)
{ {
$queryUsername = $user->getUsername();
if (($userDn = $user->getAdditional('ldap_dn')) === null) { if (($userDn = $user->getAdditional('ldap_dn')) === null) {
$userQuery = $this->ds $userQuery = $this->ds
->select() ->select()
@ -497,10 +499,7 @@ class LdapUserGroupBackend extends LdapRepository implements UserGroupBackendInt
$userQuery->where(new Expression($this->userFilter)); $userQuery->where(new Expression($this->userFilter));
} }
if ($this->groupClass == 'posixGroup') { if ($this->groupClass != 'posixGroup') {
$queryUsername = $user->getUsername();
}
else {
if (($queryUsername = $userQuery->fetchDn()) === null) { if (($queryUsername = $userQuery->fetchDn()) === null) {
return array(); return array();
} }