From: Andrew Dolgov Date: Wed, 24 Apr 2013 12:57:24 +0000 (+0400) Subject: use static version for session checking, show latest changeset for git version instea... X-Git-Tag: 1.7.9~25^2~92 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3472c4c5696cfa868b16d81c937605258acd2125;p=tt-rss.git use static version for session checking, show latest changeset for git version instead of head date --- diff --git a/include/functions.php b/include/functions.php index a41d3a95..39021e9d 100644 --- a/include/functions.php +++ b/include/functions.php @@ -659,7 +659,7 @@ @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'"); diff --git a/include/sessions.php b/include/sessions.php index c4876489..423ef0ed 100644 --- a/include/sessions.php +++ b/include/sessions.php @@ -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']; diff --git a/include/version.php b/include/version.php index 4d088a2b..0e583f9e 100644 --- a/include/version.php +++ b/include/version.php @@ -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 {