]> git.wh0rd.org Git - tt-rss.git/commitdiff
login system fixes (3)
authorAndrew Dolgov <fox@bah.spb.su>
Thu, 1 Mar 2007 12:57:31 +0000 (13:57 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Thu, 1 Mar 2007 12:57:31 +0000 (13:57 +0100)
functions.php
opml.php
prefs.php
sessions.php
tt-rss.php
update.php

index 70cc16cc9b78d19cfbeec2a98f249503a20a7c03..ada1b7162f8de7a3232039e48132a0d4ec2d68de 100644 (file)
                        }
                }
 
-               if ($_SESSION["cookie_lifetime"] && $_SESSION["uid"]) {
+/*             if ($_SESSION["cookie_lifetime"] && $_SESSION["uid"]) {
 
                        //print_r($_SESSION);
 
                        if (time() > $_SESSION["cookie_lifetime"]) {
                                return false;
                        }
-               }
+               } */
+
                return true;
        }
 
                                }
                        }
 
+                       if ($_COOKIE["ttrss_sid"]) {
+                               require_once "sessions.php";
+                       }
+
                        if (!validate_session($link)) {
                                logout_user();
                                render_login_form($link);
                                $password = $_POST["password"];
                                $remember_me = $_POST["remember_me"];
 
+                               if ($remember_me) {
+                                       session_set_cookie_params(SESSION_COOKIE_LIFETIME_REMEMBER);
+                               } else {
+                                       session_set_cookie_params(SESSION_COOKIE_LIFETIME);
+                               }
+
+                               require_once "sessions.php";
+
                                if (authenticate_user($link, $login, $password)) {
                                        $_POST["password"] = "";
 
                                        if ($remember_me) {
                                                $_SESSION["cookie_lifetime"] = time() + 
                                                        SESSION_COOKIE_LIFETIME_REMEMBER;
-                                       } else if (SESSION_COOKIE_LIFETIME > 0) {
+                                       } else if (SESSION_COOKIE_LIFETIME) {
                                                $_SESSION["cookie_lifetime"] = time() + SESSION_COOKIE_LIFETIME;
                                        }
 
                        }
 
                } else {
+                       require_once "sessions.php";
                        return authenticate_user($link, "admin", null);
                }
        }
index ff888d24661c8c44c8dc55034bb257c70a4834f5..dd73a84632bffc16ebc140b1d8b0c4503dc731d9 100644 (file)
--- a/opml.php
+++ b/opml.php
@@ -1,5 +1,5 @@
 <?php
-       require_once "sessions.php";
+//     require_once "sessions.php";
        require_once "sanity_check.php";
        require_once "functions.php";
        require_once "config.php";
index 4398a2eb375465336991d2011e3fe9604a302159..420bc086784634afea26b54e7376e98c475382e0 100644 (file)
--- a/prefs.php
+++ b/prefs.php
@@ -1,6 +1,6 @@
 <?php
        require_once "functions.php"; 
-       require_once "sessions.php";
+//     require_once "sessions.php";
        require_once "sanity_check.php";
        require_once "version.php"; 
        require_once "config.php";
index c2854e04a4d28295ea3a0ef2120c22a93914c51f..e1356262807bf3d8c7cc586956934948055b314f 100644 (file)
@@ -95,7 +95,7 @@
                session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
        }
 
-       session_set_cookie_params(SESSION_COOKIE_LIFETIME_REMEMBER);
+//     session_set_cookie_params(SESSION_COOKIE_LIFETIME_REMEMBER);
 
        session_start();
 ?>
index ef9f2437c42e32ac22b1b992bc2198ab9c96f40a..f39396eca251eeb94d09a1ed7fae7b6c0e89174e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
        require_once "functions.php"; 
-       require_once "sessions.php";
+//     require_once "sessions.php";
        require_once "sanity_check.php";
        require_once "version.php"; 
        require_once "config.php";
index 34357f2f223b370c1762573b7eac0ec097d5478a..eb5cf94f5383509ae0ecaf7d610a779a055e3635 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-       require_once "sessions.php";
+//     require_once "sessions.php";
        
        require_once "sanity_check.php";
        require_once "functions.php";