diff options
author | Andrew Dolgov <[email protected]> | 2005-11-19 12:31:35 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-11-19 12:31:35 +0100 |
commit | f6d0ab1498706b7e3a1aa55b87f5b4cb8707b267 (patch) | |
tree | 5ab345582b7249d8fdf354ec9ec130bfcfb8e499 | |
parent | ac6080ece78a53fb27fdd67e939bf46c92e40baf (diff) |
redirect back support for login.php
-rw-r--r-- | login.php | 12 | ||||
-rw-r--r-- | prefs.php | 2 | ||||
-rw-r--r-- | tt-rss.php | 2 |
3 files changed, 13 insertions, 3 deletions
@@ -13,10 +13,20 @@ if ($login && $password) { if (authenticate_user($link, $login, $password)) { initialize_user_prefs($link, $_SESSION["uid"]); - header("Location: tt-rss.php"); + + if ($_SESSION["login_redirect"]) { + $redirect_to = $_SESSION["login_redirect"]; + } else { + $redirect_to = "tt-rss.php"; + } + header("Location: $redirect_to"); } } + if ($_GET["rt"]) { + $_SESSION["login_redirect"] = $_GET["rt"]; + } + ?> <html> <head> @@ -12,7 +12,7 @@ if (!USE_HTTP_AUTH) { if (!$_SESSION["uid"]) { - header("Location: login.php"); + header("Location: login.php?rt=prefs.php"); exit; } } else { diff --git a/tt-rss.php b/tt-rss.php index 4e66d2f9e..0f4a72dc1 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -12,7 +12,7 @@ if (!USE_HTTP_AUTH) { if (!$_SESSION["uid"]) { - header("Location: login.php"); + header("Location: login.php?rt=tt-rss.php"); exit; } } else { |