From: David ‘Bombe’ Roden Date: Thu, 28 Oct 2010 04:13:47 +0000 (+0200) Subject: Only show the login page in the menu if no Sone is logged in. X-Git-Tag: 0.1-RC2~6 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6eaf09d4900d0287e07f77f9db3cd507864e251a;p=Sone.git Only show the login page in the menu if no Sone is logged in. --- 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; + } + }