summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Auth/Verify.pm
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2014-03-04 08:50:54 +0100
committerByron Jones <bjones@mozilla.com>2014-03-04 08:50:54 +0100
commit9193214274889f2b7636146e72d8200e9bfaeb7b (patch)
treee570cc86aa8df53dd0e7e9d902d88450c5dc25c7 /Bugzilla/Auth/Verify.pm
parent75eaf0d6c8ecf764d73cb870e504e84826d44751 (diff)
downloadbugzilla-9193214274889f2b7636146e72d8200e9bfaeb7b.tar.gz
bugzilla-9193214274889f2b7636146e72d8200e9bfaeb7b.tar.xz
Bug 966180: backport bug 956233 to bmo (enable USE_MEMCACHE on most objects)
Diffstat (limited to 'Bugzilla/Auth/Verify.pm')
-rw-r--r--Bugzilla/Auth/Verify.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/Bugzilla/Auth/Verify.pm b/Bugzilla/Auth/Verify.pm
index a8cd0af2c..3578631f1 100644
--- a/Bugzilla/Auth/Verify.pm
+++ b/Bugzilla/Auth/Verify.pm
@@ -97,6 +97,7 @@ sub create_or_update_user {
if ($extern_id && $username_user_id && !$extern_user_id) {
$dbh->do('UPDATE profiles SET extern_id = ? WHERE userid = ?',
undef, $extern_id, $username_user_id);
+ Bugzilla->memcached->clear({ table => 'profiles', id => $username_user_id });
}
# Finally, at this point, one of these will give us a valid user id.
@@ -109,23 +110,26 @@ sub create_or_update_user {
'Bugzilla::Auth::Verify::create_or_update_user'})
unless $user_id;
- my $user = new Bugzilla::User($user_id);
+ my $user = new Bugzilla::User({ id => $user_id, cache => 1 });
# Now that we have a valid User, we need to see if any data has to be
# updated.
+ my $user_updated = 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);
+ $user_updated = 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);
+ $user_updated = 1;
}
- $user->update();
+ $user->update() if $user_updated;
return { user => $user };
}