summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/group_ldap.php
diff options
context:
space:
mode:
authorroot <leo@strike.wu.ac.at>2014-03-04 21:07:27 +0100
committerroot <leo@strike.wu.ac.at>2014-03-04 21:07:27 +0100
commiteb1e36182470b5aa71b4ecd2253479e81c388898 (patch)
treeb01f2d047bba8a7439195fa7e0327387b4bad22b /apps/user_ldap/group_ldap.php
parenteb59e63c3b031b9a80a24865beb41a94eaa3b246 (diff)
downloadnextcloud-server-eb1e36182470b5aa71b4ecd2253479e81c388898.tar.gz
nextcloud-server-eb1e36182470b5aa71b4ecd2253479e81c388898.zip
getGroups() $limit was not handled correctly
Diffstat (limited to 'apps/user_ldap/group_ldap.php')
-rw-r--r--apps/user_ldap/group_ldap.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php
index c1008a5deda..861636a763f 100644
--- a/apps/user_ldap/group_ldap.php
+++ b/apps/user_ldap/group_ldap.php
@@ -353,10 +353,15 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
|| empty($pagingsize)) {
return $this->getGroupsChunk($search, $limit, $offset);
}
+ if ($limit > -1) {
+ $overall_limit = min($limit, 100000);
+ } else {
+ $overall_limit = 100000;
+ }
$chunk_offset = $offset;
$all_groups = array();
- while ($chunk_offset < $max_groups) {
- $chunk_limit = min($pagingsize, $max_groups - $chunk_offset);
+ while ($chunk_offset < $overall_limit) {
+ $chunk_limit = min($pagingsize, $overall_limit - $chunk_offset);
$ldap_groups = $this->getGroupsChunk('', $chunk_limit, $chunk_offset);
$nread = count($ldap_groups);
\OCP\Util::writeLog('user_ldap', 'getAllGroups('.$search.'): read '.$nread.' at offset '.$chunk_offset.' (limit: '.$chunk_limit.')', \OCP\Util::DEBUG);