From a887d9b9cfd95c6cdd3766f12130dc6420f725f5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 22 Oct 2010 16:02:58 +0200 Subject: [PATCH] Store the form password. --- .../java/net/pterodactylus/sone/web/WebInterface.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index b4a0510..ec20785 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -75,6 +75,9 @@ public class WebInterface extends AbstractService { /** The registered toadlets. */ private final List pageToadlets = new ArrayList(); + /** The form password. */ + private final String formPassword; + /** * Creates a new web interface. * @@ -84,6 +87,7 @@ public class WebInterface extends AbstractService { public WebInterface(SonePlugin sonePlugin) { super("Sone Web Interface", false); this.sonePlugin = sonePlugin; + formPassword = sonePlugin.pluginRespirator().getToadletContainer().getFormPassword(); } // @@ -122,6 +126,15 @@ public class WebInterface extends AbstractService { } } + /** + * Returns the node’s form password. + * + * @return The form password + */ + public String formPassword() { + return formPassword; + } + // // SERVICE METHODS // @@ -162,7 +175,7 @@ public class WebInterface extends AbstractService { templateFactory.addPlugin("getpage", new GetPagePlugin()); templateFactory.addPlugin("paginate", new PaginationPlugin()); templateFactory.setTemplateProvider(new ClassPathTemplateProvider(templateFactory)); - templateFactory.addTemplateObject("formPassword", sonePlugin.pluginRespirator().getToadletContainer().getFormPassword()); + templateFactory.addTemplateObject("formPassword", formPassword); Template loginTemplate = templateFactory.createTemplate(createReader("/templates/login.html")); Template indexTemplate = templateFactory.createTemplate(createReader("/templates/index.html")); -- 2.7.4