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

LDAP: fix background job, resolves #3528

parent a8dfee04
Branches
No related tags found
No related merge requests found
...@@ -134,21 +134,19 @@ class Jobs extends \OC\BackgroundJob\TimedJob { ...@@ -134,21 +134,19 @@ class Jobs extends \OC\BackgroundJob\TimedJob {
\OCP\Util::DEBUG); \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() { static private function getGroupBE() {
if(!is_null(self::$groupBE)) { if(!is_null(self::$groupBE)) {
return self::$groupBE; return self::$groupBE;
} }
self::getConnector(); $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 = new \OCA\user_ldap\GROUP_LDAP();
self::$groupBE->setConnector(self::$connector); self::$groupBE->setConnector($connector);
} else {
self::$groupBE = new \OCA\user_ldap\Group_Proxy($configPrefixes);
}
return self::$groupBE; return self::$groupBE;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment