You are here

function password_policy_constraint_letter_js in Password Policy 7

Same name and namespace in other branches
  1. 6 constraints/constraint_letter.inc \password_policy_constraint_letter_js()

Javascript portion.

File

constraints/constraint_letter.inc, line 38
Password policy constraint callbacks.

Code

function password_policy_constraint_letter_js($constraint, $account) {
  return <<<JS

    var count = (value.match(/[a-z]/gi) || []).length;
    if (count < {<span class="php-variable">$constraint</span>}) {
      strength = 'low';
      msg.push(translate.constraint_letter);
    }
JS;
}