From: David ‘Bombe’ Roden Date: Wed, 13 Oct 2010 09:16:11 +0000 (+0200) Subject: Add method to set the current Sone. X-Git-Tag: 0.1-RC1~503 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=98aedbc2097b3007e1529a8dded81cbfa0914513;p=Sone.git Add method to set the current Sone. --- diff --git a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java index ce84abd..e0b42b1 100644 --- a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java +++ b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java @@ -113,6 +113,19 @@ public class SoneTemplatePage extends TemplatePage { return (Sone) session.getAttribute("Sone.CurrentSone"); } + /** + * Sets the currently logged in Sone. + * + * @param request + * The request + * @param sone + * The Sone to set as currently logged in + */ + protected void setCurrentSone(Request request, Sone sone) { + Session session = getCurrentSession(request); + session.setAttribute("Sone.CurrentSone", sone); + } + // // TEMPLATEPAGE METHODS //