]> git.wh0rd.org Git - tt-rss.git/commitdiff
use static version for session checking, show latest changeset for git version instea...
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 24 Apr 2013 12:57:24 +0000 (16:57 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 24 Apr 2013 12:57:24 +0000 (16:57 +0400)
include/functions.php
include/sessions.php
include/version.php

index a41d3a950c6ba393fd827b0389ba778e08271169..39021e9d0acf4f3c4d11ad11d2c8f60bae553244 100644 (file)
                                @session_start();
 
                                $_SESSION["uid"] = $user_id;
-                               $_SESSION["version"] = VERSION;
+                               $_SESSION["version"] = VERSION_STATIC;
 
                                $result = db_query("SELECT login,access_level,pwd_hash FROM ttrss_users
                                        WHERE id = '$user_id'");
index c4876489fa3165a486909a45158539cda583acce..423ef0eda92ed0fd1cabb1cd722468c1d12350e4 100644 (file)
@@ -39,7 +39,7 @@
        function validate_session() {
                if (SINGLE_USER_MODE) return true;
 
-               if (VERSION != $_SESSION["version"]) return false;
+               if (VERSION_STATIC != $_SESSION["version"]) return false;
 
                $check_ip = $_SESSION['ip_address'];
 
index 4d088a2bb76dadda90ad60dbef714774a1ee8cbd..0e583f9ecbf3f025d20f8c5d7789e5d032945925 100644 (file)
@@ -7,7 +7,7 @@
 
                if (is_dir("$root_dir/.git") && file_exists("$root_dir/.git/ORIG_HEAD")) {
 
-                       $suffix = date("Ymd", filemtime("$root_dir/.git/ORIG_HEAD"));
+                       $suffix = substr(trim(file_get_contents("$root_dir/.git/ORIG_HEAD")), 0, 7);
 
                        return VERSION_STATIC . ".$suffix";
                } else {