X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=ec2078512b4d39490d8173417b3ab76d5f9bfaf1;hb=a887d9b9cfd95c6cdd3766f12130dc6420f725f5;hp=b4a0510051bb788cc04f1b9df482d4358afa24dc;hpb=c5ef8ee93d423ceb270311681fa09bfa495de78c;p=Sone.git 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"));