From c8fbf072a53cb60c54c22ab14511e24f36b92d88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 21 Mar 2011 16:15:19 +0100 Subject: [PATCH] =?utf8?q?Get=20redirection=20target=20from=20URL,=20defau?= =?utf8?q?lt=20to=20=E2=80=9Cindex.html=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/LoginPage.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/web/LoginPage.java b/src/main/java/net/pterodactylus/sone/web/LoginPage.java index 1126f7b..eaa8351 100644 --- a/src/main/java/net/pterodactylus/sone/web/LoginPage.java +++ b/src/main/java/net/pterodactylus/sone/web/LoginPage.java @@ -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 ownIdentitiesWithoutSone = CreateSonePage.getOwnIdentitiesWithoutSone(webInterface.getCore()); -- 2.7.4