Skip to content
Browse files

add function to delete public pads as etherpad admin

  • Loading branch information...
1 parent 2fc6b66 commit 94b67ae16db062f63e78946b3dc82325f571d18e @Gared Gared committed with Pita
View
26 etherpad/src/etherpad/control/admincontrol.js
@@ -1531,3 +1531,29 @@ function render_reset_subscription() {
content: body
});
}
+
+function render_delete_pad() {
+ var body = DIV();
+ body.push("Delete Pad");
+ if (request.isGet) {
+ body.push(FORM({method: "POST"},
+ "padId: ", INPUT({type: "text", name: "padId"}),
+BUTTON({name: "delete"}, "Delete")));
+ } else if (request.isPost) {
+ var localPadId = request.params.padId;
+ model.accessPadGlobal(localPadId, function(pad) {
+ collab_server.bootUsersFromPad(pad, "deleted");
+ pad.destroy();
+ });
+ dbwriter.taskFlushPad(localPadId, "delete");
+ }
+ body.push(A({href: request.path}, html("« back")));
+ renderHtml("admin/dynamic.ejs",
+ {
+ config: appjet.config,
+ bodyClass: 'nonpropad',
+ title: 'Delete Pad',
+ content: body
+ });
+
+}
View
1 etherpad/src/themes/default/templates/admin/page.ejs
@@ -39,6 +39,7 @@ limitations under the License. */ %>
<ul>
<li><a href="/ep/admin/broadcast-message">Pad Broadcast</a></li>
<li><a href="/ep/admin/padinspector">Pad Inspector</a></li>
+ <li><a href="/ep/admin/delete-pad">Delete Pad</a></li>
<li><a href="/ep/admin/reset-subscription">Reset Subscription</a></li>
<% if (sessions.isAnEtherpadAdmin()) { %>
<li><a href="/ep/admin/setadminmode?v=false">Exit admin mode</a></li>

0 comments on commit 94b67ae

Please sign in to comment.
Something went wrong with that request. Please try again.