function password_policy_constraint_lowercase_validate in Password Policy 6
Same name and namespace in other branches
- 7 constraints/constraint_lowercase.inc \password_policy_constraint_lowercase_validate()
Password validation.
1 call to password_policy_constraint_lowercase_validate()
File
- constraints/
constraint_lowercase.inc, line 28 - Password policy constraint callbacks.
Code
function password_policy_constraint_lowercase_validate($password, $constraint, $uid) {
$length = drupal_strlen($password);
$num = 0;
for ($i = 0; $i < $length; $i++) {
if (ctype_lower($password[$i])) {
$num++;
}
}
return $num >= $constraint;
}