Fix for bug 45918: the old password field on the userprefs page is now used to…

Fix for bug 45918: the old password field on the userprefs page is now used to log you back in if you try to change your password with cookies turned off, which avoids the confusing login screen after entering your new password in which you used to have to enter your old password one more time in order to let it set your new password (yes, it used to be as confusing as that just sounded :) r= tara@tequilarista.org
parent aa7b4750
...@@ -130,9 +130,10 @@ sub ShowAccount { ...@@ -130,9 +130,10 @@ sub ShowAccount {
my ($realname) = (FetchSQLData()); my ($realname) = (FetchSQLData());
$realname = value_quote($realname); $realname = value_quote($realname);
EmitEntry("Old password", EmitEntry("Old password",
qq{<input type=password name="oldpwd">}); qq|<input type=hidden name="Bugzilla_login" value="$::COOKIE{Bugzilla_login}">| .
qq|<input type=password name="Bugzilla_password">|);
EmitEntry("New password", EmitEntry("New password",
qq{<input type=password name="pwd1">}); qq{<input type=password name="pwd1">});
EmitEntry("Re-enter new password", EmitEntry("Re-enter new password",
...@@ -142,9 +143,9 @@ sub ShowAccount { ...@@ -142,9 +143,9 @@ sub ShowAccount {
} }
sub SaveAccount { sub SaveAccount {
if ($::FORM{'oldpwd'} ne "" if ($::FORM{'Bugzilla_password'} ne ""
|| $::FORM{'pwd1'} ne "" || $::FORM{'pwd2'} ne "") { || $::FORM{'pwd1'} ne "" || $::FORM{'pwd2'} ne "") {
my $old = SqlQuote($::FORM{'oldpwd'}); my $old = SqlQuote($::FORM{'Bugzilla_password'});
my $pwd1 = SqlQuote($::FORM{'pwd1'}); my $pwd1 = SqlQuote($::FORM{'pwd1'});
my $pwd2 = SqlQuote($::FORM{'pwd2'}); my $pwd2 = SqlQuote($::FORM{'pwd2'});
SendSQL("SELECT cryptpassword = ENCRYPT($old, LEFT(cryptpassword, 2)) " . SendSQL("SELECT cryptpassword = ENCRYPT($old, LEFT(cryptpassword, 2)) " .
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment