getGroups() $limit was not handled correctly
This commit is contained in:
parent
eb59e63c3b
commit
eb1e361824
1 changed files with 7 additions and 2 deletions
|
@ -353,10 +353,15 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
|
||||||
|| empty($pagingsize)) {
|
|| empty($pagingsize)) {
|
||||||
return $this->getGroupsChunk($search, $limit, $offset);
|
return $this->getGroupsChunk($search, $limit, $offset);
|
||||||
}
|
}
|
||||||
|
if ($limit > -1) {
|
||||||
|
$overall_limit = min($limit, 100000);
|
||||||
|
} else {
|
||||||
|
$overall_limit = 100000;
|
||||||
|
}
|
||||||
$chunk_offset = $offset;
|
$chunk_offset = $offset;
|
||||||
$all_groups = array();
|
$all_groups = array();
|
||||||
while ($chunk_offset < $max_groups) {
|
while ($chunk_offset < $overall_limit) {
|
||||||
$chunk_limit = min($pagingsize, $max_groups - $chunk_offset);
|
$chunk_limit = min($pagingsize, $overall_limit - $chunk_offset);
|
||||||
$ldap_groups = $this->getGroupsChunk('', $chunk_limit, $chunk_offset);
|
$ldap_groups = $this->getGroupsChunk('', $chunk_limit, $chunk_offset);
|
||||||
$nread = count($ldap_groups);
|
$nread = count($ldap_groups);
|
||||||
\OCP\Util::writeLog('user_ldap', 'getAllGroups('.$search.'): read '.$nread.' at offset '.$chunk_offset.' (limit: '.$chunk_limit.')', \OCP\Util::DEBUG);
|
\OCP\Util::writeLog('user_ldap', 'getAllGroups('.$search.'): read '.$nread.' at offset '.$chunk_offset.' (limit: '.$chunk_limit.')', \OCP\Util::DEBUG);
|
||||||
|
|
Loading…
Reference in a new issue