X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FDeleteReplyPage.java;h=4d6aff2861ac57425cbed603f4b0dae490909a71;hb=a88e930a23b550dae75116d7759924d760941776;hp=782589f1af6b9fabd2971ac71a5dcede09cf7306;hpb=13e00a0611cd80e43f813171d8b6d84870afbcbc;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/DeleteReplyPage.java b/src/main/java/net/pterodactylus/sone/web/DeleteReplyPage.java index 782589f..4d6aff2 100644 --- a/src/main/java/net/pterodactylus/sone/web/DeleteReplyPage.java +++ b/src/main/java/net/pterodactylus/sone/web/DeleteReplyPage.java @@ -1,5 +1,5 @@ /* - * Sone - DeleteReplyPage.java - Copyright © 2010 David Roden + * Sone - DeleteReplyPage.java - Copyright © 2010–2012 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,10 +17,11 @@ package net.pterodactylus.sone.web; -import net.pterodactylus.sone.data.Reply; -import net.pterodactylus.sone.web.page.Page.Request.Method; +import net.pterodactylus.sone.data.PostReply; +import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContext; +import net.pterodactylus.util.web.Method; /** * This page lets the user delete a reply. @@ -49,13 +50,13 @@ public class DeleteReplyPage extends SoneTemplatePage { * {@inheritDoc} */ @Override - protected void processTemplate(Request request, TemplateContext templateContext) throws RedirectException { + protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException { super.processTemplate(request, templateContext); String replyId = request.getHttpRequest().getPartAsStringFailsafe("reply", 36); - Reply reply = webInterface.getCore().getReply(replyId); + PostReply reply = webInterface.getCore().getPostReply(replyId, false); String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256); if (request.getMethod() == Method.POST) { - if (!webInterface.getCore().isLocalSone(reply.getSone())) { + if (!reply.getSone().isLocal()) { throw new RedirectException("noPermission.html"); } if (request.getHttpRequest().isPartSet("confirmDelete")) {