summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/user_ldap/lib/Access.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index d07a8a030a3..b84f5a38b31 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -1914,11 +1914,8 @@ class Access extends LDAPUtility implements IUserTools {
// no cookie known from a potential previous search. We need
// to start from 0 to come to the desired page. cookie value
// of '0' is valid, because 389ds
- $reOffset = 0;
- while($reOffset < $offset) {
- $this->search($filter, array($base), $attr, $limit, $reOffset, true);
- $reOffset += $limit;
- }
+ $reOffset = ($offset - $limit) < 0 ? 0 : $offset - $limit;
+ $this->search($filter, array($base), $attr, $limit, $reOffset, true);
$cookie = $this->getPagedResultCookie($base, $filter, $limit, $offset);
//still no cookie? obviously, the server does not like us. Let's skip paging efforts.
// '0' is valid, because 389ds