org.itracker.web.util
Class LoginUtilities
java.lang.Object
org.itracker.web.util.LoginUtilities
public class LoginUtilities
- extends Object
|
Method Summary |
static Boolean |
allowSaveLogin(javax.servlet.http.HttpServletRequest request)
|
static boolean |
checkAutoLogin(javax.servlet.http.HttpServletRequest request,
boolean allowSaveLogin)
|
static int |
getConfiguredSessionTimeout()
|
static Locale |
getCurrentLocale(javax.servlet.http.HttpServletRequest request)
Get a locale from request |
static User |
getCurrentUser(javax.servlet.http.HttpServletRequest request)
get current user from request-attribute currUser, if not set from request-session |
static int |
getRequestAuthType(javax.servlet.http.HttpServletRequest request)
|
static User |
setupSession(String login,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
static User |
setupSession(User user,
String encPassword,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LoginUtilities
public LoginUtilities()
checkAutoLogin
public static boolean checkAutoLogin(javax.servlet.http.HttpServletRequest request,
boolean allowSaveLogin)
getRequestAuthType
public static int getRequestAuthType(javax.servlet.http.HttpServletRequest request)
getCurrentLocale
public static Locale getCurrentLocale(javax.servlet.http.HttpServletRequest request)
- Get a locale from request
TODO the order of retrieving locale from request should be:
- request-attribute Constants.LOCALE_KEY
- request-param 'loc'
- session attribute
Constants.LOCALE_KEY
- cookie 'loc'
- request.getLocale()/request.getLocales()
- ITrackerResources.DEFAULT_LOCALE
- Parameters:
request -
- Returns:
getCurrentUser
public static final User getCurrentUser(javax.servlet.http.HttpServletRequest request)
- get current user from request-attribute currUser, if not set from request-session
- Parameters:
request -
- Returns:
- current user or null if unauthenticated
- Throws:
NullPointerException - if the request was null
allowSaveLogin
public static final Boolean allowSaveLogin(javax.servlet.http.HttpServletRequest request)
setupSession
public static User setupSession(String login,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
setupSession
public static User setupSession(User user,
String encPassword,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
getConfiguredSessionTimeout
public static int getConfiguredSessionTimeout()
Copyright © 2002-2012 itracker. All Rights Reserved.