[Pkg-owncloud-commits] [owncloud] 22/44: LDAP: let proxy for multiple server access methods from Access
David Prévot
taffit at moszumanska.debian.org
Fri Mar 7 13:27:24 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 49e567a5cc604bdccfa68f2dacb363a115ecb206
Author: Arthur Schiwon <blizzz at owncloud.com>
Date: Thu Feb 27 16:18:03 2014 +0100
LDAP: let proxy for multiple server access methods from Access
---
apps/user_ldap/user_proxy.php | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/apps/user_ldap/user_proxy.php b/apps/user_ldap/user_proxy.php
index 5ad1271..67f8639 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
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list