From: David ‘Bombe’ Roden Date: Mon, 21 Mar 2011 15:15:19 +0000 (+0100) Subject: Get redirection target from URL, default to “index.html”. X-Git-Tag: 0.5.2^2~3^2~2 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c8fbf072a53cb60c54c22ab14511e24f36b92d88;p=Sone.git Get redirection target from URL, default to “index.html”. --- 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());