You are here

function password_policy_policy_load in Password Policy 6

Same name and namespace in other branches
  1. 7 password_policy.module \password_policy_policy_load()

Load policy array from the database.

Parameters

$pid: The policy id

Return value

A populated policy array or NULL if not found.

File

./password_policy.module, line 266
The password policy module allows you to enforce a specific level of password complexity for the user passwords on the system.

Code

function password_policy_policy_load($pid) {
  static $policies = array();
  if (is_numeric($pid)) {
    if (isset($policies[$pid])) {
      return $policies[$pid];
    }
    else {
      $policy = _password_policy_load_policy_by_pid($pid);
      if ($policy) {
        $policies[$pid] = $policy;
        return $policy;
      }
    }
  }
  return FALSE;
}