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

Merge pull request #9006 from owncloud/ldap_fix_bgjob

LDAP: fix background job, fixes #8995
parents 09dea42f fe0b75cc
No related branches found
No related tags found
No related merge requests found
...@@ -469,8 +469,7 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { ...@@ -469,8 +469,7 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
} }
//if group really still exists, we will be able to read its objectclass //if group really still exists, we will be able to read its objectclass
$objcs = $this->access->readAttribute($dn, 'objectclass'); if(!is_array($this->access->readAttribute($dn, ''))) {
if(!$objcs || empty($objcs)) {
$this->access->connection->writeToCache('groupExists'.$gid, false); $this->access->connection->writeToCache('groupExists'.$gid, false);
return false; return false;
} }
......
...@@ -160,8 +160,14 @@ class Jobs extends \OC\BackgroundJob\TimedJob { ...@@ -160,8 +160,14 @@ class Jobs extends \OC\BackgroundJob\TimedJob {
$ldapWrapper = new LDAP(); $ldapWrapper = new LDAP();
if(count($configPrefixes) === 1) { if(count($configPrefixes) === 1) {
//avoid the proxy when there is only one LDAP server configured //avoid the proxy when there is only one LDAP server configured
$userManager = new user\Manager(
\OC::$server->getConfig(),
new FilesystemHelper(),
new LogWrapper(),
\OC::$server->getAvatarManager(),
new \OCP\Image());
$connector = new Connection($ldapWrapper, $configPrefixes[0]); $connector = new Connection($ldapWrapper, $configPrefixes[0]);
$ldapAccess = new Access($connector, $ldapWrapper); $ldapAccess = new Access($connector, $ldapWrapper, $userManager);
self::$groupBE = new \OCA\user_ldap\GROUP_LDAP($ldapAccess); self::$groupBE = new \OCA\user_ldap\GROUP_LDAP($ldapAccess);
} else { } else {
self::$groupBE = new \OCA\user_ldap\Group_Proxy($configPrefixes, $ldapWrapper); self::$groupBE = new \OCA\user_ldap\Group_Proxy($configPrefixes, $ldapWrapper);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment