X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FDeleteImagePage.java;h=e1b2f37378ad4cb1d2ada4467a0cc1914a64fdef;hb=58418a5d13a1e8da185f1982f662c34eec2c4b1a;hp=999a38aeaa1b7ef5ea3fb78f362a6150bcd85f52;hpb=a23c4f218c3adf236d89d5927cae37d6e6e4feda;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/DeleteImagePage.java b/src/main/java/net/pterodactylus/sone/web/DeleteImagePage.java index 999a38a..e1b2f37 100644 --- a/src/main/java/net/pterodactylus/sone/web/DeleteImagePage.java +++ b/src/main/java/net/pterodactylus/sone/web/DeleteImagePage.java @@ -1,5 +1,5 @@ /* - * Sone - DeleteImagePage.java - Copyright © 2011 David Roden + * Sone - DeleteImagePage.java - Copyright © 2011–2016 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 @@ -18,9 +18,10 @@ package net.pterodactylus.sone.web; import net.pterodactylus.sone.data.Image; -import net.pterodactylus.sone.web.page.Page.Request.Method; +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; /** * Page that lets the user delete an {@link Image}. @@ -49,14 +50,13 @@ public class DeleteImagePage extends SoneTemplatePage { * {@inheritDoc} */ @Override - protected void processTemplate(Request request, TemplateContext templateContext) throws RedirectException { - super.processTemplate(request, templateContext); + protected void handleRequest(FreenetRequest request, TemplateContext templateContext) throws RedirectException { String imageId = (request.getMethod() == Method.POST) ? request.getHttpRequest().getPartAsStringFailsafe("image", 36) : request.getHttpRequest().getParam("image"); Image image = webInterface.getCore().getImage(imageId, false); if (image == null) { throw new RedirectException("invalid.html"); } - if (!webInterface.getCore().isLocalSone(image.getSone())) { + if (!image.getSone().isLocal()) { throw new RedirectException("noPermission.html"); } if (request.getMethod() == Method.POST) {