]> git.wh0rd.org Git - tt-rss.git/commitdiff
sessions: initialize connection on include, not in ttrss_open
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 2 Apr 2013 09:58:08 +0000 (13:58 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 2 Apr 2013 09:58:08 +0000 (13:58 +0400)
include/sessions.php

index dd1ca663da26ca182ebed354b7e528b4db889a5d..4923a05b70e446e61e0809f56c6d545ae5127fe5 100644 (file)
        ini_set("session.use_only_cookies", true);
        ini_set("session.gc_maxlifetime", $session_expire);
 
+       global $session_connection;
+
+       $session_connection = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
+
        function session_get_schema_version($link, $nocache = false) {
                global $schema_version;
 
@@ -34,6 +38,7 @@
 
        function validate_session($link) {
                if (SINGLE_USER_MODE) return true;
+               if (!$link) return false;
 
                $check_ip = $_SESSION['ip_address'];
 
 
                global $session_connection;
 
-               $session_connection = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
-
                return true;
        }