diff options
author | Byron Jones <glob@mozilla.com> | 2014-06-05 07:18:50 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2014-06-05 07:18:50 +0200 |
commit | b56bcda54cdee40c994751f4a72a152a3dd6df94 (patch) | |
tree | 270c136abe09dce8814c721615fed9ca54b9b8e9 /userprefs.cgi | |
parent | b5039f7eed354227ac72dcba3a7f93fd645e1b5d (diff) | |
download | bugzilla-b56bcda54cdee40c994751f4a72a152a3dd6df94.tar.gz bugzilla-b56bcda54cdee40c994751f4a72a152a3dd6df94.tar.xz |
Bug 1018811: updated account name not reflected in "Reported" field of bugs
Diffstat (limited to 'userprefs.cgi')
-rwxr-xr-x | userprefs.cgi | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/userprefs.cgi b/userprefs.cgi index 4ba0fd906..a4083a981 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -79,6 +79,9 @@ sub DoAccount { sub SaveAccount { my $cgi = Bugzilla->cgi; my $dbh = Bugzilla->dbh; + + $dbh->bz_start_transaction; + my $user = Bugzilla->user; my $oldpassword = $cgi->param('old_password'); @@ -101,12 +104,7 @@ sub SaveAccount { validate_password($pwd1, $pwd2); if ($oldpassword ne $pwd1) { - my $cryptedpassword = bz_crypt($pwd1); - $dbh->do(q{UPDATE profiles - SET cryptpassword = ? - WHERE userid = ?}, - undef, ($cryptedpassword, $user->id)); - + $user->set_password($pwd1); # Invalidate all logins except for the current one Bugzilla->logout(LOGOUT_KEEP_CURRENT); } @@ -137,10 +135,9 @@ sub SaveAccount { } } - my $realname = trim($cgi->param('realname')); - trick_taint($realname); # Only used in a placeholder - $dbh->do("UPDATE profiles SET realname = ? WHERE userid = ?", - undef, ($realname, $user->id)); + $user->set_name($cgi->param('realname')); + $user->update({ keep_session => 1, keep_tokens => 1 }); + $dbh->bz_commit_transaction; } |