You are here

private function DrupalUserProcessor::loginDrupalAccountProvisioning in Lightweight Directory Access Protocol (LDAP) 8.3

Handle account login with Drupal provisioning.

1 call to DrupalUserProcessor::loginDrupalAccountProvisioning()
DrupalUserProcessor::drupalUserLogsIn in ldap_user/src/Processor/DrupalUserProcessor.php
Handle Drupal user login.

File

ldap_user/src/Processor/DrupalUserProcessor.php, line 894

Class

DrupalUserProcessor
Handles processing of a user from LDAP to Drupal.

Namespace

Drupal\ldap_user\Processor

Code

private function loginDrupalAccountProvisioning() {
  if (LdapConfiguration::provisionsDrupalAccountsFromLdap() && in_array(self::EVENT_SYNC_TO_DRUPAL_USER, array_keys(LdapConfiguration::provisionsDrupalEvents()))) {
    $ldap_user = $this->factory
      ->getUserDataFromServerByAccount($this->account, $this->config
      ->get('drupalAcctProvisionServer'), 'ldap_user_prov_to_drupal');
    if ($ldap_user) {
      $this->server = $this->factory
        ->getServerById($this->config
        ->get('drupalAcctProvisionServer'));
      $this
        ->applyAttributesToAccount($ldap_user, self::PROVISION_TO_DRUPAL, [
        self::EVENT_SYNC_TO_DRUPAL_USER,
      ]);
    }
    $this
      ->saveAccount();
  }
}