You are here

function _ldap_authentication_replace_user_email in Lightweight Directory Access Protocol (LDAP) 7.2

Replaces the email address in $ldap_user with one from the template in $auth_conf.

Parameters

array $ldap_user: LDAP user entry.

LdapAuthenticationConf $auth_conf: LDAP authentication configuration class.

1 call to _ldap_authentication_replace_user_email()
_ldap_authentication_user_login_authenticate_validate in ldap_authentication/ldap_authentication.inc
User form validation will take care of username, pwd fields this function validates ldap authentication specific.

File

ldap_authentication/ldap_authentication.inc, line 129
Ldap_authentication helper functions.

Code

function _ldap_authentication_replace_user_email(&$ldap_user, $auth_conf, $tokens) {

  // Fallback template in case one was not specified.
  $template = '@username@localhost';
  if (!empty($auth_conf->emailTemplate)) {
    $template = $auth_conf->emailTemplate;
  }
  $ldap_user['mail'] = format_string($template, $tokens);
}