From b4ab2ac2ce7b8e8b3e9d23076cdeff33522e76b4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 19 Oct 2008 20:55:07 +0000 Subject: - Patch #199870 by alpritt et al: beter password strength checker. Really cool. --- modules/user/user.module | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'modules/user/user.module') diff --git a/modules/user/user.module b/modules/user/user.module index 8b666cf1b..a8c9de8be 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1451,6 +1451,7 @@ function user_edit_form(&$form_state, $uid, $edit, $register = FALSE) { '#maxlength' => USERNAME_MAX_LENGTH, '#description' => t('Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores.'), '#required' => TRUE, + '#attributes' => array('class' => 'username'), ); } $form['account']['mail'] = array('#type' => 'textfield', @@ -2164,17 +2165,15 @@ function _user_password_dynamic_validation() { drupal_add_js(array( 'password' => array( 'strengthTitle' => t('Password strength:'), - 'lowStrength' => t('Low'), - 'mediumStrength' => t('Medium'), - 'highStrength' => t('High'), - 'tooShort' => t('It is recommended to choose a password that contains at least six characters. It should include numbers, punctuation, and both upper and lowercase letters.'), - 'needsMoreVariation' => t('The password does not include enough variation to be secure. Try:'), - 'addLetters' => t('Adding both upper and lowercase letters.'), - 'addNumbers' => t('Adding numbers.'), - 'addPunctuation' => t('Adding punctuation.'), - 'sameAsUsername' => t('It is recommended to choose a password different from the username.'), - 'confirmSuccess' => t('Yes'), - 'confirmFailure' => t('No'), + 'hasWeaknesses' => t('To make your password stronger:'), + 'tooShort' => t('Make it at least 6 characters'), + 'addLowerCase' => t('Add lowercase letters'), + 'addUpperCase' => t('Add uppercase letters'), + 'addNumbers' => t('Add numbers'), + 'addPunctuation' => t('Add punctuation'), + 'sameAsUsername' => t('Make it different from your username'), + 'confirmSuccess' => t('yes'), + 'confirmFailure' => t('no'), 'confirmTitle' => t('Passwords match:'), 'username' => (isset($user->name) ? $user->name : ''))), 'setting'); -- cgit v1.2.3