prefs: add button to clear all generated URLs

This commit is contained in:
Andrew Dolgov 2010-11-08 14:51:58 +03:00
parent aa1c2aa4f9
commit 8d86f15f40
3 changed files with 33 additions and 0 deletions

View file

@ -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>";
}
?>

View file

@ -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> ";
}

View file

@ -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;
}