]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 287741: changing password from 'password' to 'password' should not invalidate...
authorlpsolit%gmail.com <>
Wed, 21 Dec 2005 06:25:57 +0000 (06:25 +0000)
committerlpsolit%gmail.com <>
Wed, 21 Dec 2005 06:25:57 +0000 (06:25 +0000)
userprefs.cgi

index df2255ce42c31431798dfc093c97c86816f10efd..3dc68121ef074e9e5490eea8b1a23095ec2ee1a6 100755 (executable)
@@ -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);
+            }
         }
     }