Merge pull request #9006 from owncloud/ldap_fix_bgjob

LDAP: fix background job, fixes #8995
This commit is contained in:
blizzz 2014-07-01 14:28:04 +02:00
commit 16ce23d19d
2 changed files with 8 additions and 3 deletions

View file

@ -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
$objcs = $this->access->readAttribute($dn, 'objectclass');
if(!$objcs || empty($objcs)) {
if(!is_array($this->access->readAttribute($dn, ''))) {
$this->access->connection->writeToCache('groupExists'.$gid, false);
return false;
}

View file

@ -160,8 +160,14 @@ class Jobs extends \OC\BackgroundJob\TimedJob {
$ldapWrapper = new LDAP();
if(count($configPrefixes) === 1) {
//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]);
$ldapAccess = new Access($connector, $ldapWrapper);
$ldapAccess = new Access($connector, $ldapWrapper, $userManager);
self::$groupBE = new \OCA\user_ldap\GROUP_LDAP($ldapAccess);
} else {
self::$groupBE = new \OCA\user_ldap\Group_Proxy($configPrefixes, $ldapWrapper);