aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Group_Proxy.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2020-03-12 12:45:52 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2020-04-17 12:38:52 +0200
commitcc31c3827749e2eeb3437648226413742ffe7dcd (patch)
treee9a3aee401957e992d59285467305f0074490a4c /apps/user_ldap/lib/Group_Proxy.php
parente8ddb4718cee824af3bb24cae247fe64d043a96a (diff)
downloadnextcloud-server-cc31c3827749e2eeb3437648226413742ffe7dcd.tar.gz
nextcloud-server-cc31c3827749e2eeb3437648226413742ffe7dcd.zip
don't circulate with only one backend
- saves some overhead costs - in some occasions saves LDAP requests Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib/Group_Proxy.php')
-rw-r--r--apps/user_ldap/lib/Group_Proxy.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php
index 3bd0cc4c400..a586906df8e 100644
--- a/apps/user_ldap/lib/Group_Proxy.php
+++ b/apps/user_ldap/lib/Group_Proxy.php
@@ -60,7 +60,9 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
$cacheKey = $this->getGroupCacheKey($gid);
foreach ($this->backends as $configPrefix => $backend) {
if ($result = call_user_func_array([$backend, $method], $parameters)) {
- $this->writeToCache($cacheKey, $configPrefix);
+ if(!$this->isSingleBackend()) {
+ $this->writeToCache($cacheKey, $configPrefix);
+ }
return $result;
}
}
@@ -99,6 +101,10 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
return false;
}
+ protected function activeBackends(): int {
+ return count($this->backends);
+ }
+
/**
* is user in group?
* @param string $uid uid of the user