From 78571eb0c268a0215a66fa3f274813f4cda35665 Mon Sep 17 00:00:00 2001 From: Clement Wong Date: Mon, 27 Apr 2020 02:28:47 +0200 Subject: [PATCH] Don't remove last user in ldap group when limit is -1 Signed-off-by: Clement Wong --- apps/user_ldap/lib/Group_LDAP.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php index 40b8bcf16c97a..bdcf9be8d3dd3 100644 --- a/apps/user_ldap/lib/Group_LDAP.php +++ b/apps/user_ldap/lib/Group_LDAP.php @@ -829,6 +829,9 @@ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { 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 @@ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { return $groupUsers; } - if($limit === -1) { - $limit = null; - } $groupDN = $this->access->groupname2dn($gid); if(!$groupDN) { // group couldn't be found, return empty resultset