From 98aedbc2097b3007e1529a8dded81cbfa0914513 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 13 Oct 2010 11:16:11 +0200 Subject: [PATCH] Add method to set the current Sone. --- .../java/net/pterodactylus/sone/web/SoneTemplatePage.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 // -- 2.7.4