You are here

function prlp_drupal_goto_alter in Password Reset Landing Page (PRLP) 7

Implements hook_drupal_goto_alter().

File

./prlp.module, line 28
Password Reset Landing Page module.

Code

function prlp_drupal_goto_alter(&$path, &$options, &$http_response_code) {
  if (isset($_SESSION['pass_reset_hash'])) {

    // This is likely Drupal 7.79+ redirecting the password reset confirm form
    // back to itself, after which it immediately unsets the session value.
    $parts = explode('/', $path);
    if (isset($parts[4]) && $parts[4] === 'confirm' && $parts[0] === 'user' && $parts[1] === 'reset') {
      $_SESSION['prlp_reset_hash'] = $_SESSION['pass_reset_hash'];
    }
  }
}