summaryrefslogtreecommitdiffstats
path: root/Bugzilla/User.pm
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-06-05 07:18:50 +0200
committerByron Jones <glob@mozilla.com>2014-06-05 07:18:50 +0200
commitb56bcda54cdee40c994751f4a72a152a3dd6df94 (patch)
tree270c136abe09dce8814c721615fed9ca54b9b8e9 /Bugzilla/User.pm
parentb5039f7eed354227ac72dcba3a7f93fd645e1b5d (diff)
downloadbugzilla-b56bcda54cdee40c994751f4a72a152a3dd6df94.tar.gz
bugzilla-b56bcda54cdee40c994751f4a72a152a3dd6df94.tar.xz
Bug 1018811: updated account name not reflected in "Reported" field of bugs
Diffstat (limited to 'Bugzilla/User.pm')
-rw-r--r--Bugzilla/User.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index c1ab65dc3..f707a8e80 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -179,20 +179,25 @@ sub super_user {
sub update {
my $self = shift;
+ my $options = shift;
+
my $changes = $self->SUPER::update(@_);
my $dbh = Bugzilla->dbh;
if (exists $changes->{login_name}) {
- # If we changed the login, silently delete any tokens.
- $dbh->do('DELETE FROM tokens WHERE userid = ?', undef, $self->id);
+ # Delete all the tokens related to the userid
+ $dbh->do('DELETE FROM tokens WHERE userid = ?', undef, $self->id)
+ unless $options->{keep_tokens};
# And rederive regex groups
$self->derive_regexp_groups();
}
# Logout the user if necessary.
- Bugzilla->logout_user($self)
- if (exists $changes->{login_name} || exists $changes->{disabledtext}
- || exists $changes->{cryptpassword});
+ Bugzilla->logout_user($self)
+ if (!$options->{keep_session}
+ && (exists $changes->{login_name}
+ || exists $changes->{disabledtext}
+ || exists $changes->{cryptpassword}));
# XXX Can update profiles_activity here as soon as it understands
# field names like login_name.