function _password_policy_validate_constraints in Password Policy 7
Validates constraints.
Gets error message for each constraint that fails validation and displays them all in list format as a form error.
Parameters
array $form_state: Form state.
object $account: Custom user object for validating constraints.
1 call to _password_policy_validate_constraints()
- password_policy_password_validate in ./
password_policy.module - Password save validate handler.
File
- ./
password_policy.module, line 861 - Allows enforcing restrictions on user passwords by defining policies.
Code
function _password_policy_validate_constraints(array $form_state, $account) {
$pass = $form_state['values']['pass'];
$error = _password_policy_constraint_validate($pass, $account);
if ($error) {
form_set_error('pass', t('Your password has not met the following requirement(s):') . '<ul><li>' . implode('</li><li>', $error) . '</li></ul>');
}
}