summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Auth/Verify.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-09-06 12:41:31 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2015-09-06 12:41:31 +0200
commit23807179790108fc2575d06df59dbaebf8ce0af8 (patch)
treeed9e1b383de7f72f1892c66552640240c431f5f2 /Bugzilla/Auth/Verify.pm
parenta666b2a74f565a5ebb38f0ce0b400d04b1ea7ca4 (diff)
downloadbugzilla-23807179790108fc2575d06df59dbaebf8ce0af8.tar.gz
bugzilla-23807179790108fc2575d06df59dbaebf8ce0af8.tar.xz
Bug 1194987: Editing your email address and make it point to a non-existent email address makes Bugzilla stop working
r=gerv a=sgreen
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 };
}