]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't remove last user in ldap group when limit is -1 20701/head
authorClement Wong <git@clement.hk>
Mon, 27 Apr 2020 00:28:47 +0000 (02:28 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Tue, 28 Apr 2020 11:10:04 +0000 (13:10 +0200)
Signed-off-by: Clement Wong <git@clement.hk>
apps/user_ldap/lib/Group_LDAP.php

index 40b8bcf16c97a9a46ad529d553470cbc7f29f70b..bdcf9be8d3dd372882fae70f22c44c7fe2d2a5e8 100644 (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