function shib_auth_custom_mail in Shibboleth Authentication 7.4
Same name and namespace in other branches
- 6.4 shib_auth.module \shib_auth_custom_mail()
User Data Customization function - MAIL.
This function handles the mail customization process.
Parameters
string $uname: The username got from IdP.
string $custom_username: The customized username.
string $custom_mail: The first email address of the user from the IdP.
1 call to shib_auth_custom_mail()
- shib_auth_custom_form in ./
shib_auth.module - Displays custom form if either customization or consent options are enabled.
File
- ./
shib_auth.module, line 502 - Drupal Shibboleth authentication module.
Code
function shib_auth_custom_mail($uname, $custom_username = '', $custom_mail = '') {
if (!valid_email_address($custom_mail)) {
shib_auth_error('Please enter a valid email address');
}
elseif (shib_auth_config('define_username') == 0) {
// And email isn't used by another registered drupal user, save user.
shib_auth_save_authmap($uname, $uname, $custom_mail);
}
elseif (shib_auth_config('define_username') == 1 && $custom_username) {
shib_auth_custom_username($uname, $custom_username, $custom_mail);
}
}