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.

This commit is contained in:
jocuri%softhome.net 2004-03-03 05:19:28 +00:00
parent f692e33830
commit fa9ce070ba
2 changed files with 2 additions and 3 deletions

View File

@ -706,7 +706,7 @@ sub ValidatePassword {
ThrowUserError("password_too_short");
} elsif (length($password) > 16) {
ThrowUserError("password_too_long");
} elsif ($matchpassword && $password ne $matchpassword) {
} elsif ((defined $matchpassword) && ($password ne $matchpassword)) {
ThrowUserError("passwords_dont_match");
}
}

View File

@ -97,9 +97,8 @@ sub SaveAccount {
if ($pwd1 ne "" || $pwd2 ne "")
{
($pwd1 eq $pwd2) || ThrowUserError("passwords_dont_match");
$::FORM{'new_password1'} || ThrowUserError("new_password_missing");
ValidatePassword($pwd1);
ValidatePassword($pwd1, $pwd2);
my $cryptedpassword = SqlQuote(Crypt($pwd1));
SendSQL("UPDATE profiles