diff -r 0ae1b281a884 -r af0f6ec48de3 plugins/SpecialUserPrefs.php --- a/plugins/SpecialUserPrefs.php Mon Sep 17 11:52:58 2007 -0400 +++ b/plugins/SpecialUserPrefs.php Tue Sep 18 00:30:43 2007 -0400 @@ -214,7 +214,14 @@ { // Perform checks if ( strlen($newpass) < 6 ) - $errors .= '
Password must be at least 6 characters. You hacked my script, darn you!
'; + $errors .= '
Password must be at least 6 characters. You hacked my script, darn you!
'; + if ( getConfig('pw_strength_enable') == '1' ) + { + $score_inp = password_score($newpass); + $score_min = intval( getConfig('pw_strength_minimum') ); + if ( $score_inp < $score_min ) + $errors .= '
Your password did not meet the complexity score requirement for this site. Your password scored '. $score_inp .', while a score of at least '. $score_min .' is needed.
'; + } // Encrypt new password if ( empty($errors) ) { @@ -304,6 +311,12 @@ break; case 'EmailPassword': + $errors = trim($errors); + if ( !empty($errors) ) + { + echo $errors; + } + echo '
'; // Password change form @@ -312,20 +325,22 @@ echo '
Change password Type a new password:
- + ' . ( getConfig('pw_strength_enable') == '1' ? ' Loading...' : '' ) . '

Type the password again to confirm:
- + + ' . ( getConfig('pw_strength_enable') == '1' ? '

+ Your password needs to score at least '.getConfig('pw_strength_minimum').' in order to be accepted.' : '' ) . '

Change e-mail address New e-mail address:
- +

Confirm e-mail address:
- +
@@ -338,6 +353,9 @@ // ENCRYPTION CODE ?>