diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2014-02-27 16:18:03 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2014-03-03 10:20:25 +0100 |
commit | a8883f4ed22f32ef8eccca5dc0433d7219b9ab57 (patch) | |
tree | 973dece4743d0db236af11e1e962a84f7da720d6 /apps/user_ldap/user_proxy.php | |
parent | 084050530cdaf045e2bea33ce956278c5448640d (diff) | |
download | nextcloud-server-a8883f4ed22f32ef8eccca5dc0433d7219b9ab57.tar.gz nextcloud-server-a8883f4ed22f32ef8eccca5dc0433d7219b9ab57.zip |
LDAP: let proxy for multiple server access methods from Access
Diffstat (limited to 'apps/user_ldap/user_proxy.php')
-rw-r--r-- | apps/user_ldap/user_proxy.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/user_ldap/user_proxy.php b/apps/user_ldap/user_proxy.php index 5ad127197f3..67f8639b181 100644 --- a/apps/user_ldap/user_proxy.php +++ b/apps/user_ldap/user_proxy.php @@ -54,8 +54,12 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { protected function walkBackends($uid, $method, $parameters) { $cacheKey = $this->getUserCacheKey($uid); foreach($this->backends as $configPrefix => $backend) { -// print("walkBackend '$configPrefix'<br/>"); - if($result = call_user_func_array(array($backend, $method), $parameters)) { + $instance = $backend; + if(!method_exists($instance, $method) + && method_exists($this->getAccess($configPrefix), $method)) { + $instance = $this->getAccess($configPrefix); + } + if($result = call_user_func_array(array($instance, $method), $parameters)) { $this->writeToCache($cacheKey, $configPrefix); return $result; } @@ -75,9 +79,14 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { $cacheKey = $this->getUserCacheKey($uid); $prefix = $this->getFromCache($cacheKey); //in case the uid has been found in the past, try this stored connection first - if(!is_null($prefix)) { + if(false && !is_null($prefix)) { if(isset($this->backends[$prefix])) { - $result = call_user_func_array(array($this->backends[$prefix], $method), $parameters); + $instance = $this->backends[$prefix]; + if(!method_exists($instance, $method) + && method_exists($this->getAccess($prefix), $method)) { + $instance = $this->getAccess($prefix); + } + $result = call_user_func_array(array($instance, $method), $parameters); if($result === $passOnWhen) { //not found here, reset cache to null if user vanished //because sometimes methods return false with a reason |