From a2a422ca3f0edf77f6aafd064b4e00a5883bb1b8 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 21 Dec 2005 06:25:57 +0000 Subject: Bug 287741: changing password from 'password' to 'password' should not invalidate login cookies - Patch by Marc Schumann r=LpSolit a=justdave --- userprefs.cgi | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'userprefs.cgi') diff --git a/userprefs.cgi b/userprefs.cgi index df2255ce4..3dc68121e 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -97,16 +97,18 @@ sub SaveAccount { $cgi->param('new_password1') || ThrowUserError("new_password_missing"); ValidatePassword($pwd1, $pwd2); - - my $cryptedpassword = bz_crypt($pwd1); - trick_taint($cryptedpassword); # Only used in a placeholder - $dbh->do(q{UPDATE profiles - SET cryptpassword = ? - WHERE userid = ?}, - undef, ($cryptedpassword, $user->id)); - - # Invalidate all logins except for the current one - Bugzilla->logout(LOGOUT_KEEP_CURRENT); + + if ($cgi->param('Bugzilla_password') ne $pwd1) { + my $cryptedpassword = bz_crypt($pwd1); + trick_taint($cryptedpassword); # Only used in a placeholder + $dbh->do(q{UPDATE profiles + SET cryptpassword = ? + WHERE userid = ?}, + undef, ($cryptedpassword, $user->id)); + + # Invalidate all logins except for the current one + Bugzilla->logout(LOGOUT_KEEP_CURRENT); + } } } -- cgit v1.2.3-24-g4f1b