]> git.wh0rd.org Git - tt-rss.git/commitdiff
prefs: add button to clear all generated URLs
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 8 Nov 2010 11:51:58 +0000 (14:51 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 8 Nov 2010 11:51:58 +0000 (14:51 +0300)
modules/backend-rpc.php
modules/pref-feeds.php
prefs.js

index 1bf41d29916feb31ba096e6ae13d566b988bfead..053cd47df5a818b62bb8327c3f5db53460098430 100644 (file)
                        return;
                }
 
+               if ($subop == "clearKeys") {
+
+                       db_query($link, "DELETE FROM ttrss_access_keys WHERE
+                               owner_uid = " . $_SESSION["uid"]);
+
+                       print "<rpc-reply><message>OK</message></rpc-reply>";
+
+                       return;
+               }
+
                print "<rpc-reply><error>Unknown method: $subop</error></rpc-reply>";
        }
 ?>
index de9166fe453282d26ede4a77163807760b2fb874..30046ddb9a67753e97681b9fb41736962d858854 100644 (file)
                print "<button onclick=\"return displayDlg('generatedFeed', '$rss_url')\">".
                        __('Display URL')."</button> ";
                
+               print "<button onclick=\"return clearFeedAccessKeys()\">".
+                       __('Clear all generated URLs')."</button> ";
 
        }
 
index 5ba267b775e1cd07466695e87f22721f5fd16b88..33ed8fd767ebb2b9829b22ff0e759ef74a61133e 100644 (file)
--- 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;
+}
+
+