1 23 package org.enhydra.barracuda.discRack.pres.services; 24 25 import java.util.*; 26 import javax.servlet.*; 27 import javax.servlet.http.*; 28 29 import org.enhydra.barracuda.core.event.*; 30 import org.enhydra.barracuda.plankton.data.*; 31 import org.enhydra.barracuda.core.util.http.*; 32 33 import org.enhydra.barracuda.discRack.biz.person.Person; 34 35 40 public class LoginServices { 41 42 private static String PERSON = LoginServices.class.getName()+".Person"; 44 45 48 public static boolean isLoggedIn(HttpSession session) { 49 return (session.getAttribute(PERSON)!=null); 51 } 52 53 56 public static Person getCurrentUser(HttpSession session) { 57 return (Person) session.getAttribute(PERSON); 58 } 59 60 64 public static void logIn(HttpSession session, Person person) { 65 session.setAttribute(PERSON, person); 67 } 68 69 73 public static void logOut(HttpSession session) { 74 session.removeAttribute(PERSON); 76 } 77 } 78 | Popular Tags |