From 1360e42f232e2f0fd2ae0cb1308b2c3fe1f57ce7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 15 Sep 2014 20:24:05 +0200 Subject: [PATCH] =?utf8?q?Redirect=20to=20=E2=80=9Cno=20permission?= =?utf8?q?=E2=80=9D=20page=20if=20parent=20album=20or=20current=20Sone=20i?= =?utf8?q?s=20incorrect.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/UploadImagePage.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java b/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java index b7e9e93..d938641 100644 --- a/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java +++ b/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java @@ -83,12 +83,10 @@ public class UploadImagePage extends SoneTemplatePage { String parentId = request.getHttpRequest().getPartAsStringFailsafe("parent", 36); Album parent = webInterface.getCore().getAlbum(parentId); if (parent == null) { - /* TODO - signal error */ - return; + throw new RedirectException("noPermission.html"); } if (!currentSone.equals(parent.getSone())) { - /* TODO - signal error. */ - return; + throw new RedirectException("noPermission.html"); } String name = request.getHttpRequest().getPartAsStringFailsafe("title", 200); String description = request.getHttpRequest().getPartAsStringFailsafe("description", 4000); -- 2.7.4