From: David ‘Bombe’ Roden Date: Mon, 15 Sep 2014 18:24:05 +0000 (+0200) Subject: Redirect to “no permission” page if parent album or current Sone is incorrect. X-Git-Tag: 0.9-rc1^2~3^2~123 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=1360e42f232e2f0fd2ae0cb1308b2c3fe1f57ce7;p=Sone.git Redirect to “no permission” page if parent album or current Sone is incorrect. --- 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);