summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-04-25 15:07:05 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-04-25 15:07:05 +0200
commit43f451e9e0e92c99285a471209e6645ff0b0eed9 (patch)
treeee0d2c480fed33f5d625cff2efcec90d02a4193b /apps/user_ldap/lib
parent685faad5ca437895e035cfe9583e1978e6ddedba (diff)
downloadnextcloud-server-43f451e9e0e92c99285a471209e6645ff0b0eed9.tar.gz
nextcloud-server-43f451e9e0e92c99285a471209e6645ff0b0eed9.zip
Fix usersInGroup retrieval
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib')
-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);