From: Andrew Dolgov Date: Sat, 19 Nov 2005 11:31:35 +0000 (+0100) Subject: redirect back support for login.php X-Git-Tag: schema_feature_freeze_for_1.1~189 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=f6d0ab1498706b7e3a1aa55b87f5b4cb8707b267;p=tt-rss.git redirect back support for login.php --- diff --git a/login.php b/login.php index 1aa606d5..92646c16 100644 --- a/login.php +++ b/login.php @@ -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"]; + } + ?> diff --git a/prefs.php b/prefs.php index 4c19f687..0673fd36 100644 --- a/prefs.php +++ b/prefs.php @@ -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 4e66d2f9..0f4a72dc 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 {