| java.lang.Object com.jcorporate.expresso.core.servlet.CheckLogin
CheckLogin | final public class CheckLogin (Code) | | CheckLogin accepts an HttpServletRequest and HttpServletResponse object
pair, and attempts to check if the user is logged in.
If not, CheckLogin tries to log the user in via a cookie from the
client. If this is not possible, the user is logged in as "NONE".
It has now been modified to be a Singleton Object rather than having a new
object allocated with each request.
Example Usage:
CheckLogin.getInstance().checkLogin(request,response);
author: Michael Nash, Singleton Modification by Michael Rimov |
Constructor Summary | |
protected | CheckLogin() Default Constructor.... |
Method Summary | |
public void | checkLogin(HttpServletRequest request, HttpServletResponse response, ServletConfig c, String forceDB) | public void | checkLogin(HttpServletRequest request, String forceDB) | public void | checkLogin(HttpServletRequest request) | public void | checkLogin(HttpServletRequest request, HttpServletResponse response, ServletConfig c) | public void | checkLogin(HttpServletRequest request, HttpServletResponse response) | public static CheckLogin | getInstance() | public void | logInAsNone(HttpServletRequest request, String forceDB) | public boolean | loginViaContainer(HttpServletRequest request, String forceDB) Try to log in with a user name obtained from the container. | public boolean | loginViaCookie(HttpServletRequest request, String forceDB) Try to log in via the cookie from the client - if successful, return
true. |
CheckLogin | protected CheckLogin()(Code) | | Default Constructor.... Simply sets up the Log It should not be called
anymore directly. Use getInstance() instead.
|
logInAsNone | public void logInAsNone(HttpServletRequest request, String forceDB) throws ServletException(Code) | | For some reason a login session could not be established,
so log the user in as the "unknown" user "NONE"
Parameters: request - the servlet request object Parameters: forceDB - the data context to log into |
loginViaContainer | public boolean loginViaContainer(HttpServletRequest request, String forceDB) throws Exception(Code) | | Try to log in with a user name obtained from the container. This
function assumes that the container has already authenticated the user's
ID and password, thus no password checking is performed.
This is intended to allow more fine-grained access control via Expresso's
built-in mechanisms.
If successful, return true. If not, return false.
Parameters: request - The request object Parameters: forceDB - Name of default database to set true if successfull throws: Exception - upon error |
loginViaCookie | public boolean loginViaCookie(HttpServletRequest request, String forceDB) throws Exception(Code) | | Try to log in via the cookie from the client - if successful, return
true. If not, return false
Parameters: request - the servlet request object Parameters: forceDB - the data context to login to true if successfull throws: Exception - upon error |
|
|