prefs: add button to clear all generated URLs
This commit is contained in:
parent
aa1c2aa4f9
commit
8d86f15f40
|
@ -1120,6 +1120,16 @@
|
|||
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>";
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -1498,6 +1498,8 @@
|
|||
print "<button onclick=\"return displayDlg('generatedFeed', '$rss_url')\">".
|
||||
__('Display URL')."</button> ";
|
||||
|
||||
print "<button onclick=\"return clearFeedAccessKeys()\">".
|
||||
__('Clear all generated URLs')."</button> ";
|
||||
|
||||
}
|
||||
|
||||
|
|
21
prefs.js
21
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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue