Add method to set the current Sone.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 13 Oct 2010 09:16:11 +0000 (11:16 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 13 Oct 2010 09:16:11 +0000 (11:16 +0200)
src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java

index ce84abd..e0b42b1 100644 (file)
@@ -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
        //