]> git.wh0rd.org Git - tt-rss.git/commitdiff
prevent setting session cookie when user not logged in and tt-rss.php/prefs.php is...
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 16 Mar 2006 10:57:22 +0000 (11:57 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 16 Mar 2006 10:57:22 +0000 (11:57 +0100)
functions.php
prefs.php
tt-rss.php

index a7a17f9b5546461b76bb9c2ae0277f7834cdbba9..18546ca18bebf7ab2442538cad9b483db372b881 100644 (file)
                return true;
        }
 
+       function basic_nosid_redirect_check() {
+               if (!SINGLE_USER_MODE) {
+                       if (!$_COOKIE["ttrss_sid"]) {
+                               $redirect_uri = get_login_redirect();
+                               $return_to = preg_replace('/.*?\//', '', $_SERVER["REQUEST_URI"]);
+                               header("Location: $redirect_uri?rt=$return_to");
+                               exit;
+                       }
+               }
+       }
+
        function login_sequence($link) {
                if (!SINGLE_USER_MODE) {
 
index 7dd81e2bf6297139d8fb834cf598a9ad1beabbad..639f5d86ea65085013355f66304bbedbce65968b 100644 (file)
--- a/prefs.php
+++ b/prefs.php
@@ -1,11 +1,14 @@
 <?
+       require_once "functions.php"; 
+
+       basic_nosid_redirect_check();
+
        require_once "sessions.php";
 
        require_once "sanity_check.php";
        require_once "version.php"; 
        require_once "config.php";
        require_once "db-prefs.php";
-       require_once "functions.php"; 
 
        $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); 
 
index 9d125614dd95c053a84fe757575a8e611c83cc1f..e22d8408ab3d289bf371e86f68bdf99ec8766444 100644 (file)
@@ -1,11 +1,14 @@
 <?
+       require_once "functions.php"; 
+
+       basic_nosid_redirect_check();
+
        require_once "sessions.php";
 
        require_once "sanity_check.php";
        require_once "version.php"; 
        require_once "config.php";
        require_once "db-prefs.php";
-       require_once "functions.php"; 
 
        $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);