diff options
-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 { |