diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-01 00:51:37 +0400 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-01 00:51:37 +0400 |
commit | 7534fae9bcaf074f4baaa5c95562ac1f3cb008ef (patch) | |
tree | 71c87fc673696ac7f049eaabe0df5c997d18490c | |
parent | 68a9ceacbb7d43bdd0aff00694bca3c672c72a35 (diff) | |
parent | 470a0ad61195abc92e0a223adaf471c378e368b6 (diff) |
Merge pull request #7462 from owncloud/ldap_proxy_access
Ldap proxy access
-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..2cb3dfb2c60 100644 --- a/apps/user_ldap/user_proxy.php +++ b/apps/user_ldap/user_proxy.php @@ -54,11 +54,15 @@ 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; - } + } } return false; } @@ -77,7 +81,12 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { //in case the uid has been found in the past, try this stored connection first if(!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 |