You are here

function _password_policy_go_to_password_change_page in Password Policy 7

Same name and namespace in other branches
  1. 6 password_policy.module \_password_policy_go_to_password_change_page()

Redirects user to password change page.

2 calls to _password_policy_go_to_password_change_page()
password_policy_init in ./password_policy.module
Implements hook_init().
password_policy_user_login in ./password_policy.module
Implements hook_user_login().

File

./password_policy.module, line 984
Allows enforcing restrictions on user passwords by defining policies.

Code

function _password_policy_go_to_password_change_page() {
  $password_change_path = _password_policy_get_preferred_password_change_path();

  // Set query to redirect user back to their original destination after
  // leaving password change page.
  $options = array(
    'query' => drupal_get_destination(),
  );
  unset($_GET['destination']);

  // Add password reset token, if it is available, to query so user is not
  // prompted for their current password on password change page unnecessarily.
  _password_policy_add_pass_reset_token_if_available($options);
  drupal_goto($password_change_path, $options);
}