You are here

public function PasswordPolicy::match in Password Policy 7.2

Returns whether all active conditions match.

Parameters

object $account: User object.

Return value

bool TRUE if all conditions match, FALSE otherwise.

File

includes/PasswordPolicy.inc, line 154
Contains PasswordPolicy.

Class

PasswordPolicy
Defines a class used for managing Password Policies.

Code

public function match($account) {
  foreach ($this
    ->getItems('condition') as $condition) {

    // Any condition with non-default configuration is "active".
    if ($condition->info['config'] != $condition->config) {
      if (!$condition
        ->match($account)) {
        return FALSE;
      }
    }
  }
  return TRUE;
}