X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FDeletePostPage.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FDeletePostPage.java;h=78c9f220801ea58e5cc603b347c004f2902dda65;hb=5c64637098471f7cd59fcd3f1ce873c0f394c13d;hp=5722ee3d0c0a73b7b152fe0a236285c0e505a0be;hpb=364347ef2075213811bf90f4c30a5ac4fc4ea0c6;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/DeletePostPage.java b/src/main/java/net/pterodactylus/sone/web/DeletePostPage.java index 5722ee3..78c9f22 100644 --- a/src/main/java/net/pterodactylus/sone/web/DeletePostPage.java +++ b/src/main/java/net/pterodactylus/sone/web/DeletePostPage.java @@ -18,7 +18,6 @@ package net.pterodactylus.sone.web; import net.pterodactylus.sone.data.Post; -import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.web.page.Page.Request.Method; import net.pterodactylus.util.template.DataProvider; import net.pterodactylus.util.template.Template; @@ -63,12 +62,11 @@ public class DeletePostPage extends SoneTemplatePage { String postId = request.getHttpRequest().getPartAsStringFailsafe("post", 36); String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256); Post post = webInterface.getCore().getPost(postId); - Sone currentSone = getCurrentSone(request.getToadletContext()); - if (!post.getSone().equals(currentSone)) { + if (!webInterface.getCore().isLocalSone(post.getSone())) { throw new RedirectException("noPermission.html"); } if (request.getHttpRequest().isPartSet("confirmDelete")) { - currentSone.removePost(post); + webInterface.getCore().deletePost(post); throw new RedirectException(returnPage); } else if (request.getHttpRequest().isPartSet("abortDelete")) { throw new RedirectException(returnPage);