public function LdapEntryProvisionSubscriber::login in Lightweight Directory Access Protocol (LDAP) 8.4
Handle account login with LDAP entry provisioning.
Parameters
\Drupal\ldap_user\Event\LdapUserLoginEvent $event: Event.
File
- ldap_user/
src/ EventSubscriber/ LdapEntryProvisionSubscriber.php, line 172
Class
- LdapEntryProvisionSubscriber
- Event subscribers for creating and updating LDAP entries.
Namespace
Drupal\ldap_user\EventSubscriberCode
public function login(LdapUserLoginEvent $event) : void {
$this->account = $event->account;
$triggers = $this->config
->get('ldapEntryProvisionTriggers');
if ($this
->provisionLdapEntriesFromDrupalUsers() && \in_array(self::PROVISION_LDAP_ENTRY_ON_USER_ON_USER_AUTHENTICATION, $triggers, TRUE) && $this->account
->get('ldap_user_ldap_exclude')
->getString() !== '1') {
$this
->loadServer();
if ($this
->checkExistingLdapEntry()) {
$this
->syncToLdapEntry();
}
else {
// This should only be necessary if the entry was deleted on the
// directory server.
$this
->provisionLdapEntry();
}
}
}