redirect back support for login.php
This commit is contained in:
parent
ac6080ece7
commit
f6d0ab1498
12
login.php
12
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"];
|
||||
}
|
||||
|
||||
?>
|
||||
<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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue