Redirect to “no permission” page if parent album or current Sone is incorrect.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 15 Sep 2014 18:24:05 +0000 (20:24 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 15 Sep 2014 19:46:54 +0000 (21:46 +0200)
src/main/java/net/pterodactylus/sone/web/UploadImagePage.java

index b7e9e93..d938641 100644 (file)
@@ -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);