summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Group_LDAP.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/lib/Group_LDAP.php')
-rw-r--r--apps/user_ldap/lib/Group_LDAP.php16
1 files changed, 2 insertions, 14 deletions
diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php
index 5a209a3317e..60ce664684a 100644
--- a/apps/user_ldap/lib/Group_LDAP.php
+++ b/apps/user_ldap/lib/Group_LDAP.php
@@ -804,16 +804,9 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface {
}
$primaryUsers = $this->getUsersInPrimaryGroup($groupDN, $search, $limit, $offset);
- $members = array_keys($this->_groupMembers($groupDN));
- if(!$members && empty($primaryUsers)) {
- //in case users could not be retrieved, return empty result set
- $this->access->connection->writeToCache($cacheKey, array());
- return array();
- }
-
$posixGroupUsers = $this->getUsersInGidNumber($groupDN, $search, $limit, $offset);
$members = array_keys($this->_groupMembers($groupDN));
- if(!$members && empty($posixGroupUsers)) {
+ if(!$members && empty($posixGroupUsers) && empty($primaryUsers)) {
//in case users could not be retrieved, return empty result set
$this->access->connection->writeToCache($cacheKey, []);
return [];
@@ -850,12 +843,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface {
}
}
- $groupUsers = array_unique(array_merge($groupUsers, $primaryUsers));
- natsort($groupUsers);
- $this->access->connection->writeToCache('usersInGroup-'.$gid.'-'.$search, $groupUsers);
- $groupUsers = array_slice($groupUsers, $offset, $limit);
-
- $groupUsers = array_unique(array_merge($groupUsers, $posixGroupUsers));
+ $groupUsers = array_unique(array_merge($groupUsers, $primaryUsers, $posixGroupUsers));
natsort($groupUsers);
$this->access->connection->writeToCache('usersInGroup-'.$gid.'-'.$search, $groupUsers);
$groupUsers = array_slice($groupUsers, $offset, $limit);