diff options
author | Andrew Dolgov <[email protected]> | 2007-10-18 11:58:44 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2007-10-18 11:58:44 +0100 |
commit | 81cd6cacaa8556c369427d3c9f75329c44a89896 (patch) | |
tree | 4702409bb7ce3214f98ad4824cb42ad2f8ebd0c9 /modules/backend-rpc.php | |
parent | e88a65f45eadb94dc0352d2363d71cca6929e20d (diff) |
actually implement manual purge RPC call
Diffstat (limited to 'modules/backend-rpc.php')
-rw-r--r-- | modules/backend-rpc.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index b54bd783a..5a8452ea4 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -376,6 +376,31 @@ return; } + if ($subop == "purge") { + $ids = split(",", db_escape_string($_GET["ids"])); + $days = sprintf("%d", $_GET["days"]); + + print "<rpc-reply>"; + + print "<message><![CDATA["; + + foreach ($ids as $id) { + + $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE + id = '$id' AND owner_uid = ".$_SESSION["uid"]); + + if (db_num_rows($result) == 1) { + purge_feed($link, $id, $days, true); + } + } + + print "]]></message>"; + + print "</rpc-reply>"; + + return; + } + print "<rpc-reply><error>Unknown method: $subop</error></rpc-reply>"; } ?> |