]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Patch for bug 123077; improve the ValidatePassword sub so that a password change...
authorjocuri%softhome.net <>
Wed, 3 Mar 2004 13:19:28 +0000 (13:19 +0000)
committerjocuri%softhome.net <>
Wed, 3 Mar 2004 13:19:28 +0000 (13:19 +0000)
globals.pl
userprefs.cgi

index 9c1b9a7ef40cb760636638f7a1f0c8e02665ca39..91fd0555456e9921b1147ead8faa79a4105e5afc 100644 (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");
     }
 }
index 017c7c94d1b5e7905b23604cef79e9221a2fd49e..9a1a9371726a4d32d2d87d7930ad85a5e5b13105 100755 (executable)
@@ -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