]> git.wh0rd.org Git - tt-rss.git/commitdiff
feeds/view: periodically bump login timestamp
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 22 Mar 2013 08:37:42 +0000 (12:37 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 22 Mar 2013 08:37:42 +0000 (12:37 +0400)
classes/feeds.php
include/functions.php

index 7f4c1d6c0eab2417a4a05796c0c44f211c5d13cf..3657a0564caa247cc91e9d0c0fb186c44506b45e 100644 (file)
@@ -806,6 +806,13 @@ class Feeds extends Handler_Protected {
                set_pref($this->link, "_DEFAULT_VIEW_LIMIT", $limit);
                set_pref($this->link, "_DEFAULT_VIEW_ORDER_BY", $order_by);
 
+               /* bump login timestamp if needed */
+               if (time() - $_SESSION["last_login_update"] > 3600) {
+                       db_query($this->link, "UPDATE ttrss_users SET last_login = NOW() WHERE id = " .
+                               $_SESSION["uid"]);
+                       $_SESSION["last_login_update"] = time();
+               }
+
                if (!$cat_view && is_numeric($feed) && $feed > 0) {
                        db_query($this->link, "UPDATE ttrss_feeds SET last_viewed = NOW()
                                                        WHERE id = '$feed' AND owner_uid = ".$_SESSION["uid"]);
index 355fcd32ba7505f5b193e9a32634013f85e092ca..8804d71d13789738c297fa4ca4fe7ceb6ca8f0a6 100644 (file)
                                /* bump login timestamp */
                                db_query($link, "UPDATE ttrss_users SET last_login = NOW() WHERE id = " .
                                        $_SESSION["uid"]);
+                               $_SESSION["last_login_update"] = time();
                        }
 
                        if ($_SESSION["uid"] && $_SESSION["language"] && SESSION_COOKIE_LIFETIME > 0) {