Get redirection target from URL, default to “index.html”.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 21 Mar 2011 15:15:19 +0000 (16:15 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 21 Mar 2011 15:15:19 +0000 (16:15 +0100)
src/main/java/net/pterodactylus/sone/web/LoginPage.java

index 1126f7b..eaa8351 100644 (file)
@@ -72,7 +72,11 @@ public class LoginPage extends SoneTemplatePage {
                        Sone selectedSone = webInterface.getCore().getLocalSone(soneId, false);
                        if (selectedSone != null) {
                                setCurrentSone(request.getToadletContext(), selectedSone);
-                               throw new RedirectException("index.html");
+                               String target = request.getHttpRequest().getParam("target");
+                               if ((target == null) || (target.length() == 0)) {
+                                       target = "index.html";
+                               }
+                               throw new RedirectException(target);
                        }
                }
                List<OwnIdentity> ownIdentitiesWithoutSone = CreateSonePage.getOwnIdentitiesWithoutSone(webInterface.getCore());