X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FBlockSonePage.java;h=328d6f09e2efdc40fbebe6d809367cf1723f56db;hb=5d1ad36c04f83468efd85f6f03983306b2d98d6d;hp=afac535a07a4e505d674967c05bd0bee834f1812;hpb=d564858954b0df2464b2ea536a770c408d5aad75;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java b/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java index afac535..328d6f0 100644 --- a/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java @@ -36,7 +36,7 @@ public class BlockSonePage extends SoneTemplatePage { * The Sone web interface */ public BlockSonePage(Template template, WebInterface webInterface) { - super("blockSone.html", template, "Page.BlockSone.Title", webInterface); + super("blockSone.html", template, "Page.BlockSone.Title", webInterface, true); } // @@ -49,24 +49,12 @@ public class BlockSonePage extends SoneTemplatePage { @Override protected void processTemplate(Request request, Template template) throws RedirectException { super.processTemplate(request, template); - String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone", 36); if (request.getMethod() == Method.POST) { + String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone", 36); + String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 64); getCurrentSone(request.getToadletContext()).addBlockedSoneId(soneId); + throw new RedirectException(returnPage); } - throw new RedirectException("viewSone.html?sone=" + soneId); - } - - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - // TODO Auto-generated method stub - return super.requiresLogin(); } }