summaryrefslogtreecommitdiff
path: root/classes/handler
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-21 15:16:39 +0300
committerAndrew Dolgov <[email protected]>2021-02-21 15:16:39 +0300
commitd1328321bebadcf8a530d3c05f52a8f3c58bb969 (patch)
tree8340f32be6292375fa32c1332bab128d35ac5564 /classes/handler
parent2843b9917133e5ed8e1adf4ffd12356459fc16e4 (diff)
move published OPML endpoint to public.php
Diffstat (limited to 'classes/handler')
-rwxr-xr-xclasses/handler/public.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/classes/handler/public.php b/classes/handler/public.php
index 8076bb303..b0ce2306d 100755
--- a/classes/handler/public.php
+++ b/classes/handler/public.php
@@ -737,6 +737,27 @@ class Handler_Public extends Handler {
<?php
}
+ function publishOpml() {
+ $key = clean($_REQUEST["key"]);
+ $pdo = Db::pdo();
+
+ $sth = $pdo->prepare( "SELECT owner_uid
+ FROM ttrss_access_keys WHERE
+ access_key = ? AND feed_id = 'OPML:Publish'");
+ $sth->execute([$key]);
+
+ if ($row = $sth->fetch()) {
+ $owner_uid = $row['owner_uid'];
+
+ $opml = new OPML($_REQUEST);
+ $opml->opml_export("published.opml", $owner_uid, true, false);
+
+ } else {
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
+ echo "File not found.";
+ }
+ }
+
function cached() {
list ($cache_dir, $filename) = explode("/", $_GET["file"], 2);