Issue #186 has been updated by Felix Bartels.

Status changed from Assigned to Closed
% Done changed from 90 to 100

Checked german translations.
----------------------------------------
Feature #186: Check special characters in password
http://tools.lsc-project.org/issues/show/186

Author: Clément Oudot
Status: Closed
Priority: Normal
Assigned to: Felix Bartels
Category: Self Service Password
Target version: self-service-password-0.4


Samuel Hameau has submitted me this pacth:

<pre>
diff -r -u ltb-project-self-service-password-0.3/index.php 
ltb-project-self-service-password-0.3-sam/index.php
--- ltb-project-self-service-password-0.3/index.php     2010-02-14 
17:53:57.000000000 +0100
+++ ltb-project-self-service-password-0.3-sam/index.php 2010-02-23 
13:24:51.000000000 +0100
@@ -78,6 +78,8 @@
     $upper = count( $upper_res[0] );
     preg_match_all("/[0-9]/", $newpassword, $digit_res);
     $digit = count( $digit_res[0] );
+    preg_match_all("/^[a-zA-Z0-9]/", $newpassword, $special_res);
+    $special = count( $special_res[0] );
 
     # Minimal lenght
     if ( $pwd_min_length and $length < $pwd_min_length ) { $result="tooshort"; 
}
@@ -94,6 +96,9 @@
     # Minimal digit chars
     if ( $pwd_min_digit and $digit < $pwd_min_digit ) { $result="mindigit"; }
 
+    # Minimal special chars
+    if ( $pwd_min_special and $special < $pwd_min_special ) { 
$result="minspecial"; }
+
 }
 
 #==============================================================================
@@ -240,6 +245,7 @@
     if ( $pwd_min_lower  ) { echo "<li>".$messages[$lang]["policyminlower"] ." 
$pwd_min_lower </li>\n"; }
     if ( $pwd_min_upper  ) { echo "<li>".$messages[$lang]["policyminupper"] ." 
$pwd_min_upper </li>\n"; }
     if ( $pwd_min_digit  ) { echo "<li>".$messages[$lang]["policymindigit"] ." 
$pwd_min_digit </li>\n"; }
+    if ( $pwd_min_special) { echo "<li>".$messages[$lang]["policyminspecial"] 
." $pwd_min_special </li>\n"; }
     echo "</ul>\n";
     echo "</div>\n";
 }
diff -r -u ltb-project-self-service-password-0.3/lang.inc.php 
ltb-project-self-service-password-0.3-sam/lang.inc.php
--- ltb-project-self-service-password-0.3/lang.inc.php  2010-02-14 
17:53:57.000000000 +0100
+++ ltb-project-self-service-password-0.3-sam/lang.inc.php      2010-02-23 
13:29:24.000000000 +0100
@@ -44,12 +44,14 @@
 $messages['en']['minlower'] = "Your password has not enough lower characters";
 $messages['en']['minupper'] = "Your password has not enough upper characters";
 $messages['en']['mindigit'] = "Your password has not enough digits";
+$messages['en']['minspecial'] = "Your password has not enough special 
characters";
 $messages['en']['policy'] = "Your password should respect the following 
constraints:";
 $messages['en']['policyminlength'] = "Minimal length:";
 $messages['en']['policymaxlength'] = "Maximal length:";
 $messages['en']['policyminlower'] = "Minimal lower characters:";
 $messages['en']['policyminupper'] = "Minimal upper characters:";
 $messages['en']['policymindigit'] = "Minimal digits:";
+$messages['en']['policyminspecial'] = "Minimal special characters:";
 
 #==============================================================================
 # French
@@ -76,12 +78,14 @@
 $messages['fr']['minlower'] = "Votre mot de passe n'a pas assez de minuscules";
 $messages['fr']['minupper'] = "Votre mot de passe n'a pas assez de majuscules";
 $messages['fr']['mindigit'] = "Votre mot de passe n'a pas assez de chiffres";
+$messages['fr']['minspecial'] = "Votre mot de passe n'a pas assez de 
caractères spéciaux";
 $messages['fr']['policy'] = "Votre mot de passe doit respecter les contraintes 
suivantes&nbsp;:";
 $messages['fr']['policyminlength'] = "Nombre minimum de caractères&nbsp;:";
 $messages['fr']['policymaxlength'] = "Nombre maximum de caractères&nbsp;:";
 $messages['fr']['policyminlower'] = "Nombre minimum de minuscules&nbsp;:";
 $messages['fr']['policyminupper'] = "Nombre minimum de majuscules&nbsp;:";
 $messages['fr']['policymindigit'] = "Nombre minimum de chiffres&nbsp;:";
+$messages['fr']['policyminspecial'] = "Nombre minimum de caractères 
spéciaux&nbsp;";
 
 #==============================================================================
 # German
</pre>

I think we can also have a configuration parameter to list all matching special 
chars.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://tools.lsc-project.org/my/account
_______________________________________________
ltb-dev mailing list
[email protected]
http://lists.ltb-project.org/listinfo/ltb-dev

Reply via email to