From a277007718774e04a1760a152b4b506d76b9635e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 21 Nov 2005 08:11:21 +0100 Subject: command globalUpdateFeeds to update feeds of all users at once --- backend.php | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'backend.php') diff --git a/backend.php b/backend.php index 1da333648..6a0a02ece 100644 --- a/backend.php +++ b/backend.php @@ -3,20 +3,23 @@ $op = $_REQUEST["op"]; - if (($op == "rpc" || $op == "updateAllFeeds" || - $op == "forceUpdateAllFeeds") && !$_REQUEST["noxml"]) { + if ((!$op || $op == "rpc" || $op == "globalUpdateFeeds") && !$_REQUEST["noxml"]) { header("Content-Type: application/xml"); } - if (!$_SESSION["uid"]) { + if (!$_SESSION["uid"] && $op != "globalUpdateFeeds") { - if (($op == "rpc" || $op == "updateAllFeeds" || - $op == "forceUpdateAllFeeds")) { + if ($op == "rpc") { print ""; } exit; } + if (!$op) { + print ""; + exit; + } + define(SCHEMA_VERSION, 2); require_once "config.php"; @@ -1594,15 +1597,20 @@ } - if ($op == "updateAllFeeds") { - update_all_feeds($link, true); + // update feeds of all users, may be used anonymously + if ($op == "globalUpdateFeeds") { + + $result = db_query($link, "SELECT id FROM ttrss_users"); + + while ($line = db_fetch_assoc($result)) { + $user_id = $line["id"]; +// print ""; + update_all_feeds($link, false, $user_id); + } - print ""; - getLabelCounters($link); - getFeedCounters($link); - getTagCounters($link); - getGlobalCounters($link); - print ""; + print " + + "; } -- cgit v1.2.3