From: David ‘Bombe’ Roden Date: Tue, 30 Nov 2010 04:49:24 +0000 (+0100) Subject: Only allow local Sones to log in. X-Git-Tag: 0.3.2-RC1~3 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=c5e96f331ebec74bfa4da5ec7d4c7c888321480d Only allow local Sones to log in. --- diff --git a/src/main/java/net/pterodactylus/sone/web/LoginPage.java b/src/main/java/net/pterodactylus/sone/web/LoginPage.java index 1e281b5..6c3e5c5 100644 --- a/src/main/java/net/pterodactylus/sone/web/LoginPage.java +++ b/src/main/java/net/pterodactylus/sone/web/LoginPage.java @@ -68,13 +68,7 @@ public class LoginPage extends SoneTemplatePage { template.set("sones", localSones); if (request.getMethod() == Method.POST) { String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone-id", 100); - Sone selectedSone = null; - for (Sone sone : webInterface.getCore().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");