From: David ‘Bombe’ Roden Date: Fri, 22 Oct 2010 14:02:58 +0000 (+0200) Subject: Store the form password. X-Git-Tag: 0.1-RC1~86 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=a887d9b9cfd95c6cdd3766f12130dc6420f725f5 Store the form password. --- 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"));