# HG changeset patch # User Dan # Date 1207701005 14400 # Node ID d264784355e5c1940b76944536ed3ecc2c846cdd # Parent 4c16e87cfeaef69805a1c35cb58f2eaa927f25f9 Implemented the password-reset redirect _properly_ instead of the hackish direct header() call in sessions.php diff -r 4c16e87cfeae -r d264784355e5 includes/sessions.php --- a/includes/sessions.php Tue Apr 08 20:29:18 2008 -0400 +++ b/includes/sessions.php Tue Apr 08 20:30:05 2008 -0400 @@ -956,9 +956,11 @@ eval($cmd); } - header('Location: ' . makeUrlComplete('Special', 'PasswordReset/stage2/' . $row['user_id'] . '/' . $row['temp_password']) ); - - exit; + return array( + 'success' => false, + 'error' => 'valid_reset', + 'redirect_url' => makeUrlComplete('Special', 'PasswordReset/stage2/' . $row['user_id'] . '/' . $row['temp_password']) + ); } } diff -r 4c16e87cfeae -r d264784355e5 plugins/SpecialUserFuncs.php --- a/plugins/SpecialUserFuncs.php Tue Apr 08 20:29:18 2008 -0400 +++ b/plugins/SpecialUserFuncs.php Tue Apr 08 20:30:05 2008 -0400 @@ -542,6 +542,14 @@ } else { + if ( $result['error'] === 'valid_reset' ) + { + header('HTTP/1.1 302 Temporary Redirect'); + header('Location: ' . $result['redirect_url']); + + $db->close(); + exit(); + } $GLOBALS['__login_status'] = $result; } }