summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/access.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-10-27 17:36:08 +0200
committerArthur Schiwon <blizzz@owncloud.com>2012-10-27 17:46:01 +0200
commit5b3c9518dc2e41c2da314c183678e03f799c2415 (patch)
treeb00aa3ed619eb7986dff36f26c2a268f3f81a0af /apps/user_ldap/lib/access.php
parent33aa630af3cedf146b1c51575200f8a723ae1fa3 (diff)
downloadnextcloud-server-5b3c9518dc2e41c2da314c183678e03f799c2415.tar.gz
nextcloud-server-5b3c9518dc2e41c2da314c183678e03f799c2415.zip
LDAP: improve slicing
Diffstat (limited to 'apps/user_ldap/lib/access.php')
-rw-r--r--apps/user_ldap/lib/access.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index fa8546f1cea..9b870a8c6dc 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -585,10 +585,14 @@ abstract class Access {
}
$findings = $selection;
}
- if(!$this->pagedSearchedSuccessful
+ //we slice the findings, when
+ //a) paged search insuccessful, though attempted
+ //b) no paged search, but limit set
+ if((!$this->pagedSearchedSuccessful
+ && $pagedSearchOK)
|| (
- !is_null($limit)
- || !is_null($offset)
+ !$pagedSearchOK
+ && !is_null($limit)
)
) {
$findings = array_slice($findings, intval($offset), $limit);
@@ -775,6 +779,7 @@ abstract class Access {
$pagedSearchOK = false;
if($this->connection->hasPagedResultSupport && !is_null($limit)) {
$offset = intval($offset); //can be null
+ \OCP\Util::writeLog('user_ldap', 'initializing paged search for Filter'.$filter.' base '.$base.' attr '.print_r($attr, true). ' limit ' .$limit.' offset '.$offset, \OCP\Util::DEBUG);
//get the cookie from the search for the previous search, required by LDAP
$cookie = $this->getPagedResultCookie($filter, $limit, $offset);
if(empty($cookie) && ($offset > 0)) {