actually implement manual purge RPC call

This commit is contained in:
Andrew Dolgov 2007-10-18 11:58:44 +01:00
parent e88a65f45e
commit 81cd6cacaa
1 changed files with 25 additions and 0 deletions

View File

@ -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>";
}
?>