/** * Updates all session info objects, so that invalid projects * are replaced by the Online project.<p> * * @param cms the cms context */ public void updateSessionInfos(CmsObject cms) { // get all sessions List<CmsSessionInfo> userSessions = getSessionInfos(); Iterator<CmsSessionInfo> i = userSessions.iterator(); while (i.hasNext()) { CmsSessionInfo sessionInfo = i.next(); // check is the project stored in this session is not existing anymore // if so, set it to the online project CmsUUID projectId = sessionInfo.getProject(); try { cms.readProject(projectId); } catch (CmsException e) { // the project does not longer exist, update the project information with the online project sessionInfo.setProject(CmsProject.ONLINE_PROJECT_ID); addSessionInfo(sessionInfo); } } }
/** * Updates all session info objects, so that invalid projects * are replaced by the Online project.<p> * * @param cms the cms context */ public void updateSessionInfos(CmsObject cms) { // get all sessions List userSessions = getSessionInfos(); Iterator i = userSessions.iterator(); while (i.hasNext()) { CmsSessionInfo sessionInfo = (CmsSessionInfo)i.next(); // check is the project stored in this session is not existing anymore // if so, set it to the online project CmsUUID projectId = sessionInfo.getProject(); try { cms.readProject(projectId); } catch (CmsException e) { // the project does not longer exist, update the project information with the online project sessionInfo.setProject(CmsProject.ONLINE_PROJECT_ID); addSessionInfo(sessionInfo); } } }
addSessionInfo(sessionInfo); } else { HttpSession session = req.getSession(false); addSessionInfo(sessionInfo);
addSessionInfo(sessionInfo); } else { HttpSession session = req.getSession(false); addSessionInfo(sessionInfo);
request.getSession().getMaxInactiveInterval()); OpenCmsCore.getInstance().getSessionManager().addSessionInfo(sessionInfo);
addSessionInfo(sessionInfo); } else { sessionInfo = new CmsSessionInfo( addSessionInfo(sessionInfo);
/** * Registers the current session with OpenCms.<p> * * @param request the current request * @param cms the cms object to register * * @return the updated cms context * * @throws CmsException if something goes wrong */ protected CmsObject registerSession(HttpServletRequest request, CmsObject cms) throws CmsException { // update the request context cms = OpenCmsCore.getInstance().updateContext(request, cms); CmsUser user = cms.getRequestContext().currentUser(); if (!user.isGuestUser() && !OpenCms.getDefaultUsers().isUserExport(user.getName())) { // create the session info object, only for 'real' users CmsSessionInfo sessionInfo = new CmsSessionInfo( cms.getRequestContext(), new CmsUUID(), request.getSession().getMaxInactiveInterval()); // register the updated cms object in the session manager OpenCmsCore.getInstance().getSessionManager().addSessionInfo(sessionInfo); } // return the updated cms object return cms; }