]> git.wh0rd.org Git - tt-rss.git/commitdiff
mobile version uses separate sid
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 23 May 2006 05:07:38 +0000 (06:07 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 23 May 2006 05:07:38 +0000 (06:07 +0100)
functions.php
login.php
mobile/functions.php
mobile/login.php
mobile/logout.php
mobile/tt-rss.php
sessions.php

index 0c1a959a7bd4fe924d8aa272d196221cee0528e2..c97be42c88c43cee3c5ef0390993533e2b229f49 100644 (file)
 
        function basic_nosid_redirect_check() {
                if (!SINGLE_USER_MODE) {
-                       if (!$_COOKIE["ttrss_sid"]) {
+                       if (!$_COOKIE[get_session_cookie_name()]) {
                                $redirect_uri = get_login_redirect();
                                $return_to = preg_replace('/.*?\//', '', $_SERVER["REQUEST_URI"]);
                                header("Location: $redirect_uri?rt=$return_to");
                }
 
        }
+
+       function get_session_cookie_name() {
+               return ((!defined('TTRSS_SESSION_NAME')) ? "ttrss_sid" : TTRSS_SESSION_NAME);
+       }
 ?>
index 06b95353ff3f4a9a62942a8ba4a6d6d2737867dc..a7b6ca42a6960ee0c900e85225f181a481af10e8 100644 (file)
--- a/login.php
+++ b/login.php
@@ -20,7 +20,7 @@
        $password = $_POST["password"];
        $return_to = $_POST["rt"];
 
-       if ($_COOKIE["ttrss_sid"]) {
+       if ($_COOKIE[get_session_cookie_name()]) {
                require_once "sessions.php";
                if ($_SESSION["uid"]) {
                        initialize_user_prefs($link, $_SESSION["uid"]); 
index 6169a352f48714d4f3606faa3e2b0d2e347dd649..c3d7cdb8c508b5578777b4da3c60993f68a8c65e 100644 (file)
@@ -1,5 +1,6 @@
 <?
        define('MOBILE_FEEDLIST_ENABLE_ICONS', false);
+       define('TTRSS_SESSION_NAME', 'ttrss_m_sid');
 
        function render_feeds_list($link) {
 
index 051a9eb5d2f82e6f34d42792706311d71254f013..418a04bd89bb66b71fee8681dd1fb8b02903cc2f 100644 (file)
@@ -1,5 +1,5 @@
 <?
-//     require_once "sessions.php";
+       require_once "functions.php";
 
        require_once "../version.php"; 
        require_once "../config.php";
@@ -19,7 +19,7 @@
        $password = $_POST["password"];
        $return_to = $_POST["rt"];
 
-       if ($_COOKIE["ttrss_sid"]) {
+       if ($_COOKIE[get_session_cookie_name()]) {
                require_once "../sessions.php";
                if ($_SESSION["uid"]) {
                        initialize_user_prefs($link, $_SESSION["uid"]); 
index 74e7a228d60c4b7b466342de00cea41f7992f44d..f23fd9bb369cf0b7863dc42f72e0c087f5df4d23 100644 (file)
@@ -1,8 +1,9 @@
 <?
-       require_once "../sessions.php";
+       require_once "functions.php";
 
        require_once "../config.php";
        require_once "../functions.php";
+       require_once "../sessions.php";
 
        logout_user();
 
index bd799dc6503fd43a2f38d55dfc74cac59cf03765..f13a83105ac1b9c6cd5ddfff365d0a5dc65b8bf0 100644 (file)
@@ -1,6 +1,7 @@
 <?
-       require_once "../functions.php"; 
+       require_once "../config.php";
        require_once "functions.php";
+       require_once "../functions.php"; 
 
        basic_nosid_redirect_check();
 
index 4fe1a5845821ba0fceaa406d1356c55f823841a8..c64455b6191263c9cf28d04a56d10f8d9ff1e184 100644 (file)
@@ -5,9 +5,10 @@
        require_once "db.php";
 
        $session_expire = SESSION_EXPIRE_TIME; //seconds
+       $session_name = (!defined('TTRSS_SESSION_NAME')) ? "ttrss_sid" : TTRSS_SESSION_NAME;
 
        ini_set("session.gc_probability", 50);
-       ini_set("session.name", "ttrss_sid");
+       ini_set("session.name", $session_name);
        ini_set("session.use_only_cookies", true);
        ini_set("session.gc_maxlifetime", SESSION_EXPIRE_TIME);