Skip to content
Snippets Groups Projects
Commit b066c0ff authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

LDAP: reset user/group-config association only after exists-check, may performance in some cases

parent edd37c77
No related branches found
No related tags found
No related merge requests found
...@@ -76,8 +76,15 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { ...@@ -76,8 +76,15 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface {
if(isset($this->backends[$prefix])) { if(isset($this->backends[$prefix])) {
$result = call_user_func_array(array($this->backends[$prefix], $method), $parameters); $result = call_user_func_array(array($this->backends[$prefix], $method), $parameters);
if(!$result) { if(!$result) {
//not found here, reset cache to null //not found here, reset cache to null if group vanished
$this->writeToCache($cacheKey, null); //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; return $result;
} }
......
...@@ -76,8 +76,15 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { ...@@ -76,8 +76,15 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface {
if(isset($this->backends[$prefix])) { if(isset($this->backends[$prefix])) {
$result = call_user_func_array(array($this->backends[$prefix], $method), $parameters); $result = call_user_func_array(array($this->backends[$prefix], $method), $parameters);
if(!$result) { if(!$result) {
//not found here, reset cache to null //not found here, reset cache to null if user vanished
$this->writeToCache($cacheKey, null); //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; return $result;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment