From: David ‘Bombe’ Roden Date: Fri, 21 Jan 2011 09:53:01 +0000 (+0100) Subject: Don’t create session when not visiting Sone. Fixes #87. X-Git-Tag: 0.4.2^2~12 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=bfd1ce8e6a10346e13e29efd41c9bcfd10d9ce6a;p=Sone.git Don’t create session when not visiting Sone. Fixes #87. --- diff --git a/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java b/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java index 719f4c6..c33974b 100644 --- a/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java @@ -129,7 +129,7 @@ public class CreateSonePage extends SoneTemplatePage { */ @Override public boolean isEnabled(ToadletContext toadletContext) { - return getCurrentSone(toadletContext) == null; + return getCurrentSone(toadletContext, false) == null; } } diff --git a/src/main/java/net/pterodactylus/sone/web/LoginPage.java b/src/main/java/net/pterodactylus/sone/web/LoginPage.java index 10f1f9f..1126f7b 100644 --- a/src/main/java/net/pterodactylus/sone/web/LoginPage.java +++ b/src/main/java/net/pterodactylus/sone/web/LoginPage.java @@ -84,7 +84,7 @@ public class LoginPage extends SoneTemplatePage { */ @Override protected String getRedirectTarget(Request request) { - if (getCurrentSone(request.getToadletContext()) != null) { + if (getCurrentSone(request.getToadletContext(), false) != null) { return "index.html"; } return null; @@ -99,7 +99,7 @@ public class LoginPage extends SoneTemplatePage { */ @Override public boolean isEnabled(ToadletContext toadletContext) { - return getCurrentSone(toadletContext) == null; + return getCurrentSone(toadletContext, false) == null; } } diff --git a/src/main/java/net/pterodactylus/sone/web/LogoutPage.java b/src/main/java/net/pterodactylus/sone/web/LogoutPage.java index 50266bd..23ccec0 100644 --- a/src/main/java/net/pterodactylus/sone/web/LogoutPage.java +++ b/src/main/java/net/pterodactylus/sone/web/LogoutPage.java @@ -57,7 +57,7 @@ public class LogoutPage extends SoneTemplatePage { */ @Override public boolean isEnabled(ToadletContext toadletContext) { - return getCurrentSone(toadletContext) != null; + return getCurrentSone(toadletContext, false) != null; } }