summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Auth/Verify.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Auth/Verify.pm')
-rw-r--r--Bugzilla/Auth/Verify.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/Bugzilla/Auth/Verify.pm b/Bugzilla/Auth/Verify.pm
index e44fb06ae..9dc83273b 100644
--- a/Bugzilla/Auth/Verify.pm
+++ b/Bugzilla/Auth/Verify.pm
@@ -106,21 +106,24 @@ sub create_or_update_user {
my $user = new Bugzilla::User($user_id);
- # Now that we have a valid User, we need to see if any data has to be
- # updated.
+ # Now that we have a valid User, we need to see if any data has to be updated.
+ my $changed = 0;
+
if ($username && lc($user->login) ne lc($username)) {
validate_email_syntax($username)
|| return { failure => AUTH_ERROR, error => 'auth_invalid_email',
details => {addr => $username} };
$user->set_login($username);
+ $changed = 1;
}
if ($real_name && $user->name ne $real_name) {
# $real_name is more than likely tainted, but we only use it
# in a placeholder and we never use it after this.
trick_taint($real_name);
$user->set_name($real_name);
+ $changed = 1;
}
- $user->update();
+ $user->update() if $changed;
return { user => $user };
}