From b186cffdbe26ea3390e9ff35071b36a81f57c033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 25 May 2023 11:31:29 +0200 Subject: [PATCH] Use default page size for jumping to desired offset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/user_ldap/lib/Access.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 3f120caefe6..a6c48f383d2 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -1993,8 +1993,9 @@ class Access extends LDAPUtility { // 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 = ($offset - $pageSize) < 0 ? 0 : $offset - $pageSize; - $this->search($filter, $base, $attr, $pageSize, $reOffset, true); + $defaultPageSize = (int)$this->connection->ldapPagingSize; + $reOffset = ($offset - $defaultPageSize) < 0 ? 0 : $offset - $defaultPageSize; + $this->search($filter, $base, $attr, $defaultPageSize, $reOffset, true); if (!$this->hasMoreResults()) { // when the cookie is reset with != 0 offset, there are no further // results, so stop.