You are here

function ldap_authentication_update_8001 in Lightweight Directory Access Protocol (LDAP) 8.4

Same name and namespace in other branches
  1. 8.3 ldap_authentication/ldap_authentication.install \ldap_authentication_update_8001()

Adds missing email template fields.

File

ldap_authentication/ldap_authentication.install, line 38

Code

function ldap_authentication_update_8001() {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('ldap_authentication.settings');
  $config
    ->set('emailTemplateHandling', 'none');
  $config
    ->set('emailTemplate', '@username@example.com');
  $config
    ->set('emailTemplateUsageResolveConflict', FALSE);
  $config
    ->set('emailTemplateUsageNeverUpdate', FALSE);
  $config
    ->set('emailTemplateUsagePromptUser', FALSE);
  $config
    ->set('emailTemplateUsageRedirectOnLogin', FALSE);
  $config
    ->set('emailTemplateUsagePromptRegex', '.*@example\\.com');
  $config
    ->save(TRUE);
}