Don't remove last user in ldap group when limit is -1

Signed-off-by: Clement Wong <git@clement.hk>
This commit is contained in:
Clement Wong 2020-04-27 02:28:47 +02:00 committed by Arthur Schiwon
parent c8973c662e
commit 78571eb0c2
No known key found for this signature in database
GPG key ID: 7424F1874854DF23

View file

@ -829,6 +829,9 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
return $groupUsers;
}
if ($limit === -1) {
$limit = null;
}
// check for cache of the query without limit and offset
$groupUsers = $this->access->connection->getFromCache('usersInGroup-'.$gid.'-'.$search);
if(!is_null($groupUsers)) {
@ -837,9 +840,6 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
return $groupUsers;
}
if($limit === -1) {
$limit = null;
}
$groupDN = $this->access->groupname2dn($gid);
if(!$groupDN) {
// group couldn't be found, return empty resultset