]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 897264 - letters_numbers_specialchars password restriction is incorrect
authorSimon Green <sgreen@redhat.com>
Wed, 7 Aug 2013 05:16:46 +0000 (15:16 +1000)
committerSimon Green <sgreen@redhat.com>
Wed, 7 Aug 2013 05:16:46 +0000 (15:16 +1000)
r=LpSolit, a=sgreen

Bugzilla/User.pm
template/en/default/global/user-error.html.tmpl

index 943ec72476ef3748e292d4d0970d2ca11db65186..c6cd23840d9211b90777b6e21a3092fe32361d31 100644 (file)
@@ -2116,7 +2116,7 @@ sub validate_password {
     my $complexity_level = Bugzilla->params->{password_complexity};
     if ($complexity_level eq 'letters_numbers_specialchars') {
         ThrowUserError('password_not_complex')
-          if ($password !~ /\w/ || $password !~ /\d/ || $password !~ /[[:punct:]]/);
+          if ($password !~ /[[:alpha:]]/ || $password !~ /\d/ || $password !~ /[[:punct:]]/);
     } elsif ($complexity_level eq 'letters_numbers') {
         ThrowUserError('password_not_complex')
           if ($password !~ /[[:lower:]]/ || $password !~ /[[:upper:]]/ || $password !~ /\d/);
index 65fb4f18aa4b91083b970a207a05f91a07ca4321..038704c3416ac3db9520f9534e1da899e4491258 100644 (file)
     [%+ constants.USER_PASSWORD_MIN_LENGTH FILTER html %] characters long.
 
   [% ELSIF error == "password_not_complex" %]
-     [% title = "Password Fails Requirements" %]
-     [% passregex = Param('password_complexity') %]
-     The password must contain at least one:
-     <ul>
-       [% IF passregex.search('letters') %]
-         <li>UPPERCASE letter</li>
-         <li>lowercase letter</li>
-       [% END %]
-       [% IF passregex.search('numbers') %]
-         <li>digit</li>
-       [% END %]
-       [% IF passregex.search('specialchars') %]
-         <li>special character</li>
-       [% END %]
-     </ul>
+    [% title = "Password Fails Requirements" %]
+    [% passregex = Param('password_complexity') %]
+    The password must contain at least one:
+    <ul>
+      [% IF passregex == 'letters_numbers_specialchars' %]
+        <li>letter</li>
+        <li>special character</li>
+      [% ELSIF passregex.search('letters') %]
+        <li>UPPERCASE letter</li>
+        <li>lowercase letter</li>
+      [% END %]
+      [% IF passregex.search('numbers') %]
+        <li>digit</li>
+      [% END %]
+    </ul>
 
   [% ELSIF error == "product_access_denied" %]
     [% title = "Product Access Denied" %]