/** * @see I_CmsAuthorizationHandler#initCmsObject(HttpServletRequest) */ public CmsObject initCmsObject(HttpServletRequest request) { // check if "basic" authorization data is provided CmsObject cms = checkBasicAuthorization(request); // basic authorization successful? if (cms != null) { try { // register the session into OpenCms and // return successful logged in user return registerSession(request, cms); } catch (CmsException e) { // ignore and threat the whole login process as failed } } // failed return null; }
/** * @see I_CmsAuthorizationHandler#initCmsObject(HttpServletRequest) */ public CmsObject initCmsObject(HttpServletRequest request) { // check if "basic" authorization data is provided CmsObject cms = checkBasicAuthorization(request); // basic authorization successful? if (cms != null) { try { // register the session into OpenCms and // return successful logged in user return registerSession(request, cms); } catch (CmsException e) { // ignore and threat the whole login process as failed } } // failed return null; }
/** * @see I_CmsAuthorizationHandler#initCmsObject(HttpServletRequest, String, String) */ public CmsObject initCmsObject(HttpServletRequest request, String userName, String pwd) throws CmsException { // first, try to validate the session CmsObject cms = initCmsObjectFromSession(request); if (cms != null) { return cms; } // try to login with the given credentials cms = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserGuest()); // this will throw an exception if login fails cms.loginUser(userName, pwd); // register the session into OpenCms and // return successful logged in user return registerSession(request, cms); }
/** * @see I_CmsAuthorizationHandler#initCmsObject(HttpServletRequest, String, String) */ public CmsObject initCmsObject(HttpServletRequest request, String userName, String pwd) throws CmsException { // first, try to validate the session CmsObject cms = initCmsObjectFromSession(request); if (cms != null) { return cms; } // try to login with the given credentials cms = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserGuest()); // this will throw an exception if login fails cms.loginUser(userName, pwd); // register the session into OpenCms and // return successful logged in user return registerSession(request, cms); }