Merge pull request #43 from jorhett/master

refs #9950
This commit is contained in:
Matthias Jentsch 2015-09-22 12:07:32 +02:00
commit aebc48cb03

View File

@ -543,15 +543,22 @@ class LdapUserGroupBackend /*extends LdapRepository*/ implements UserGroupBacken
$userQuery->where(new Expression($this->userFilter)); $userQuery->where(new Expression($this->userFilter));
} }
if (($userDn = $userQuery->fetchDn()) === null) { # Posix group only uses simple user name
return array(); if ($this->groupClass == 'posixGroup') {
$queryUsername = $user->getUsername();
}
# LDAP groups use the complete DN
else {
if (($queryUsername = $userQuery->fetchDn()) === null) {
return array();
}
} }
} }
$groupQuery = $this->ds $groupQuery = $this->ds
->select() ->select()
->from($this->groupClass, array($this->groupNameAttribute)) ->from($this->groupClass, array($this->groupNameAttribute))
->where($this->groupMemberAttribute, $userDn) ->where($this->groupMemberAttribute, $queryUsername)
->setBase($this->groupBaseDn); ->setBase($this->groupBaseDn);
if ($this->groupFilter) { if ($this->groupFilter) {
$groupQuery->where(new Expression($this->groupFilter)); $groupQuery->where(new Expression($this->groupFilter));