0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-03-16 01:05:24 +00:00

Use default page size for jumping to desired offset

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2023-05-25 11:31:29 +02:00
parent b313e2a507
commit b186cffdbe
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -1993,8 +1993,9 @@ class Access extends LDAPUtility {
// no cookie known from a potential previous search. We need // no cookie known from a potential previous search. We need
// to start from 0 to come to the desired page. cookie value // to start from 0 to come to the desired page. cookie value
// of '0' is valid, because 389ds // of '0' is valid, because 389ds
$reOffset = ($offset - $pageSize) < 0 ? 0 : $offset - $pageSize; $defaultPageSize = (int)$this->connection->ldapPagingSize;
$this->search($filter, $base, $attr, $pageSize, $reOffset, true); $reOffset = ($offset - $defaultPageSize) < 0 ? 0 : $offset - $defaultPageSize;
$this->search($filter, $base, $attr, $defaultPageSize, $reOffset, true);
if (!$this->hasMoreResults()) { if (!$this->hasMoreResults()) {
// when the cookie is reset with != 0 offset, there are no further // when the cookie is reset with != 0 offset, there are no further
// results, so stop. // results, so stop.