You are here

function _password_policy_enabled in Password Policy 5

Returns starting point of active policy

2 calls to _password_policy_enabled()
password_policy_cron in ./password_policy.module
Implementation of hook_cron
password_policy_user in ./password_policy.module
The implementation of hook_user(). Used to trap the validation step so we can test any currently enabled password policies.

File

./password_policy.module, line 955

Code

function _password_policy_enabled($expiration_seconds = 0) {
  $result = db_query_range("SELECT * FROM {password_policy} WHERE enabled = 1 ORDER BY enabled DESC", 0, 1);
  if ($row = db_fetch_object($result)) {
    $policy_enabled = $row->created;
  }
  if (variable_get('password_policy_begin', 0) == 1) {

    // password older than expiration time expires starting from setting the policy
    $policy_enabled -= $expiration_seconds;
  }
  return $policy_enabled;
}