You are here

private function LoginValidator::replaceUserMailWithTemplate in Lightweight Directory Access Protocol (LDAP) 8.3

Replace user email address with template.

2 calls to LoginValidator::replaceUserMailWithTemplate()
LoginValidator::prepareEmailTemplateToken in ldap_authentication/src/Controller/LoginValidator.php
Prepare the email template token.
LoginValidator::provisionDrupalUser in ldap_authentication/src/Controller/LoginValidator.php
Provision the Drupal user.

File

ldap_authentication/src/Controller/LoginValidator.php, line 896

Class

LoginValidator
Handles the actual testing of credentials and authentication of users.

Namespace

Drupal\ldap_authentication\Controller

Code

private function replaceUserMailWithTemplate() {

  // Fallback template in case one was not specified.
  $template = '@username@localhost';
  if (!empty($this->config
    ->get('emailTemplate'))) {
    $template = $this->config
      ->get('emailTemplate');
  }
  $this->ldapUser['mail'] = SafeMarkup::format($template, $this->emailTemplateTokens)
    ->__toString();
}