From 6eaf09d4900d0287e07f77f9db3cd507864e251a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 28 Oct 2010 06:13:47 +0200 Subject: [PATCH] Only show the login page in the menu if no Sone is logged in. --- src/main/java/net/pterodactylus/sone/web/LoginPage.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/web/LoginPage.java b/src/main/java/net/pterodactylus/sone/web/LoginPage.java index 0505220..486d8fb 100644 --- a/src/main/java/net/pterodactylus/sone/web/LoginPage.java +++ b/src/main/java/net/pterodactylus/sone/web/LoginPage.java @@ -26,6 +26,7 @@ import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.template.SoneAccessor; import net.pterodactylus.sone.web.page.Page.Request.Method; import net.pterodactylus.util.template.Template; +import freenet.clients.http.ToadletContext; /** * The login page manages logging the user in. @@ -86,4 +87,16 @@ public class LoginPage extends SoneTemplatePage { } } + // + // SONETEMPLATEPAGE METHODS + // + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled(ToadletContext toadletContext) { + return getCurrentSone(toadletContext) == null; + } + } -- 2.7.4