X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FLoginPage.java;h=6c3e5c59a561b412e19d6511ebe9639028bbc08f;hb=c5e96f331ebec74bfa4da5ec7d4c7c888321480d;hp=4a3e2b158e129ee73f2fa858f4bacad82c682db5;hpb=2c5b76a2fbce16ef33f079a3de9ae9fc9a9d30b8;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/LoginPage.java b/src/main/java/net/pterodactylus/sone/web/LoginPage.java index 4a3e2b1..6c3e5c5 100644 --- a/src/main/java/net/pterodactylus/sone/web/LoginPage.java +++ b/src/main/java/net/pterodactylus/sone/web/LoginPage.java @@ -63,24 +63,18 @@ public class LoginPage extends SoneTemplatePage { protected void processTemplate(Request request, Template template) throws RedirectException { super.processTemplate(request, template); /* get all own identities. */ - List localSones = new ArrayList(webInterface.core().getLocalSones()); + List localSones = new ArrayList(webInterface.getCore().getLocalSones()); Collections.sort(localSones, Sone.NICE_NAME_COMPARATOR); template.set("sones", localSones); if (request.getMethod() == Method.POST) { String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone-id", 100); - Sone selectedSone = null; - for (Sone sone : webInterface.core().getSones()) { - if (sone.getId().equals(soneId)) { - selectedSone = sone; - break; - } - } + Sone selectedSone = webInterface.getCore().getLocalSone(soneId); if (selectedSone != null) { setCurrentSone(request.getToadletContext(), selectedSone); throw new RedirectException("index.html"); } } - List ownIdentitiesWithoutSone = CreateSonePage.getOwnIdentitiesWithoutSone(webInterface.core()); + List ownIdentitiesWithoutSone = CreateSonePage.getOwnIdentitiesWithoutSone(webInterface.getCore()); template.set("identitiesWithoutSone", ownIdentitiesWithoutSone); }