From bfd1ce8e6a10346e13e29efd41c9bcfd10d9ce6a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 21 Jan 2011 10:53:01 +0100 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20create=20session=20when=20not=20?= =?utf8?q?visiting=20Sone.=20Fixes=20#87.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/CreateSonePage.java | 2 +- src/main/java/net/pterodactylus/sone/web/LoginPage.java | 4 ++-- src/main/java/net/pterodactylus/sone/web/LogoutPage.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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; } } -- 2.7.4