summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-11-19 18:16:08 +0100
committerArthur Schiwon <blizzz@owncloud.com>2014-11-19 20:27:20 +0100
commit56fabf8adf693913ba60996033de18eb68188a0d (patch)
tree91ce3c43ced4f190b253d2ed87af4e969c30d8b4
parent42ada6cb1587e064033e337133d49a860e2a1dec (diff)
downloadnextcloud-server-56fabf8adf693913ba60996033de18eb68188a0d.tar.gz
nextcloud-server-56fabf8adf693913ba60996033de18eb68188a0d.zip
cache total user count
-rw-r--r--apps/user_ldap/user_ldap.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 6e244311d4a..b7846625d9e 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -292,7 +292,12 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
public function countUsers() {
$filter = \OCP\Util::mb_str_replace(
'%uid', '*', $this->access->connection->ldapLoginFilter, 'UTF-8');
+ $cacheKey = 'countUsers-'.$filter;
+ if(!is_null($entries = $this->access->connection->getFromCache($cacheKey))) {
+ return $entries;
+ }
$entries = $this->access->countUsers($filter);
+ $this->access->connection->writeToCache($cacheKey, $entries);
return $entries;
}
}