diff options
author | Andrew Dolgov <[email protected]> | 2013-03-22 12:37:42 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-22 12:37:42 +0400 |
commit | 06b0777fa765126f1efbb50c6cf9905d2a1d3051 (patch) | |
tree | fa51286842292d2e164c40c34a1406e8b83e9b17 /classes/feeds.php | |
parent | feb9b2dfc9619f87bfea046c1a35ef4e8cc9597d (diff) |
feeds/view: periodically bump login timestamp
Diffstat (limited to 'classes/feeds.php')
-rw-r--r-- | classes/feeds.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/classes/feeds.php b/classes/feeds.php index 7f4c1d6c0..3657a0564 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -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"]); |