Navigation Menu

Skip to content

Commit

Permalink
add function to delete public pads as etherpad admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Gared authored and Pita committed Jul 14, 2011
1 parent 2fc6b66 commit 94b67ae
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions etherpad/src/etherpad/control/admincontrol.js
Expand Up @@ -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
});

}
1 change: 1 addition & 0 deletions etherpad/src/themes/default/templates/admin/page.ejs
Expand Up @@ -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>
Expand Down

0 comments on commit 94b67ae

Please sign in to comment.