diff --git a/classes/handler/public.php b/classes/handler/public.php index d5319c306b4813864f9706f2682cb73cc7293aec..6a67827dbb3906a1b95d235b6f23b39b7adf3a2b 100755 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -753,27 +753,6 @@ 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); diff --git a/classes/opml.php b/classes/opml.php index f8e9f6728a3248b6a93e8b3e861e4210fbc57b47..2cfc890faa833b635d186cbe60142476f362cac4 100644 --- a/classes/opml.php +++ b/classes/opml.php @@ -633,12 +633,6 @@ class OPML extends Handler_Protected { print "$msg<br/>"; } - static function get_publish_url(){ - return Config::get_self_url() . - "/public.php?op=publishOpml&key=" . - Feeds::_get_access_key('OPML:Publish', false, $_SESSION["uid"]); - } - function get_feed_category($feed_cat, $parent_cat_id = false) { $parent_cat_id = (int) $parent_cat_id; diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 788104d38de2fd2ff3e779380eec4c7cd7dc252d..5f763573660acfce701c5f145420e5989396acc6 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1012,17 +1012,6 @@ class Pref_Feeds extends Handler_Protected { </label> </form> - <hr/> - - <h2><?= __("Published OPML") ?></h2> - - <?= format_notice("Your OPML can be published and then subscribed by anyone who knows the URL below. This won't include your settings nor authenticated feeds.") ?> - - <button dojoType='dijit.form.Button' class='alt-primary' onclick="return Helpers.OPML.publish()"> - <?= \Controls\icon("share") ?> - <?= __('Display published OPML URL') ?> - </button> - <?php PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "prefFeedsOPML"); } @@ -1251,17 +1240,6 @@ class Pref_Feeds extends Handler_Protected { return Feeds::_clear_access_keys($_SESSION['uid']); } - function getOPMLKey() { - print json_encode(["link" => OPML::get_publish_url()]); - } - - function regenOPMLKey() { - Feeds::_update_access_key('OPML:Publish', - false, $_SESSION["uid"]); - - print json_encode(["link" => OPML::get_publish_url()]); - } - function regenFeedKey() { $feed_id = clean($_REQUEST['id']); $is_cat = clean($_REQUEST['is_cat']); diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js index cd831d4d0f6c8267c48ea1a605d73d834dfa1d12..361b653b638e27cf5178aacf1fdf4bd7b028ff8d 100644 --- a/js/PrefHelpers.js +++ b/js/PrefHelpers.js @@ -808,63 +808,5 @@ const Helpers = { console.log("export"); window.open("backend.php?op=opml&method=export&" + dojo.formToQuery("opmlExportForm")); }, - publish: function() { - Notify.progress("Loading, please wait...", true); - - xhr.json("backend.php", {op: "pref-feeds", method: "getOPMLKey"}, (reply) => { - try { - const dialog = new fox.SingleUseDialog({ - title: __("Public OPML URL"), - regenOPMLKey: function() { - if (confirm(__("Replace current OPML publishing address with a new one?"))) { - Notify.progress("Trying to change address...", true); - - xhr.json("backend.php", {op: "pref-feeds", method: "regenOPMLKey"}, (reply) => { - if (reply) { - const new_link = reply.link; - const target = this.domNode.querySelector('.generated_url'); - - if (new_link && target) { - target.href = new_link; - target.innerHTML = new_link; - - Notify.close(); - - } else { - Notify.error("Could not change feed URL."); - } - } - }); - } - return false; - }, - content: ` - <header>${__("Your Public OPML URL is:")}</header> - <section> - <div class='panel text-center'> - <a class='generated_url' href="${App.escapeHtml(reply.link)}" target='_blank'>${App.escapeHtml(reply.link)}</a> - </div> - </section> - <footer class='text-center'> - <button dojoType='dijit.form.Button' onclick="return App.dialogOf(this).regenOPMLKey()"> - ${App.FormFields.icon("refresh")} - ${__('Generate new URL')} - </button> - <button dojoType='dijit.form.Button' type='submit' class='alt-primary'> - ${__('Close this window')} - </button> - </footer> - ` - }); - - dialog.show(); - - Notify.close(); - - } catch (e) { - App.Error.report(e); - } - }); - }, } };