redirect back support for login.php

This commit is contained in:
Andrew Dolgov 2005-11-19 12:31:35 +01:00
parent ac6080ece7
commit f6d0ab1498
3 changed files with 13 additions and 3 deletions

View File

@ -13,8 +13,18 @@
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"];
}
?>

View File

@ -12,7 +12,7 @@
if (!USE_HTTP_AUTH) {
if (!$_SESSION["uid"]) {
header("Location: login.php");
header("Location: login.php?rt=prefs.php");
exit;
}
} else {

View File

@ -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 {