Commit 261e207c authored by jocuri%softhome.net's avatar jocuri%softhome.net

Patch for bug 123077; improve the ValidatePassword sub so that a password change…

Patch for bug 123077; improve the ValidatePassword sub so that a password change is no longer accepted with a blank second field; r=kiko, a=justdave.
parent 82303e4a
...@@ -706,7 +706,7 @@ sub ValidatePassword { ...@@ -706,7 +706,7 @@ sub ValidatePassword {
ThrowUserError("password_too_short"); ThrowUserError("password_too_short");
} elsif (length($password) > 16) { } elsif (length($password) > 16) {
ThrowUserError("password_too_long"); ThrowUserError("password_too_long");
} elsif ($matchpassword && $password ne $matchpassword) { } elsif ((defined $matchpassword) && ($password ne $matchpassword)) {
ThrowUserError("passwords_dont_match"); ThrowUserError("passwords_dont_match");
} }
} }
......
...@@ -97,9 +97,8 @@ sub SaveAccount { ...@@ -97,9 +97,8 @@ sub SaveAccount {
if ($pwd1 ne "" || $pwd2 ne "") if ($pwd1 ne "" || $pwd2 ne "")
{ {
($pwd1 eq $pwd2) || ThrowUserError("passwords_dont_match");
$::FORM{'new_password1'} || ThrowUserError("new_password_missing"); $::FORM{'new_password1'} || ThrowUserError("new_password_missing");
ValidatePassword($pwd1); ValidatePassword($pwd1, $pwd2);
my $cryptedpassword = SqlQuote(Crypt($pwd1)); my $cryptedpassword = SqlQuote(Crypt($pwd1));
SendSQL("UPDATE profiles SendSQL("UPDATE profiles
......
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