You are here

function password_strength_js_settings in Password Strength 6

Same name and namespace in other branches
  1. 5 password_strength.module \password_strength_js_settings()

Provide translatable strings and variables to javascript settings

1 call to password_strength_js_settings()
password_strength_expand_password_confirm in ./password_strength.module
Add the necessary classes, and validation to password_confirm elements

File

./password_strength.module, line 139
Server side checks for newly submittted passwords

Code

function password_strength_js_settings() {
  global $user;
  return array(
    'passwordStrength' => array(
      'strengthTitle' => t('Password strength:'),
      'lowStrength' => t('Low'),
      'mediumStrength' => t('Medium'),
      'highStrength' => t('High'),
      'requiredStrength' => variable_get('password_strength_min_level', 4),
      'tooShort' => t('It is recommended to choose a password that contains at least %characters. It should include numbers, punctuation, and both upper and lowercase letters.', array(
        '%characters' => format_plural(variable_get('password_strength_min_length', 6), "1 character", "@count characters"),
      )),
      'needsMoreVariation' => t('The password does not include enough variation to be secure. Try:'),
      'recommendVariation' => t('Your password is strong enough to meet the site requirements, but could be stronger.  If you like, 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'),
      'confirmTitle' => t('Passwords match:'),
      'minLength' => variable_get('password_strength_min_length', 6),
      'username' => isset($user->name) ? $user->name : '',
    ),
  );
}