You are here

function password_strength_js_settings in Password Strength 5

Same name and namespace in other branches
  1. 6 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 136

Code

function password_strength_js_settings() {
  global $user;
  return array(
    'password' => 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 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:'),
      '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:'),
      'username' => $user->name ? $user->name : '',
      'minLength' => variable_get('password_strength_min_length', 6),
    ),
  );
}