diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-06-18 20:03:59 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-07-19 18:41:29 +0200 |
commit | f6d133955e2adde02d3ee1a1065232b6315fafac (patch) | |
tree | 6fb22eb88d96284e92a00661274a6109ffb9c14a | |
parent | a8dfee04b88132f0be8807c53562ef4f0ad5a7fc (diff) | |
download | nextcloud-server-f6d133955e2adde02d3ee1a1065232b6315fafac.tar.gz nextcloud-server-f6d133955e2adde02d3ee1a1065232b6315fafac.zip |
LDAP: fix background job, resolves #3528
-rw-r--r-- | apps/user_ldap/lib/jobs.php | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/apps/user_ldap/lib/jobs.php b/apps/user_ldap/lib/jobs.php index 60ecc0da33d..d626afed6c3 100644 --- a/apps/user_ldap/lib/jobs.php +++ b/apps/user_ldap/lib/jobs.php @@ -134,21 +134,19 @@ class Jobs extends \OC\BackgroundJob\TimedJob { \OCP\Util::DEBUG); } - static private function getConnector() { - if(!is_null(self::$connector)) { - return self::$connector; - } - self::$connector = new \OCA\user_ldap\lib\Connection('user_ldap'); - return self::$connector; - } - static private function getGroupBE() { if(!is_null(self::$groupBE)) { return self::$groupBE; } - self::getConnector(); - self::$groupBE = new \OCA\user_ldap\GROUP_LDAP(); - self::$groupBE->setConnector(self::$connector); + $configPrefixes = Helper::getServerConfigurationPrefixes(true); + if(count($configPrefixes) == 1) { + //avoid the proxy when there is only one LDAP server configured + $connector = new Connection($configPrefixes[0]); + self::$groupBE = new \OCA\user_ldap\GROUP_LDAP(); + self::$groupBE->setConnector($connector); + } else { + self::$groupBE = new \OCA\user_ldap\Group_Proxy($configPrefixes); + } return self::$groupBE; } |