You are here

public static function PasswordPolicy::matchedPolicies in Password Policy 7.2

Retrieves all policies that match the current account.

Parameters

object $account: User object.

Return value

PasswordPolicy[] Policies matching account.

4 calls to PasswordPolicy::matchedPolicies()
password_policy_ajax_check in ./password_policy.module
AJAX callback to check password against applicable policies.
password_policy_init in ./password_policy.module
Implements hook_init().
password_policy_password_element_alter in ./password_policy.module
Alters the password element.
password_policy_user_profile_form_validate in ./password_policy.module
Form validation handler for user_profile_form().

File

includes/PasswordPolicy.inc, line 300
Contains PasswordPolicy.

Class

PasswordPolicy
Defines a class used for managing Password Policies.

Code

public static function matchedPolicies($account) {
  $policies = array();
  foreach (PasswordPolicy::enabledPolicies() as $policy) {
    if ($policy
      ->match($account)) {
      $policies[] = $policy;
    }
  }
  return $policies;
}