public function LdapEntryProvisionSubscriber::userCreated in Lightweight Directory Access Protocol (LDAP) 8.4
Create or update LDAP entries on user creation.
Parameters
\Drupal\ldap_user\Event\LdapNewUserCreatedEvent $event: Event.
File
- ldap_user/
src/ EventSubscriber/ LdapEntryProvisionSubscriber.php, line 223
Class
- LdapEntryProvisionSubscriber
- Event subscribers for creating and updating LDAP entries.
Namespace
Drupal\ldap_user\EventSubscriberCode
public function userCreated(LdapNewUserCreatedEvent $event) : void {
$this->account = $event->account;
if ($this
->provisionLdapEntriesFromDrupalUsers() && \in_array(self::PROVISION_LDAP_ENTRY_ON_USER_ON_USER_UPDATE_CREATE, $this->config
->get('ldapEntryProvisionTriggers'), TRUE) && $this->account
->get('ldap_user_ldap_exclude')
->getString() !== '1') {
$this
->loadServer();
if ($this
->checkExistingLdapEntry()) {
$this
->syncToLdapEntry();
}
else {
$this
->provisionLdapEntry();
}
}
}