X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FSoneTemplatePage.java;h=2953b0d539e84b7d2db561b48380e822c4156287;hb=9b2dcc3ed5e56a634a6bf4351aa2524e6ae05a99;hp=1eef0c494bb1f3df8ecc462873f4bf852021e356;hpb=4c831fb948000bc1730ebcde73eeb62317f4ac54;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java index 1eef0c4..2953b0d 100644 --- a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java +++ b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java @@ -73,7 +73,7 @@ public class SoneTemplatePage extends TemplatePage { * Whether this page requires a login */ public SoneTemplatePage(String path, Template template, String pageTitleKey, WebInterface webInterface, boolean requireLogin) { - super(path, template, webInterface.l10n(), pageTitleKey, "noPermission.html"); + super(path, template, webInterface.getL10n(), pageTitleKey, "noPermission.html"); this.webInterface = webInterface; this.requireLogin = requireLogin; template.set("webInterface", webInterface); @@ -110,9 +110,9 @@ public class SoneTemplatePage extends TemplatePage { */ protected Session getCurrentSession(ToadletContext toadletContenxt, boolean create) { try { - Session session = webInterface.sessionManager().useSession(toadletContenxt); + Session session = webInterface.getSessionManager().useSession(toadletContenxt); if (create && (session == null)) { - session = webInterface.sessionManager().createSession(UUID.randomUUID().toString(), toadletContenxt); + session = webInterface.getSessionManager().createSession(UUID.randomUUID().toString(), toadletContenxt); } return session; } catch (freenet.clients.http.RedirectException re1) { @@ -137,12 +137,7 @@ public class SoneTemplatePage extends TemplatePage { if (soneId == null) { return null; } - for (Sone sone : webInterface.core().getSones()) { - if (sone.getId().equals(soneId)) { - return sone; - } - } - return null; + return webInterface.getCore().getLocalSone(soneId); } /**