]> source.dussan.org Git - nextcloud-server.git/commitdiff
set up paged search when limit is 0
authorArthur Schiwon <blizzz@owncloud.com>
Thu, 5 Mar 2015 12:15:21 +0000 (13:15 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Thu, 5 Mar 2015 12:22:52 +0000 (13:22 +0100)
apps/user_ldap/lib/access.php

index a79598d7ca740d6c64cc308b93496b119e36d332..60956c5fea571d530993fdb7312fe4e80ad3ad02 100644 (file)
@@ -1541,6 +1541,17 @@ class Access extends LDAPUtility implements user\IUserTools {
                                }
 
                        }
+               } else if($this->connection->hasPagedResultSupport && intval($limit) === 0) {
+                       // a search without limit was requested. However, if we do use
+                       // Paged Search once, we always must do it. This requires us to
+                       // initialize it with the configured page size.
+                       $this->abandonPagedSearch();
+                       // in case someone set it to 0 … use 500, otherwise no results will
+                       // be returned.
+                       $pageSize = intval($this->connection->ldapPagingSize) > 0 ? intval($this->connection->ldapPagingSize) : 500;
+                       $pagedSearchOK = $this->ldap->controlPagedResult(
+                               $this->connection->getConnectionResource(), $pageSize, false, ''
+                       );
                }
 
                return $pagedSearchOK;