summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-04-23 09:44:38 -0700
committerBart Visscher <bartv@thisnet.nl>2013-04-23 09:44:38 -0700
commitc357f7b8cd6b1997b4e7843694358cff87b0ba47 (patch)
treeb1431e5ad3ef012c3f1e76140868e5459709ae9d /apps
parent495868497c4ea38e47d979dfd0db8bd879ac489a (diff)
parentb066c0ff4480c3054630cdd846eda0043ee41d52 (diff)
downloadnextcloud-server-c357f7b8cd6b1997b4e7843694358cff87b0ba47.tar.gz
nextcloud-server-c357f7b8cd6b1997b4e7843694358cff87b0ba47.zip
Merge pull request #3082 from owncloud/ldap_confcache_opt
LDAP: reset user/group-config association only after exists-check, may p...
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/group_proxy.php11
-rw-r--r--apps/user_ldap/user_proxy.php11
2 files changed, 18 insertions, 4 deletions
diff --git a/apps/user_ldap/group_proxy.php b/apps/user_ldap/group_proxy.php
index 68d2efe3871..75e7cd46336 100644
--- a/apps/user_ldap/group_proxy.php
+++ b/apps/user_ldap/group_proxy.php
@@ -76,8 +76,15 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface {
if(isset($this->backends[$prefix])) {
$result = call_user_func_array(array($this->backends[$prefix], $method), $parameters);
if(!$result) {
- //not found here, reset cache to null
- $this->writeToCache($cacheKey, null);
+ //not found here, reset cache to null if group vanished
+ //because sometimes methods return false with a reason
+ $groupExists = call_user_func_array(
+ array($this->backends[$prefix], 'groupExists'),
+ array($gid)
+ );
+ if(!$groupExists) {
+ $this->writeToCache($cacheKey, null);
+ }
}
return $result;
}
diff --git a/apps/user_ldap/user_proxy.php b/apps/user_ldap/user_proxy.php
index 6a75bae3815..7e5b9045df3 100644
--- a/apps/user_ldap/user_proxy.php
+++ b/apps/user_ldap/user_proxy.php
@@ -76,8 +76,15 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface {
if(isset($this->backends[$prefix])) {
$result = call_user_func_array(array($this->backends[$prefix], $method), $parameters);
if(!$result) {
- //not found here, reset cache to null
- $this->writeToCache($cacheKey, null);
+ //not found here, reset cache to null if user vanished
+ //because sometimes methods return false with a reason
+ $userExists = call_user_func_array(
+ array($this->backends[$prefix], 'userExists'),
+ array($uid)
+ );
+ if(!$userExists) {
+ $this->writeToCache($cacheKey, null);
+ }
}
return $result;
}