feeds/view: periodically bump login timestamp

This commit is contained in:
Andrew Dolgov 2013-03-22 12:37:42 +04:00
parent feb9b2dfc9
commit 06b0777fa7
2 changed files with 8 additions and 0 deletions

View File

@ -806,6 +806,13 @@ class Feeds extends Handler_Protected {
set_pref($this->link, "_DEFAULT_VIEW_LIMIT", $limit); set_pref($this->link, "_DEFAULT_VIEW_LIMIT", $limit);
set_pref($this->link, "_DEFAULT_VIEW_ORDER_BY", $order_by); 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) { if (!$cat_view && is_numeric($feed) && $feed > 0) {
db_query($this->link, "UPDATE ttrss_feeds SET last_viewed = NOW() db_query($this->link, "UPDATE ttrss_feeds SET last_viewed = NOW()
WHERE id = '$feed' AND owner_uid = ".$_SESSION["uid"]); WHERE id = '$feed' AND owner_uid = ".$_SESSION["uid"]);

View File

@ -768,6 +768,7 @@
/* bump login timestamp */ /* bump login timestamp */
db_query($link, "UPDATE ttrss_users SET last_login = NOW() WHERE id = " . db_query($link, "UPDATE ttrss_users SET last_login = NOW() WHERE id = " .
$_SESSION["uid"]); $_SESSION["uid"]);
$_SESSION["last_login_update"] = time();
} }
if ($_SESSION["uid"] && $_SESSION["language"] && SESSION_COOKIE_LIFETIME > 0) { if ($_SESSION["uid"] && $_SESSION["language"] && SESSION_COOKIE_LIFETIME > 0) {