diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2012-10-27 17:36:08 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2012-10-27 17:46:01 +0200 |
commit | 5b3c9518dc2e41c2da314c183678e03f799c2415 (patch) | |
tree | b00aa3ed619eb7986dff36f26c2a268f3f81a0af /apps/user_ldap/lib/access.php | |
parent | 33aa630af3cedf146b1c51575200f8a723ae1fa3 (diff) | |
download | nextcloud-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.php | 11 |
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)) { |