Commit cab30256 authored by Rich Trott's avatar Rich Trott
Browse files

Bug #923854: SAML can disallow login if email is absent



Change-Id: I660fe25d3d9c08bf44dab0dd9a84410083666909
Signed-off-by: default avatarRich Trott <rtrott@gmail.com>
parent 368e865f
......@@ -215,16 +215,18 @@ class AuthSaml extends Auth {
}
} elseif ($update) {
if (empty($firstname) || empty($lastname) || empty($email)) {
throw new AuthInstanceException(get_string('errormissinguserattributes', 'auth.saml'));
if (! empty($firstname)) {
set_profile_field($user->id, 'firstname', $firstname);
$user->firstname = $firstname;
}
if (! empty($lastname)) {
set_profile_field($user->id, 'lastname', $lastname);
$user->lastname = $lastname;
}
if (! empty($email)) {
set_profile_field($user->id, 'email', $email);
$user->email = $email;
}
set_profile_field($user->id, 'firstname', $firstname);
$user->firstname = $firstname;
set_profile_field($user->id, 'lastname', $lastname);
$user->lastname = $lastname;
set_profile_field($user->id, 'email', $email);
$user->email = $email;
$user->lastlastlogin = $user->lastlogin;
$user->lastlogin = time();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment