org.itracker.web.util
Class LoginUtilities

java.lang.Object
  extended by org.itracker.web.util.LoginUtilities

public class LoginUtilities
extends Object


Constructor Summary
LoginUtilities()
           
 
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
 

Constructor Detail

LoginUtilities

public LoginUtilities()
Method Detail

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:

  1. request-attribute Constants.LOCALE_KEY
  2. request-param 'loc'
  3. session attribute Constants.LOCALE_KEY
  4. cookie 'loc'
  5. request.getLocale()/request.getLocales()
  6. 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.