You are here

function password_policy_password_policy_expire_url_exclude in Password Policy 7.2

Implements hook_password_policy_expire_url_exclude().

File

./password_policy.module, line 552
Enforces password policies.

Code

function password_policy_password_policy_expire_url_exclude($account) {

  // Do not redirect on AJAX requests.
  if ((arg(0) == 'system' || arg(0) == 'file') && arg(1) == 'ajax') {
    return FALSE;
  }

  // Allow users to log out!
  if (arg(0) == 'user' && arg(1) == 'logout') {
    return FALSE;
  }

  // Do not do anything if the user is doing the core e-mail validation step.
  if (arg(0) == 'user' && arg(1) == 'reset' && is_string(arg(2))) {
    return FALSE;
  }

  // Do not do anything if the user is doing the LoginToboggan validation
  // process.
  if (module_exists('logintoboggan')) {
    if (arg(0) == 'user' && arg(1) == 'validate' && is_string(arg(2))) {
      return FALSE;
    }
  }

  // Do not do anything if the user is using a urllogin link.
  if (module_exists('urllogin')) {
    if (arg(0) == 'l' && is_string(arg(1))) {
      return FALSE;
    }
  }
}