diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php index 6d9acd79d58cf..cc0bcae1608eb 100644 --- a/apps/user_ldap/lib/Group_LDAP.php +++ b/apps/user_ldap/lib/Group_LDAP.php @@ -828,6 +828,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)) { @@ -836,9 +839,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