]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix ?rt= handling in login.php
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 17 Mar 2006 05:11:45 +0000 (06:11 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 17 Mar 2006 05:11:45 +0000 (06:11 +0100)
login.php

index 6f9bc1c904852e852f4a648715ef5f7b161c8435..733be8c9d4f5e7b1803cc6f346c61df535362802 100644 (file)
--- a/login.php
+++ b/login.php
@@ -18,6 +18,7 @@
 
        $login = $_POST["login"];
        $password = $_POST["password"];
+       $return_to = $_POST["rt"];
 
        if ($_COOKIE["ttrss_sid"]) {
                require_once "sessions.php";
                if (authenticate_user($link, $login, $password)) {
                        initialize_user_prefs($link, $_SESSION["uid"]); 
                        
-                       if ($_SESSION["login_redirect"]) {
-                               $redirect_to = $_SESSION["login_redirect"];
-                       } else {
-                               $redirect_to = "tt-rss.php";
+                       if (!$return_to) {
+                               $return_to = "tt-rss.php";
                        }
-                       header("Location: $redirect_base/$redirect_to");
+                       header("Location: $redirect_base/$return_to");
                        exit;
                }
        }
 
-       if ($_GET["rt"]) {
-               $_SESSION["login_redirect"] = $_GET["rt"];
-       }
-
 ?>
 <html>
 <head>
@@ -90,6 +85,7 @@
        </td></tr>
        <tr><td colspan="2" align="center">
                <input type="submit" class="button" value="Login">
+               <input type="hidden" name="rt" value="<?= $_GET['rt'] ?>">
        </td></tr>
        
        </table>