summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/user_proxy.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-01-08 12:07:57 +0100
committerArthur Schiwon <blizzz@owncloud.com>2014-01-08 12:07:57 +0100
commitb669e1a3c13dc6fabc8929a4abc4fd13fb8a4450 (patch)
tree1f4e9e9cb450be5e832c9dc6b5fcc6007a277eb5 /apps/user_ldap/user_proxy.php
parentbc1235d325c5b8ff659afc6700e82e35e2912fbb (diff)
downloadnextcloud-server-b669e1a3c13dc6fabc8929a4abc4fd13fb8a4450.tar.gz
nextcloud-server-b669e1a3c13dc6fabc8929a4abc4fd13fb8a4450.zip
LDAP: implement userCount action. This required to (finally) clean up and refactor the search method, which will have a positive performance impact on paged search.
Diffstat (limited to 'apps/user_ldap/user_proxy.php')
-rw-r--r--apps/user_ldap/user_proxy.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/user_ldap/user_proxy.php b/apps/user_ldap/user_proxy.php
index b073b143e74..5ad127197f3 100644
--- a/apps/user_ldap/user_proxy.php
+++ b/apps/user_ldap/user_proxy.php
@@ -210,4 +210,19 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface {
return $this->refBackend->hasUserListings();
}
+ /**
+ * @brief Count the number of users
+ * @returns int | bool
+ */
+ public function countUsers() {
+ $users = false;
+ foreach($this->backends as $backend) {
+ $backendUsers = $backend->countUsers();
+ if ($backendUsers !== false) {
+ $users += $backendUsers;
+ }
+ }
+ return $users;
+ }
+
}