You are here

function _password_policy_add_pass_reset_token_if_available in Password Policy 7

Adds password reset token, if available, to query.

This is for the case that the user is forced to change their password on reset, but attempts to browse away from the password change path before changing their password. Adding the reset token makes it so the user will not be prompted for their current password.

Parameters

array $options: Options to be passed to drupal_goto().

1 call to _password_policy_add_pass_reset_token_if_available()
_password_policy_go_to_password_change_page in ./password_policy.module
Redirects user to password change page.

File

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

Code

function _password_policy_add_pass_reset_token_if_available(array &$options) {
  global $user;
  if (isset($_SESSION['pass_reset_' . $user->uid])) {
    $pass_reset_token = $_SESSION['pass_reset_' . $user->uid];
    $options['query']['pass-reset-token'] = $pass_reset_token;
  }
}