You are here

function password_policy_constraint_lowercase_validate in Password Policy 7

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

Password validation.

1 call to password_policy_constraint_lowercase_validate()
PasswordPolicyTestCase::testLowercaseConstraint in tests/password_policy.test
Test lowercase constraint.

File

constraints/constraint_lowercase.inc, line 29
Password policy constraint callbacks.

Code

function password_policy_constraint_lowercase_validate($password, $constraint, $account) {
  $matches = array();
  $count = preg_match_all('/[a-z]/', $password, $matches);
  return $count >= $constraint;
}