diff options
Diffstat (limited to 'apps/user_ldap/lib/Access.php')
-rw-r--r-- | apps/user_ldap/lib/Access.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 989a941f58f..012d9a47123 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -51,6 +51,7 @@ use OCA\User_LDAP\User\OfflineUser; use OCA\User_LDAP\Mapping\AbstractMapping; use OC\ServerNotAvailableException; +use OCP\IServerContainer; /** * Class Access @@ -89,14 +90,22 @@ class Access extends LDAPUtility implements IUserTools { * @var \OCA\User_LDAP\Helper */ private $helper; - - public function __construct(Connection $connection, ILDAPWrapper $ldap, - Manager $userManager, Helper $helper) { + /** @var IServerContainer */ + private $c; + + public function __construct( + Connection $connection, + ILDAPWrapper $ldap, + Manager $userManager, + Helper $helper, + IServerContainer $c + ) { parent::__construct($ldap); $this->connection = $connection; $this->userManager = $userManager; $this->userManager->setLdapAccess($this); $this->helper = $helper; + $this->c = $c; } /** @@ -821,6 +830,8 @@ class Access extends LDAPUtility implements IUserTools { */ public function batchApplyUserAttributes(array $ldapRecords){ $displayNameAttribute = strtolower($this->connection->ldapUserDisplayName); + $config = $this->c->getConfig(); + $isBackgroundJobModeAjax = $config->getAppValue('core', 'backgroundjobs_mode', 'ajax') === 'ajax'; foreach($ldapRecords as $userRecord) { if(!isset($userRecord[$displayNameAttribute])) { // displayName is obligatory @@ -828,7 +839,7 @@ class Access extends LDAPUtility implements IUserTools { } $newlyMapped = false; $ocName = $this->dn2ocname($userRecord['dn'][0], null, true, $newlyMapped); - if($ocName === false || $newlyMapped === false) { + if($ocName === false || ($newlyMapped === false && !$isBackgroundJobModeAjax)) { continue; } $this->cacheUserExists($ocName); |