fix ?rt= handling in login.php
This commit is contained in:
parent
ab9ecc041b
commit
1f0d3e0765
14
login.php
14
login.php
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
$login = $_POST["login"];
|
$login = $_POST["login"];
|
||||||
$password = $_POST["password"];
|
$password = $_POST["password"];
|
||||||
|
$return_to = $_POST["rt"];
|
||||||
|
|
||||||
if ($_COOKIE["ttrss_sid"]) {
|
if ($_COOKIE["ttrss_sid"]) {
|
||||||
require_once "sessions.php";
|
require_once "sessions.php";
|
||||||
|
@ -41,20 +42,14 @@
|
||||||
if (authenticate_user($link, $login, $password)) {
|
if (authenticate_user($link, $login, $password)) {
|
||||||
initialize_user_prefs($link, $_SESSION["uid"]);
|
initialize_user_prefs($link, $_SESSION["uid"]);
|
||||||
|
|
||||||
if ($_SESSION["login_redirect"]) {
|
if (!$return_to) {
|
||||||
$redirect_to = $_SESSION["login_redirect"];
|
$return_to = "tt-rss.php";
|
||||||
} else {
|
|
||||||
$redirect_to = "tt-rss.php";
|
|
||||||
}
|
}
|
||||||
header("Location: $redirect_base/$redirect_to");
|
header("Location: $redirect_base/$return_to");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET["rt"]) {
|
|
||||||
$_SESSION["login_redirect"] = $_GET["rt"];
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
@ -90,6 +85,7 @@
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td colspan="2" align="center">
|
<tr><td colspan="2" align="center">
|
||||||
<input type="submit" class="button" value="Login">
|
<input type="submit" class="button" value="Login">
|
||||||
|
<input type="hidden" name="rt" value="<?= $_GET['rt'] ?>">
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue