From 8d86f15f40c45592f189614938e7ec88dadc0bb5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 8 Nov 2010 14:51:58 +0300 Subject: [PATCH] prefs: add button to clear all generated URLs --- modules/backend-rpc.php | 10 ++++++++++ modules/pref-feeds.php | 2 ++ prefs.js | 21 +++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index 1bf41d299..053cd47df 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -1120,6 +1120,16 @@ return; } + if ($subop == "clearKeys") { + + db_query($link, "DELETE FROM ttrss_access_keys WHERE + owner_uid = " . $_SESSION["uid"]); + + print "OK"; + + return; + } + print "Unknown method: $subop"; } ?> diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index de9166fe4..30046ddb9 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -1498,6 +1498,8 @@ print " "; + print " "; } diff --git a/prefs.js b/prefs.js index 5ba267b77..33ed8fd76 100644 --- a/prefs.js +++ b/prefs.js @@ -2088,3 +2088,24 @@ function opmlImportHandler(iframe) { exception_error("opml_import_handler", e); } } + +function clearFeedAccessKeys() { + + var ok = confirm(__("This will invalidate all previously generated feed URLs. Continue?")); + + if (ok) { + notify_progress("Clearing URLs..."); + + var query = "?op=rpc&subop=clearKeys"; + + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + notify_info("Generated URLs cleared."); + } }); + } + + return false; +} + +