private function DrupalUserProcessor::loginLdapEntryProvisioning in Lightweight Directory Access Protocol (LDAP) 8.3
Handle account login with LDAP entry provisioning.
1 call to DrupalUserProcessor::loginLdapEntryProvisioning()
- DrupalUserProcessor::drupalUserLogsIn in ldap_user/
src/ Processor/ DrupalUserProcessor.php - Handle Drupal user login.
File
- ldap_user/
src/ Processor/ DrupalUserProcessor.php, line 866
Class
- DrupalUserProcessor
- Handles processing of a user from LDAP to Drupal.
Namespace
Drupal\ldap_user\ProcessorCode
private function loginLdapEntryProvisioning() {
if ($this
->provisionsLdapEntriesFromDrupalUsers() && LdapConfiguration::provisionAvailableToLdap(self::PROVISION_LDAP_ENTRY_ON_USER_ON_USER_AUTHENTICATION)) {
$ldapUserProcessor = new LdapUserProcessor();
// Provision entry.
if (SemaphoreStorage::get('provision', $this->account
->getAccountName()) == FALSE && !$ldapUserProcessor
->getProvisionRelatedLdapEntry($this->account)) {
$provisionResult = $ldapUserProcessor
->provisionLdapEntry($this->account);
if ($provisionResult['status'] == 'success') {
SemaphoreStorage::set('provision', $this->account
->getAccountName());
}
}
// Sync entry if not just provisioned.
if (SemaphoreStorage::get('provision', $this->account
->getAccountName()) == FALSE && SemaphoreStorage::get('sync', $this->account
->getAccountName()) == FALSE) {
$result = $ldapUserProcessor
->syncToLdapEntry($this->account);
if ($result) {
SemaphoreStorage::set('sync', $this->account
->getAccountName());
}
}
}
}