Index: lams_central/build.xml =================================================================== diff -u -r05db875c7974d705f89231416ff6dfe91a5e70f1 -rc234c64ad9ff9d713f6d8e3331d0c20075e49303 --- lams_central/build.xml (.../build.xml) (revision 05db875c7974d705f89231416ff6dfe91a5e70f1) +++ lams_central/build.xml (.../build.xml) (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303) @@ -252,6 +252,7 @@ + + + @@ -24,6 +29,9 @@ + + + Index: lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java =================================================================== diff -u -r0e5777f5ca5d43661be2751d2ee1955a871c79ea -rc234c64ad9ff9d713f6d8e3331d0c20075e49303 --- lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java (.../HomeAction.java) (revision 0e5777f5ca5d43661be2751d2ee1955a871c79ea) +++ lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java (.../HomeAction.java) (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303) @@ -24,6 +24,7 @@ package org.lamsfoundation.lams.web; import java.io.IOException; +import java.net.URLEncoder; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -49,14 +50,11 @@ import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; - /** - * this is an action where all lams client environments launch. - * initial configuration of the individual environment setting is done here. + * this is an action where all lams client environments launch. initial + * configuration of the individual environment setting is done here. * - * @struts:action path="/home" - * validate="false" - * parameter="method" + * @struts:action path="/home" validate="false" parameter="method" * @struts:action-forward name="sysadmin" path="/sysadmin.jsp" * @struts:action-forward name="learner" path="/learner.jsp" * @struts:action-forward name="author" path="/author.jsp" @@ -66,260 +64,278 @@ * @struts:action-forward name="message" path=".message" * @struts:action-forward name="passwordChange" path=".passwordChange" * @struts:action-forward name="index" path="/index.jsp" - * + * */ public class HomeAction extends DispatchAction { - - private static Logger log = Logger.getLogger(HomeAction.class); - - private static IUserManagementService service; - private static ILessonService lessonService; - - private IUserManagementService getService(){ - if(service==null){ - WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext()); - service = (IUserManagementService) ctx.getBean("userManagementService"); - } - return service; + + private static Logger log = Logger.getLogger(HomeAction.class); + + private static IUserManagementService service; + private static ILessonService lessonService; + + private IUserManagementService getService() { + if (service == null) { + WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + service = (IUserManagementService) ctx.getBean("userManagementService"); } + return service; + } - private ILessonService getLessonService(){ - if(lessonService==null){ - WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext()); - lessonService = (ILessonService) ctx.getBean("lessonService"); - } - return lessonService; + private ILessonService getLessonService() { + if (lessonService == null) { + WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + lessonService = (ILessonService) ctx.getBean("lessonService"); } + return lessonService; + } - private UserDTO getUser() { - HttpSession ss = SessionManager.getSession(); - return (UserDTO) ss.getAttribute(AttributeNames.USER); + private UserDTO getUser() { + HttpSession ss = SessionManager.getSession(); + return (UserDTO) ss.getAttribute(AttributeNames.USER); + } + + private User getRealUser(UserDTO dto) { + return getService().getUserByLogin(dto.getLogin()); + } + + /** + * request for sysadmin environment + */ + public ActionForward sysadmin(ActionMapping mapping, ActionForm form, HttpServletRequest req, + HttpServletResponse res) throws IOException, ServletException { + + try { + log.debug("request sysadmin"); + int orgId = new Integer(req.getParameter("orgId")).intValue(); + UserDTO user = getUser(); + if (user == null) { + log.error("admin: User missing from session. "); + return mapping.findForward("error"); + } else if (getService().isUserInRole(user.getUserID(), orgId, Role.SYSADMIN)) { + log.debug("user is sysadmin"); + return mapping.findForward("sysadmin"); + } else { + log.error("User " + user.getLogin() + + " tried to get sysadmin screen but isn't sysadmin in organisation: " + orgId); + return displayMessage(mapping, req, "error.authorisation"); + } + + } catch (Exception e) { + log.error("Failed to load sysadmin", e); + return mapping.findForward("error"); } - - private User getRealUser(UserDTO dto) { - return getService().getUserByLogin(dto.getLogin()); - } + } - /** - * request for sysadmin environment - */ - public ActionForward sysadmin(ActionMapping mapping, ActionForm form, - HttpServletRequest req, HttpServletResponse res) - throws IOException, ServletException { + /** + * request for learner environment + */ + public ActionForward learner(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) + throws IOException, ServletException { - try { - log.debug("request sysadmin"); - int orgId = new Integer(req.getParameter("orgId")).intValue(); - UserDTO user = getUser(); - if ( user == null ) { - log.error("admin: User missing from session. "); - return mapping.findForward("error"); - } else if ( getService().isUserInRole(user.getUserID(),orgId,Role.SYSADMIN)) { - log.debug("user is sysadmin"); - return mapping.findForward("sysadmin"); - } else { - log.error("User "+user.getLogin()+" tried to get sysadmin screen but isn't sysadmin in organisation: "+orgId); - return displayMessage(mapping, req, "error.authorisation"); - } - - } catch (Exception e) { - log.error("Failed to load sysadmin",e); - return mapping.findForward("error"); + try { + log.debug("request learner"); + + Long lessonId = WebUtil.readLongParam(req, AttributeNames.PARAM_LESSON_ID); + String mode = WebUtil.readStrParam(req, AttributeNames.PARAM_MODE, true); + + UserDTO user = getUser(); + if (user == null) { + log.error("learner: User missing from session. "); + return mapping.findForward("error"); + } else { + Lesson lesson = lessonId != null ? getLessonService().getLesson(lessonId) : null; + if (lesson == null || !lesson.isLessonStarted()) { + return displayMessage(mapping, req, "message.lesson.not.started.cannot.participate"); } - } - - /** - * request for learner environment - */ - public ActionForward learner(ActionMapping mapping, ActionForm form, - HttpServletRequest req, HttpServletResponse res) - throws IOException, ServletException { - try { - log.debug("request learner"); - - Long lessonId = WebUtil.readLongParam(req, AttributeNames.PARAM_LESSON_ID); - String mode = WebUtil.readStrParam(req, AttributeNames.PARAM_MODE, true); - - UserDTO user = getUser(); - if ( user == null ) { - log.error("learner: User missing from session. "); - return mapping.findForward("error"); - } else { - Lesson lesson = lessonId != null ? getLessonService().getLesson(lessonId) : null; - if ( lesson == null || ! lesson.isLessonStarted()) { - return displayMessage(mapping, req, "message.lesson.not.started.cannot.participate"); - } - - if ( lesson.getLessonClass() == null || ! lesson.getLessonClass().getLearners().contains(getRealUser(user)) ) { - log.error("learner: User "+user.getLogin()+" is not a learner in the requested lesson. Cannot access the lesson."); - return displayMessage(mapping, req, "error.authorisation"); - } - - if(mode != null) - req.setAttribute(AttributeNames.PARAM_MODE, mode); - - req.setAttribute(AttributeNames.PARAM_EXPORT_PORTFOLIO_ENABLED, lesson.getLearnerExportAvailable() != null ? lesson.getLearnerExportAvailable(): Boolean.TRUE); - req.setAttribute(AttributeNames.PARAM_PRESENCE_ENABLED, lesson.getLearnerPresenceAvailable()); - req.setAttribute(AttributeNames.PARAM_PRESENCE_IM_ENABLED, lesson.getLearnerImAvailable()); - req.setAttribute(AttributeNames.PARAM_TITLE, lesson.getLessonName()); - req.setAttribute(AttributeNames.PARAM_CREATE_DATE_TIME, lesson.getCreateDateTime()); - String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL); - req.setAttribute("serverUrl", serverUrl); - String presenceUrl = Configuration.get(ConfigurationKeys.XMPP_DOMAIN); - req.setAttribute("presenceUrl", presenceUrl); - req.setAttribute(AttributeNames.PARAM_LESSON_ID,lessonId); - return mapping.findForward("learner"); - } - - } catch (Exception e) { - log.error("Failed to load learner",e); - return mapping.findForward("error"); + if (lesson.getLessonClass() == null + || !lesson.getLessonClass().getLearners().contains(getRealUser(user))) { + log.error("learner: User " + user.getLogin() + + " is not a learner in the requested lesson. Cannot access the lesson."); + return displayMessage(mapping, req, "error.authorisation"); } + + if (mode != null) + req.setAttribute(AttributeNames.PARAM_MODE, mode); + + req.setAttribute(AttributeNames.PARAM_EXPORT_PORTFOLIO_ENABLED, + lesson.getLearnerExportAvailable() != null ? lesson.getLearnerExportAvailable() : Boolean.TRUE); + req.setAttribute(AttributeNames.PARAM_PRESENCE_ENABLED, lesson.getLearnerPresenceAvailable()); + req.setAttribute(AttributeNames.PARAM_PRESENCE_IM_ENABLED, lesson.getLearnerImAvailable()); + req.setAttribute(AttributeNames.PARAM_TITLE, lesson.getLessonName()); + req.setAttribute(AttributeNames.PARAM_CREATE_DATE_TIME, lesson.getCreateDateTime()); + String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL); + req.setAttribute("serverUrl", serverUrl); + String presenceUrl = Configuration.get(ConfigurationKeys.XMPP_DOMAIN); + req.setAttribute("presenceUrl", presenceUrl); + req.setAttribute(AttributeNames.PARAM_LESSON_ID, lessonId); + return mapping.findForward("learner"); + } + + } catch (Exception e) { + log.error("Failed to load learner", e); + return mapping.findForward("error"); } - - - /** - * request for author environment - */ - public ActionForward author(ActionMapping mapping, ActionForm form, - HttpServletRequest req, HttpServletResponse res) - throws IOException, ServletException { + } - try { - log.debug("request author"); - UserDTO user = getUser(); - if ( user == null ) { - log.error("admin: User missing from session. "); - return mapping.findForward("error"); - } else { - Long learningDesignID = null; - String layout = null; - String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL); - req.setAttribute("serverUrl", serverUrl); - - String requestSrc = req.getParameter("requestSrc"); - String notifyCloseURL = req.getParameter("notifyCloseURL"); - String customCSV = req.getParameter(AttributeNames.PARAM_CUSTOM_CSV); - String extLmsId = req.getParameter(AttributeNames.PARAM_EXT_LMS_ID); - - if(req.getParameter("learningDesignID") != null) - learningDesignID = WebUtil.readLongParam(req, "learningDesignID"); - - if(req.getParameter("layout") != null) - layout = WebUtil.readStrParam(req, "layout"); - - if(layout != null) - req.setAttribute("layout", layout); - - if(req.getParameter("learningDesignID") != null) - learningDesignID = WebUtil.readLongParam(req, "learningDesignID"); - - if(learningDesignID != null) - req.setAttribute("learningDesignID", learningDesignID); - - req.setAttribute("requestSrc", requestSrc); - req.setAttribute("notifyCloseURL", notifyCloseURL); - req.setAttribute(AttributeNames.PARAM_CUSTOM_CSV, customCSV); - req.setAttribute(AttributeNames.PARAM_EXT_LMS_ID, extLmsId); - - return mapping.findForward("author"); - } - - } catch (Exception e) { - log.error("Failed to load author",e); - return mapping.findForward("error"); + /** + * request for author environment + */ + public ActionForward author(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) + throws IOException, ServletException { + + try { + log.debug("request author"); + UserDTO user = getUser(); + if (user == null) { + log.error("admin: User missing from session. "); + return mapping.findForward("error"); + } else { + Long learningDesignID = null; + String layout = null; + String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL); + req.setAttribute("serverUrl", serverUrl); + + String requestSrc = req.getParameter("requestSrc"); + String notifyCloseURL = req.getParameter("notifyCloseURL"); + String customCSV = req.getParameter(AttributeNames.PARAM_CUSTOM_CSV); + String extLmsId = req.getParameter(AttributeNames.PARAM_EXT_LMS_ID); + + if (req.getParameter("learningDesignID") != null) + learningDesignID = WebUtil.readLongParam(req, "learningDesignID"); + + if (req.getParameter("layout") != null) + layout = WebUtil.readStrParam(req, "layout"); + + if (layout != null) + req.setAttribute("layout", layout); + + if (req.getParameter("learningDesignID") != null) + learningDesignID = WebUtil.readLongParam(req, "learningDesignID"); + + if (learningDesignID != null) + req.setAttribute("learningDesignID", learningDesignID); + + req.setAttribute("requestSrc", requestSrc); + req.setAttribute("notifyCloseURL", notifyCloseURL); + req.setAttribute(AttributeNames.PARAM_CUSTOM_CSV, customCSV); + req.setAttribute(AttributeNames.PARAM_EXT_LMS_ID, extLmsId); + + return mapping.findForward("author"); + } + + } catch (Exception e) { + log.error("Failed to load author", e); + return mapping.findForward("error"); + } + } + + /** + * request for monitor environment + */ + public ActionForward monitorLesson(ActionMapping mapping, ActionForm form, HttpServletRequest req, + HttpServletResponse res) throws IOException, ServletException { + + try { + log.debug("request monitorLesson"); + Long lessonId = WebUtil.readLongParam(req, AttributeNames.PARAM_LESSON_ID); + UserDTO user = getUser(); + if (user == null) { + log.error("admin: User missing from session. "); + return mapping.findForward("error"); + } else { + Lesson lesson = lessonId != null ? getLessonService().getLesson(lessonId) : null; + if (lesson == null) { + log.error("monitorLesson: Lesson " + lessonId + " does not exist. Unable to monitor lesson"); + return mapping.findForward("error"); } + + if (lesson.getLessonClass() == null || !lesson.getLessonClass().isStaffMember(getRealUser(user))) { + log.error("learner: User " + user.getLogin() + + " is not a learner in the requested lesson. Cannot access the lesson."); + return displayMessage(mapping, req, "error.authorisation"); + } + + log.debug("user is staff"); + String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL); + req.setAttribute("serverUrl", serverUrl); + req.setAttribute(AttributeNames.PARAM_LESSON_ID, lessonId); + return mapping.findForward("monitorLesson"); + } + } catch (Exception e) { + log.error("Failed to load monitor lesson", e); + return mapping.findForward("error"); } - - - /** - * request for monitor environment - */ - public ActionForward monitorLesson(ActionMapping mapping, ActionForm form, - HttpServletRequest req, HttpServletResponse res) - throws IOException, ServletException { + } - try { - log.debug("request monitorLesson"); - Long lessonId = WebUtil.readLongParam(req, AttributeNames.PARAM_LESSON_ID); - UserDTO user = getUser(); - if ( user == null ) { - log.error("admin: User missing from session. "); - return mapping.findForward("error"); - } else { - Lesson lesson = lessonId != null ? getLessonService().getLesson(lessonId) : null; - if ( lesson == null ) { - log.error("monitorLesson: Lesson "+lessonId+" does not exist. Unable to monitor lesson"); - return mapping.findForward("error"); - } - - if ( lesson.getLessonClass() == null || ! lesson.getLessonClass().isStaffMember(getRealUser(user)) ) { - log.error("learner: User "+user.getLogin()+" is not a learner in the requested lesson. Cannot access the lesson."); - return displayMessage(mapping, req, "error.authorisation"); - } + /** + * request for add lesson wizard + */ + public ActionForward addLesson(ActionMapping mapping, ActionForm form, HttpServletRequest req, + HttpServletResponse res) throws IOException, ServletException { - log.debug("user is staff"); - String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL); - req.setAttribute("serverUrl", serverUrl); - req.setAttribute(AttributeNames.PARAM_LESSON_ID, lessonId); - return mapping.findForward("monitorLesson"); - } - } catch (Exception e) { - log.error("Failed to load monitor lesson",e); - return mapping.findForward("error"); + try { + log.debug("request addLesson"); + Integer courseId = WebUtil.readIntParam(req, AttributeNames.PARAM_COURSE_ID, false); + Integer classId = WebUtil.readIntParam(req, AttributeNames.PARAM_CLASS_ID, true); + UserDTO user = getUser(); + if (user == null) { + log.error("admin: User missing from session. "); + return mapping.findForward("error"); + } else { + Integer orgId = classId != null ? classId : courseId; + if (getService().isUserInRole(user.getUserID(), orgId, Role.MONITOR) + || getService().isUserInRole(user.getUserID(), orgId, Role.GROUP_MANAGER)) { + log.debug("user is staff"); + String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL); + req.setAttribute("serverUrl", serverUrl); + req.setAttribute(AttributeNames.PARAM_COURSE_ID, courseId); + req.setAttribute(AttributeNames.PARAM_CLASS_ID, classId); + return mapping.findForward("addLesson"); + } else { + log.error("User " + user.getLogin() + + " tried to get staff screen but isn't staff in organisation: " + orgId); + return displayMessage(mapping, req, "error.authorisation"); } + } + + } catch (Exception e) { + log.error("Failed to load add lesson", e); + return mapping.findForward("error"); } + } - /** - * request for add lesson wizard - */ - public ActionForward addLesson(ActionMapping mapping, ActionForm form, - HttpServletRequest req, HttpServletResponse res) - throws IOException, ServletException { + public ActionForward logout(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) + throws IOException, ServletException { - try { - log.debug("request addLesson"); - Integer courseId = WebUtil.readIntParam(req, AttributeNames.PARAM_COURSE_ID, false); - Integer classId = WebUtil.readIntParam(req, AttributeNames.PARAM_CLASS_ID, true); - UserDTO user = getUser(); - if ( user == null ) { - log.error("admin: User missing from session. "); - return mapping.findForward("error"); - } else { - Integer orgId = classId != null ? classId : courseId; - if (getService().isUserInRole(user.getUserID(), orgId, Role.MONITOR)||getService().isUserInRole(user.getUserID(), orgId, Role.GROUP_MANAGER)) { - log.debug("user is staff"); - String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL); - req.setAttribute("serverUrl", serverUrl); - req.setAttribute(AttributeNames.PARAM_COURSE_ID, courseId); - req.setAttribute(AttributeNames.PARAM_CLASS_ID, classId); - return mapping.findForward("addLesson"); - } else { - log.error("User "+ user.getLogin() + " tried to get staff screen but isn't staff in organisation: " + orgId); - return displayMessage(mapping, req, "error.authorisation"); - } - } + UserDTO userDTO = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); + if (userDTO.getLoggedIntoLamsCommunity() != null && userDTO.getLoggedIntoLamsCommunity()) { + log.debug("Need to log out user from lamscoomunity"); + req.getSession().invalidate(); - } catch (Exception e) { - log.error("Failed to load add lesson",e); - return mapping.findForward("error"); - } + //clear system shared session. + SessionManager.getSession().invalidate(); + + // redirect to lamscommunity logout servlet to log out. + String url = "http://lamscommunity.org/register/logout?return_url="; + url += URLEncoder.encode(Configuration.get(ConfigurationKeys.SERVER_URL), "UTF8"); + res.sendRedirect(url); + return null; + + } else { + req.getSession().invalidate(); + + //clear system shared session. + SessionManager.getSession().invalidate(); + + return mapping.findForward("index"); } - - public ActionForward logout(ActionMapping mapping, ActionForm form, - HttpServletRequest req, HttpServletResponse res) - throws IOException, ServletException { - req.getSession().invalidate(); - - //clear system shared session. - SessionManager.getSession().invalidate(); - - return mapping.findForward("index"); - } - - private ActionForward displayMessage(ActionMapping mapping, HttpServletRequest req, String messageKey) { - req.setAttribute("messageKey", messageKey); - return mapping.findForward("message"); - } + } + + private ActionForward displayMessage(ActionMapping mapping, HttpServletRequest req, String messageKey) { + req.setAttribute("messageKey", messageKey); + return mapping.findForward("message"); + } } \ No newline at end of file Index: lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java =================================================================== diff -u -rda2924f4d15aa5587ed5e5dc7152b850994bdd87 -rc234c64ad9ff9d713f6d8e3331d0c20075e49303 --- lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java (.../IndexAction.java) (revision da2924f4d15aa5587ed5e5dc7152b850994bdd87) +++ lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java (.../IndexAction.java) (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303) @@ -35,6 +35,7 @@ import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.authoring.service.IAuthoringService; +import org.lamsfoundation.lams.config.Registration; import org.lamsfoundation.lams.index.IndexLinkBean; import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; import org.lamsfoundation.lams.usermanagement.Role; @@ -70,13 +71,15 @@ * @struts.action-forward name="passwordChanged" path=".passwordChangeOk" * @struts.action-forward name="portrait" path="/portrait.do" * @struts.action-forward name="lessons" path="/profile.do?method=lessons" + * @struts.action-forward name="planner" path="/pedagogicalPlanner.do" */ public class IndexAction extends Action { private static Logger log = Logger.getLogger(IndexAction.class); private static IUserManagementService userManagementService; private static IExportToolContentService exportService; private static IAuthoringService authoringService; + private static Configuration configurationService; @Override @SuppressWarnings("unchecked") @@ -125,6 +128,11 @@ } } + Registration reg = Configuration.getRegistration(); + if (reg != null) { + request.setAttribute("lamsCommunityEnabled", reg.isEnableLamsCommunityIntegration()); + } + List collapsedOrgDTOs = getUserManagementService().getActiveCourseIdsByUser(loggedInUser.getUserId(), request.isUserInRole(Role.SYSADMIN)); request.setAttribute("collapsedOrgDTOs", collapsedOrgDTOs); @@ -135,7 +143,7 @@ private void setHeaderLinks(HttpServletRequest request) { List headerLinks = new ArrayList(); if (request.isUserInRole(Role.AUTHOR) || request.isUserInRole(Role.AUTHOR_ADMIN)) { - headerLinks.add(new IndexLinkBean("index.planner", "javascript:openPedagogicalPlanner()")); + headerLinks.add(new IndexLinkBean("index.planner", "index.do?tab=planner")); headerLinks.add(new IndexLinkBean("index.author", "javascript:openAuthor()")); } headerLinks.add(new IndexLinkBean("index.myprofile", "index.do?tab=profile")); Index: lams_central/src/java/org/lamsfoundation/lams/web/ProfileAction.java =================================================================== diff -u -r28714e3b97f1fb2e59a38b321392b52d37e1ba75 -rc234c64ad9ff9d713f6d8e3331d0c20075e49303 --- lams_central/src/java/org/lamsfoundation/lams/web/ProfileAction.java (.../ProfileAction.java) (revision 28714e3b97f1fb2e59a38b321392b52d37e1ba75) +++ lams_central/src/java/org/lamsfoundation/lams/web/ProfileAction.java (.../ProfileAction.java) (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303) @@ -198,6 +198,10 @@ userForm.set("localeId", locale.getLocaleId()); request.setAttribute("locales", locales); request.setAttribute("tab", "profile"); + + boolean hasLamsCommunityToken = requestor.getLamsCommunityToken() != null; + request.setAttribute("hasLamsCommunityToken", hasLamsCommunityToken); + return mapping.findForward("edit"); } Index: lams_central/src/java/org/lamsfoundation/lams/web/ProfileSaveAction.java =================================================================== diff -u -re8b36154a45b860969f911aa3abb4f2710e933f9 -rc234c64ad9ff9d713f6d8e3331d0c20075e49303 --- lams_central/src/java/org/lamsfoundation/lams/web/ProfileSaveAction.java (.../ProfileSaveAction.java) (revision e8b36154a45b860969f911aa3abb4f2710e933f9) +++ lams_central/src/java/org/lamsfoundation/lams/web/ProfileSaveAction.java (.../ProfileSaveAction.java) (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303) @@ -40,6 +40,7 @@ import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; import org.apache.struts.action.DynaActionForm; +import org.hibernate.Hibernate; import org.lamsfoundation.lams.usermanagement.SupportedLocale; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; @@ -113,6 +114,13 @@ SupportedLocale locale = (SupportedLocale) getService().findById(SupportedLocale.class, (Integer) userForm.get("localeId")); requestor.setLocale(locale); + + if (userForm.get("disableLamsCommunityUsername") != null + && (Boolean) userForm.get("disableLamsCommunityUsername")) { + requestor.setLamsCommunityToken(null); + requestor.setLamsCommunityUsername(null); + } + getService().save(requestor); log.debug("profile edited: " + requestor); Index: lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityLoginAction.java =================================================================== diff -u --- lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityLoginAction.java (revision 0) +++ lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityLoginAction.java (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303) @@ -0,0 +1,266 @@ +/**************************************************************** + * Copyright (C) 2008 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.web.lamscommunity; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URLEncoder; +import java.util.Date; +import java.util.HashMap; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.lamsfoundation.lams.config.Registration; +import org.lamsfoundation.lams.usermanagement.User; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; +import org.lamsfoundation.lams.util.Configuration; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * Action to login to lamscommunity when the user reaches the main page + * + * Steps: + * + * 1) If the user has previously logged in and has a lamscommunity login token + * saved, then it will immediately log them in through the lamscommunity sso + * servlet, otherwise it will take them to a authentication page where the user + * will enter their lamscommunity username and password + * + * 2) Once the username and password has been entered, a request will be sent to + * lams community with the username/password which lams community will + * authenticate and return a valid user token for this user, which can be used + * to login as in step one for thence forward. + * + * + * @author lfoxton + * + * @struts.action name="lamsCommunityLoginForm" path="/lamsCommunityLogin" + * scope="request" validate="false" parameter="dispatch" + * + * @struts.action-forward name="lamsCommunityLogin" + * path="/lamscommunity/lamscommunityLogin.jsp" + * + */ +public class LamsCommunityLoginAction extends LamsDispatchAction { + + private IUserManagementService service; + + private static final String ATTR_ERROR_MESSAGE = "errorMessage"; + private static final String ATTR_LC_USERNAME = "lcUsername"; + + /** + * Default action response + * Checks whether the user has a lamscommunity token, if so logs them in + * immediately, otherwise forward to lamsCommunityLogin.jsp that + * prompts for login and password + */ + public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + + User user = getUser(request); + if (user.getLamsCommunityToken() == null || user.getLamsCommunityToken().equals("")) { + // Authenticate the user manually + return mapping.findForward("lamsCommunityLogin"); + } else { + // log the user into lamscommunity directly using the user token + loginToLamsCommunity(mapping, form, request, response); + } + + return null; + } + + public ActionForward getLCUserLogin(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + return mapping.findForward("lamsCommunityLogin"); + } + + /** + * Authenticates the user with lamscommunity + * If the username/password is successfull a user token from the lams + * community is saved for the user which will be used henceforth to do the + * login request. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws Exception + */ + public ActionForward authenticate(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + + LamsCommunityLoginForm loginForm = (LamsCommunityLoginForm) form; + + //configurationService = getConfiguration(); + Registration reg = Configuration.getRegistration(); + + String responseString = null; + if(reg != null && reg.getServerID() != null && reg.getServerKey() != null) + { + responseString = lamsCommunityAuth(loginForm.getLcUserName(), loginForm.getLcPassword(), reg.getServerID(), reg.getServerKey()); + } + else + { + throw new Exception("Attempt to authenticate in lams community without registration"); + } + + if (responseString != null) { + String[] result = responseString.split(","); + if (result[0].equals("success")) { + // Save the lams community user token to the user table + User user = getUser(request); + user.setLamsCommunityUsername(loginForm.getLcUserName()); + user.setLamsCommunityToken(result[1]); + getService().save(user); + + // then login + return loginToLamsCommunity(mapping, form, request, response); + } else { + if (result.length == 2) { + // login failed known reason + request.setAttribute(ATTR_ERROR_MESSAGE, result[1]); + } else { + // login failed unknown reason + request.setAttribute(ATTR_ERROR_MESSAGE, "lamscommunity.login.failed"); + } + return mapping.findForward("lamsCommunityLogin"); + } + } else { + // login failed, did not recieve response from lamscommunity + request.setAttribute(ATTR_ERROR_MESSAGE, "lamscommunity.no.result"); + return mapping.findForward("lamsCommunityLogin"); + } + } + + /** + * Handles the call to lamscommunity to authenticate the user + * An encrypted message is sent to the lamscommunity with the user's + * credetials and lamscommunity returns a token if the authentication was + * successful + * + * @param userName + * @param lcPassword + * @param serverID + * @param serverKey + * @return + * @throws Exception + */ + public String lamsCommunityAuth(String userName, String lcPassword, String serverID, String serverKey) throws Exception { + + String timestamp = "" + new Date().getTime(); + + // encrypt the user data + String encryption = LamsCommunityUtil.encryptAuthenticationInfo(timestamp, userName, lcPassword, serverID, serverKey); + + // Create the requst parameters + HashMap params = new HashMap(); + params.put(LamsCommunityUtil.PARAM_HASH, URLEncoder.encode(encryption, "UTF8")); + params.put(LamsCommunityUtil.PARAM_SERVER_ID, URLEncoder.encode(serverID, "UTF8")); + + // send the request to lamscommunity + InputStream is = WebUtil.getResponseInputStreamFromExternalServer(LamsCommunityUtil.LAMS_COMMUNITY_AUTH_URL, params); + BufferedReader isReader = new BufferedReader(new InputStreamReader(is)); + String str = isReader.readLine(); + return str; + } + + /** + * Logs the user into lams community directly using the user token which + * was saved in the authentication action + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws Exception + */ + public ActionForward loginToLamsCommunity(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + + User user = getUser(request); + + // check that the server is registered with lamscommunity + Registration reg = Configuration.getRegistration(); + String serverID; + String serverKey; + if(reg != null && reg.getServerID() != null && reg.getServerKey() != null) + { + serverID = reg.getServerID(); + serverKey = reg.getServerKey(); + } + else + { + throw new Exception("Attempt to authenticate in lams community without registration"); + } + + // Update the user session, set the logged into lamscommunity flag + UserDTO userDTO = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); + userDTO.setLoggedIntoLamsCommunity(true); + HttpSession sharedsession = SessionManager.getSession(); + sharedsession.setAttribute(AttributeNames.USER, userDTO); + + + String timestamp = "" + new Date().getTime(); + String hash = LamsCommunityUtil.createAuthenticationHash(timestamp, user.getLamsCommunityUsername(), user.getLamsCommunityToken(), serverID, serverKey); + + // Refirect the user to the lamscommunity sso url + String url = LamsCommunityUtil.LAMS_COMMUNITY_SSO_URL + "?"; + url += LamsCommunityUtil.PARAM_LC_USERNAME + "=" + URLEncoder.encode(user.getLamsCommunityUsername(), "UTF8"); + url += "&" + LamsCommunityUtil.PARAM_HASH + "=" + hash; + url += "&" + LamsCommunityUtil.PARAM_SERVER_ID + "=" + serverID; + url += "&" + LamsCommunityUtil.PARAM_TIMESTAMP + "=" + timestamp; + + log.debug("Redirecting to lamscommunity url: " + url); + + response.sendRedirect(url); + return null; + } + + private User getUser(HttpServletRequest request) { + return (User) getService().getUserByLogin(request.getRemoteUser()); + } + + private IUserManagementService getService() { + if (service == null) { + WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + service = (IUserManagementService) ctx.getBean("userManagementService"); + } + return service; + } +} Index: lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityLoginForm.java =================================================================== diff -u --- lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityLoginForm.java (revision 0) +++ lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityLoginForm.java (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303) @@ -0,0 +1,77 @@ +/**************************************************************** + * Copyright (C) 2008 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.web.lamscommunity; + +import org.apache.struts.action.ActionForm; + +/** + * + * @author lfoxton + * + * @struts.form name="lamsCommunityLoginForm" include-pk="true" include-all="true" + */ +public class LamsCommunityLoginForm extends ActionForm { + + public static final long serialVersionUID = 82738272773582375L; + + public String lcUserName; + public String lcPassword; + public String lcConfirmPassword; + public String dispatch; + + public LamsCommunityLoginForm() {} + + public String getLcUserName() { + return lcUserName; + } + + public void setLcUserName(String lcUserName) { + this.lcUserName = lcUserName; + } + + public String getLcPassword() { + return lcPassword; + } + + public void setLcPassword(String lcPassword) { + this.lcPassword = lcPassword; + } + + public String getDispatch() { + return dispatch; + } + + public void setDispatch(String dispatch) { + this.dispatch = dispatch; + } + + public String getLcConfirmPassword() { + return lcConfirmPassword; + } + + public void setLcConfirmPassword(String lcConfirmPassword) { + this.lcConfirmPassword = lcConfirmPassword; + } +} + \ No newline at end of file Index: lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityUtil.java =================================================================== diff -u --- lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityUtil.java (revision 0) +++ lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityUtil.java (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303) @@ -0,0 +1,99 @@ +/**************************************************************** + * Copyright (C) 2008 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.web.lamscommunity; + +import java.net.URLEncoder; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import org.lamsfoundation.lams.util.HashUtil; + +import sun.misc.BASE64Decoder; +import sun.misc.BASE64Encoder; + +public class LamsCommunityUtil { + + + public static final String LAMS_COMMUNITY_URL = "http://lamscommunity.org"; + public static final String LAMS_COMMUNITY_SSO_URL = "http://lamscommunity.org/lams/x/sso"; + public static final String LAMS_COMMUNITY_AUTH_URL = "http://lamscommunity.org/lams/x/auth"; + + + + public static final String PARAM_HASH = "hs"; + public static final String PARAM_SERVER_ID = "sid"; + public static final String PARAM_TIMESTAMP = "ts"; + public static final String PARAM_LC_USERNAME = "un"; + public static final String PARAM_LC_PASSWORD = "ps"; + public static final String PARAM_LC_USER_TOKEN = "tk"; + + + public static String createAuthenticationHash(String timestamp, String username, String password, String serverId, String serverKey) { + String hash = ""; + if (serverId != null && serverKey != null) { + hash = hash(timestamp + username + serverId + password + serverKey); + } + return hash; + } + + public static String hash(String string) + { + return HashUtil.sha1(string); + } + + public static String encryptAuthenticationInfo(String timestamp, String username, String password, String serverId, + String serverKey) throws Exception{ + String hash = ""; + if (serverId != null && serverKey != null) { + hash = encrypt(timestamp +","+ username +","+ URLEncoder.encode(password, "UTF8"), serverKey); + } + return hash; + } + + public static String encrypt(String text, String password) throws Exception{ + + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + + //setup key + byte[] keyBytes = new byte[16]; + byte[] b = password.getBytes("UTF-8"); + int len = b.length; + if (len > keyBytes.length) + len = keyBytes.length; + System.arraycopy(b, 0, keyBytes, 0, len); + + SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES"); + + //the below may make this less secure, hard code byte array the IV in both java and .net clients + IvParameterSpec ivSpec = new IvParameterSpec(keyBytes); + + cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec); + byte[] results = cipher.doFinal(text.getBytes("UTF-8")); + BASE64Encoder encoder = new BASE64Encoder(); + return encoder.encode(results); + } + + +} Index: lams_central/web/editprofile.jsp =================================================================== diff -u -r472bcb813040efc160e074021be5c71c15455f00 -rc234c64ad9ff9d713f6d8e3331d0c20075e49303 --- lams_central/web/editprofile.jsp (.../editprofile.jsp) (revision 472bcb813040efc160e074021be5c71c15455f00) +++ lams_central/web/editprofile.jsp (.../editprofile.jsp) (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303) @@ -30,11 +30,13 @@ <%= AuthenticationMethod.DB %> + + - : - + : + : @@ -125,9 +127,20 @@ - + + + + + + + : + + + + + - +
Index: lams_central/web/includes/javascript/jquery.validate.pack.js =================================================================== diff -u --- lams_central/web/includes/javascript/jquery.validate.pack.js (revision 0) +++ lams_central/web/includes/javascript/jquery.validate.pack.js (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303) @@ -0,0 +1,15 @@ +/* + * jQuery validation plug-in 1.5.1 + * + * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ + * http://docs.jquery.com/Plugins/Validation + * + * Copyright (c) 2006 - 2008 Jörn Zaefferer + * + * $Id$ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(7($){$.G($.38,{1z:7(c){l(!6.E){c&&c.21&&2U.1v&&1v.4Y("3p 2B, 4A\'t 1z, 6c 3p");8}p b=$.15(6[0],\'u\');l(b){8 b}b=2l $.u(c,6[0]);$.15(6[0],\'u\',b);l(b.q.3v){6.4I("1Y, 4D").1o(".4w").4q(7(){b.35=v});6.31(7(a){l(b.q.21)a.5V();7 2g(){l(b.q.40){b.q.40.12(b,b.W);8 H}8 v}l(b.35){b.35=H;8 2g()}l(b.L()){l(b.19){b.1u=v;8 H}8 2g()}1a{b.2o();8 H}})}8 b},N:7(){l($(6[0]).2J(\'L\')){8 6.1z().L()}1a{p b=H;p a=$(6[0].L).1z();6.O(7(){b|=a.I(6)});8 b}},4K:7(c){p d={},$I=6;$.O(c.1K(/\\s/),7(a,b){d[b]=$I.1J(b);$I.4G(b)});8 d},17:7(h,k){p f=6[0];l(h){p i=$.15(f.L,\'u\').q;p d=i.17;p c=$.u.2t(f);2p(h){1b"1f":$.G(c,$.u.1U(k));d[f.r]=c;l(k.J)i.J[f.r]=$.G(i.J[f.r],k.J);2u;1b"63":l(!k){Q d[f.r];8 c}p e={};$.O(k.1K(/\\s/),7(a,b){e[b]=c[b];Q c[b]});8 e}}p g=$.u.49($.G({},$.u.44(f),$.u.43(f),$.u.3G(f),$.u.2t(f)),f);l(g.11){p j=g.11;Q g.11;g=$.G({11:j},g)}8 g}});$.G($.5A[":"],{5w:7(a){8!$.1j(a.T)},5o:7(a){8!!$.1j(a.T)},5m:7(a){8!a.3P}});$.1d=7(c,b){l(S.E==1)8 7(){p a=$.3K(S);a.5a(c);8 $.1d.1Q(6,a)};l(S.E>2&&b.2i!=3F){b=$.3K(S).4U(1)}l(b.2i!=3F){b=[b]}$.O(b,7(i,n){c=c.3B(2l 3z("\\\\{"+i+"\\\\}","g"),n)});8 c};$.u=7(b,a){6.q=$.G({},$.u.2I,b);6.W=a;6.3w()};$.G($.u,{2I:{J:{},1Z:{},17:{},1c:"3s",2G:"4J",2o:v,3m:$([]),2D:$([]),3v:v,3l:[],3k:H,4H:7(a){6.3i=a;l(6.q.4F&&!6.4E){6.q.1I&&6.q.1I.12(6,a,6.q.1c);6.1P(a).2x()}},4C:7(a){l(!6.1x(a)&&(a.r Z 6.1k||!6.F(a))){6.I(a)}},4v:7(a){l(a.r Z 6.1k||a==6.39){6.I(a)}},4t:7(a){l(a.r Z 6.1k)6.I(a)},2r:7(a,b){$(a).2q(b)},1I:7(a,b){$(a).37(b)}},6i:7(a){$.G($.u.2I,a)},J:{11:"6f 4o 2J 11.",1S:"K 33 6 4o.",1T:"K M a N 1T 6a.",1w:"K M a N 65.",1m:"K M a N 1m.",1W:"K M a N 1m (61).",2j:"4d 4c 3n 2Y 5U�5R 5Q 2Y.",1s:"K M a N 1s.",24:"4d 4c 3n 5O 5L 2Y.",1N:"K M 5J 1N",2e:"K M a N 5F 5D 1s.",3Y:"K M 3W 5y T 5v.",3U:"K M a T 5s a N 5r.",16:$.1d("K M 3R 5n 2P {0} 2O."),1D:$.1d("K M 5l 5k {0} 2O."),2b:$.1d("K M a T 3N {0} 3M {1} 2O 5f."),2a:$.1d("K M a T 3N {0} 3M {1}."),1t:$.1d("K M a T 5b 2P 3J 3I 4a {0}."),1y:$.1d("K M a T 55 2P 3J 3I 4a {0}.")},3H:H,53:{3w:7(){6.2k=$(6.q.2D);6.4g=6.2k.E&&6.2k||$(6.W);6.26=$(6.q.3m).1f(6.q.2D);6.1k={};6.4V={};6.19=0;6.1e={};6.1g={};6.1V();p f=(6.1Z={});$.O(6.q.1Z,7(d,c){$.O(c.1K(/\\s/),7(a,b){f[b]=d})});p e=6.q.17;$.O(e,7(b,a){e[b]=$.u.1U(a)});7 1C(a){p b=$.15(6[0].L,"u");b.q["3A"+a.1r]&&b.q["3A"+a.1r].12(b,6[0])}$(6.W).1C("3y 3x 4O",":2H, :4N, :4M, 20, 4L",1C).1C("4q",":3u, :3t",1C);l(6.q.3r)$(6.W).3q("1g-L.1z",6.q.3r)},L:7(){6.3o();$.G(6.1k,6.1q);6.1g=$.G({},6.1q);l(!6.N())$(6.W).2F("1g-L",[6]);6.1h();8 6.N()},3o:7(){6.2E();P(p i=0,Y=(6.22=6.Y());Y[i];i++){6.23(Y[i])}8 6.N()},I:7(a){a=6.2C(a);6.39=a;6.2L(a);6.22=$(a);p b=6.23(a);l(b){Q 6.1g[a.r]}1a{6.1g[a.r]=v}l(!6.3E()){6.13=6.13.1f(6.26)}6.1h();8 b},1h:7(b){l(b){$.G(6.1q,b);6.R=[];P(p c Z b){6.R.1X({18:b[c],I:6.28(c)[0]})}6.1i=$.3h(6.1i,7(a){8!(a.r Z b)})}6.q.1h?6.q.1h.12(6,6.1q,6.R):6.3g()},2A:7(){l($.38.2A)$(6.W).2A();6.1k={};6.2E();6.2z();6.Y().37(6.q.1c)},3E:7(){8 6.29(6.1g)},29:7(a){p b=0;P(p i Z a)b++;8 b},2z:7(){6.2y(6.13).2x()},N:7(){8 6.3f()==0},3f:7(){8 6.R.E},2o:7(){l(6.q.2o){3e{$(6.3d()||6.R.E&&6.R[0].I||[]).1o(":4B").3c()}3b(e){}}},3d:7(){p a=6.3i;8 a&&$.3h(6.R,7(n){8 n.I.r==a.r}).E==1&&a},Y:7(){p a=6,2w={};8 $([]).1f(6.W.Y).1o(":1Y").1H(":31, :1V, :4z, [4y]").1H(6.q.3l).1o(7(){!6.r&&a.q.21&&2U.1v&&1v.3s("%o 4x 3R r 4u",6);l(6.r Z 2w||!a.29($(6).17()))8 H;2w[6.r]=v;8 v})},2C:7(a){8 $(a)[0]},2v:7(){8 $(6.q.2G+"."+6.q.1c,6.4g)},1V:7(){6.1i=[];6.R=[];6.1q={};6.1l=$([]);6.13=$([]);6.1u=H;6.22=$([])},2E:7(){6.1V();6.13=6.2v().1f(6.26)},2L:7(a){6.1V();6.13=6.1P(a)},23:7(d){d=6.2C(d);l(6.1x(d)){d=6.28(d.r)[0]}p a=$(d).17();p c=H;P(U Z a){p b={U:U,2s:a[U]};3e{p f=$.u.1F[U].12(6,d.T,d,b.2s);l(f=="1E-1R"){c=v;6l}c=H;l(f=="1e"){6.13=6.13.1H(6.1P(d));8}l(!f){6.4r(d,b);8 H}}3b(e){6.q.21&&2U.1v&&1v.6k("6j 6h 6g 6e I "+d.4p+", 23 3W \'"+b.U+"\' U");6d e;}}l(c)8;l(6.29(a))6.1i.1X(d);8 v},4n:7(a,b){l(!$.1A)8;p c=6.q.34?$(a).1A()[6.q.34]:$(a).1A();8 c&&c.J&&c.J[b]},4m:7(a,b){p m=6.q.J[a];8 m&&(m.2i==4l?m:m[b])},4k:7(){P(p i=0;i69: 68 18 67 P "+a.r+"")},4r:7(b,a){p c=6.2m(b,a.U);l(14 c=="7")c=c.12(6,a.2s,b);6.R.1X({18:c,I:b});6.1q[b.r]=c;6.1k[b.r]=c},2y:7(a){l(6.q.2h)a=a.1f(a.64(6.q.2h));8 a},3g:7(){P(p i=0;6.R[i];i++){p a=6.R[i];6.q.2r&&6.q.2r.12(6,a.I,6.q.1c);6.30(a.I,a.18)}l(6.R.E){6.1l=6.1l.1f(6.26)}l(6.q.1n){P(p i=0;6.1i[i];i++){6.30(6.1i[i])}}l(6.q.1I){P(p i=0,Y=6.4i();Y[i];i++){6.q.1I.12(6,Y[i],6.q.1c)}}6.13=6.13.1H(6.1l);6.2z();6.2y(6.1l).4h()},4i:7(){8 6.22.1H(6.3a())},3a:7(){8 $(6.R).3j(7(){8 6.I})},30:7(a,c){p b=6.1P(a);l(b.E){b.37().2q(6.q.1c);b.1J("4f")&&b.4e(c)}1a{b=$("<"+6.q.2G+"/>").1J({"P":6.2Z(a),4f:v}).2q(6.q.1c).4e(c||"");l(6.q.2h){b=b.2x().4h().60("<"+6.q.2h+"/>").5Y()}l(!6.2k.5X(b).E)6.q.4b?6.q.4b(b,$(a)):b.5W(a)}l(!c&&6.q.1n){b.2H("");14 6.q.1n=="1p"?b.2q(6.q.1n):6.q.1n(b)}6.1l=6.1l.1f(b)},1P:7(a){8 6.2v().1o("[P=\'"+6.2Z(a)+"\']")},2Z:7(a){8 6.1Z[a.r]||(6.1x(a)?a.r:a.4p||a.r)},1x:7(a){8/3u|3t/i.V(a.1r)},28:7(d){p c=6.W;8 $(5T.5S(d)).3j(7(a,b){8 b.L==c&&b.r==d&&b||48})},1L:7(a,b){2p(b.47.3D()){1b\'20\':8 $("46:2B",b).E;1b\'1Y\':l(6.1x(b))8 6.28(b.r).1o(\':3P\').E}8 a.E},45:7(b,a){8 6.2X[14 b]?6.2X[14 b](b,a):v},2X:{"5P":7(b,a){8 b},"1p":7(b,a){8!!$(b,a.L).E},"7":7(b,a){8 b(a)}},F:7(a){8!$.u.1F.11.12(6,$.1j(a.T),a)&&"1E-1R"},42:7(a){l(!6.1e[a.r]){6.19++;6.1e[a.r]=v}},4s:7(a,b){6.19--;l(6.19<0)6.19=0;Q 6.1e[a.r];l(b&&6.19==0&&6.1u&&6.L()){$(6.W).31()}1a l(!b&&6.19==0&&6.1u){$(6.W).2F("1g-L",[6])}},2f:7(a){8 $.15(a,"2f")||$.15(a,"2f",5K={2W:48,N:v,18:6.2m(a,"1S")})}},1M:{11:{11:v},1T:{1T:v},1w:{1w:v},1m:{1m:v},1W:{1W:v},2j:{2j:v},1s:{1s:v},24:{24:v},1N:{1N:v},2e:{2e:v}},3Z:7(a,b){a.2i==4l?6.1M[a]=b:$.G(6.1M,a)},43:7(b){p a={};p c=$(b).1J(\'5I\');c&&$.O(c.1K(\' \'),7(){l(6 Z $.u.1M){$.G(a,$.u.1M[6])}});8 a},3G:7(c){p a={};p d=$(c);P(U Z $.u.1F){p b=d.1J(U);l(b){a[U]=b}}l(a.16&&/-1|5H|5G/.V(a.16)){Q a.16}8 a},44:7(a){l(!$.1A)8{};p b=$.15(a.L,\'u\').q.34;8 b?$(a).1A()[b]:$(a).1A()},2t:7(b){p a={};p c=$.15(b.L,\'u\');l(c.q.17){a=$.u.1U(c.q.17[b.r])||{}}8 a},49:7(d,e){$.O(d,7(c,b){l(b===H){Q d[c];8}l(b.2V||b.2d){p a=v;2p(14 b.2d){1b"1p":a=!!$(b.2d,e.L).E;2u;1b"7":a=b.2d.12(e,e);2u}l(a){d[c]=b.2V!==2n?b.2V:v}1a{Q d[c]}}});$.O(d,7(a,b){d[a]=$.5C(b)?b(e):b});$.O([\'1D\',\'16\',\'1y\',\'1t\'],7(){l(d[6]){d[6]=2T(d[6])}});$.O([\'2b\',\'2a\'],7(){l(d[6]){d[6]=[2T(d[6][0]),2T(d[6][1])]}});l($.u.3H){l(d.1y&&d.1t){d.2a=[d.1y,d.1t];Q d.1y;Q d.1t}l(d.1D&&d.16){d.2b=[d.1D,d.16];Q d.1D;Q d.16}}l(d.J){Q d.J}8 d},1U:7(a){l(14 a=="1p"){p b={};$.O(a.1K(/\\s/),7(){b[6]=v});a=b}8 a},5B:7(c,a,b){$.u.1F[c]=a;$.u.J[c]=b;l(a.E<3){$.u.3Z(c,$.u.1U(c))}},1F:{11:7(b,c,a){l(!6.45(a,c))8"1E-1R";2p(c.47.3D()){1b\'20\':p d=$("46:2B",c);8 d.E>0&&(c.1r=="20-5z"||($.2S.2M&&!(d[0].5x[\'T\'].5u)?d[0].2H:d[0].T).E>0);1b\'1Y\':l(6.1x(c))8 6.1L(b,c)>0;5t:8 $.1j(b).E>0}},1S:7(e,h,d){l(6.F(h))8"1E-1R";p g=6.2f(h);l(!6.q.J[h.r])6.q.J[h.r]={};6.q.J[h.r].1S=14 g.18=="7"?g.18(e):g.18;d=14 d=="1p"&&{1w:d}||d;l(g.2W!==e){g.2W=e;p i=6;6.42(h);p f={};f[h.r]=e;$.2R($.G(v,{1w:d,3T:"2Q",3S:"1z"+h.r,5q:"5p",15:f,1n:7(a){l(a){p b=i.1u;i.2L(h);i.1u=b;i.1i.1X(h);i.1h()}1a{p c={};c[h.r]=a||i.2m(h,"1S");i.1h(c)}g.N=a;i.4s(h,a)}},d));8"1e"}1a l(6.1e[h.r]){8"1e"}8 g.N},1D:7(b,c,a){8 6.F(c)||6.1L($.1j(b),c)>=a},16:7(b,c,a){8 6.F(c)||6.1L($.1j(b),c)<=a},2b:7(b,d,a){p c=6.1L($.1j(b),d);8 6.F(d)||(c>=a[0]&&c<=a[1])},1y:7(b,c,a){8 6.F(c)||b>=a},1t:7(b,c,a){8 6.F(c)||b<=a},2a:7(b,c,a){8 6.F(c)||(b>=a[0]&&b<=a[1])},1T:7(a,b){8 6.F(b)||/^((([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^X`{\\|}~]|[\\A-\\B\\w-\\x\\C-\\y])+(\\.([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^X`{\\|}~]|[\\A-\\B\\w-\\x\\C-\\y])+)*)|((\\3Q)((((\\2c|\\1O)*(\\2N\\3X))?(\\2c|\\1O)+)?(([\\3V-\\5E\\3L\\3O\\5j-\\5i\\41]|\\5h|[\\5g-\\5M]|[\\5N-\\5e]|[\\A-\\B\\w-\\x\\C-\\y])|(\\\\([\\3V-\\1O\\3L\\3O\\2N-\\41]|[\\A-\\B\\w-\\x\\C-\\y]))))*(((\\2c|\\1O)*(\\2N\\3X))?(\\2c|\\1O)+)?(\\3Q)))@((([a-z]|\\d|[\\A-\\B\\w-\\x\\C-\\y])|(([a-z]|\\d|[\\A-\\B\\w-\\x\\C-\\y])([a-z]|\\d|-|\\.|X|~|[\\A-\\B\\w-\\x\\C-\\y])*([a-z]|\\d|[\\A-\\B\\w-\\x\\C-\\y])))\\.)+(([a-z]|[\\A-\\B\\w-\\x\\C-\\y])|(([a-z]|[\\A-\\B\\w-\\x\\C-\\y])([a-z]|\\d|-|\\.|X|~|[\\A-\\B\\w-\\x\\C-\\y])*([a-z]|[\\A-\\B\\w-\\x\\C-\\y])))\\.?$/i.V(a)},1w:7(a,b){8 6.F(b)||/^(5d?|5c):\\/\\/(((([a-z]|\\d|-|\\.|X|~|[\\A-\\B\\w-\\x\\C-\\y])|(%[\\1G-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d|[\\A-\\B\\w-\\x\\C-\\y])|(([a-z]|\\d|[\\A-\\B\\w-\\x\\C-\\y])([a-z]|\\d|-|\\.|X|~|[\\A-\\B\\w-\\x\\C-\\y])*([a-z]|\\d|[\\A-\\B\\w-\\x\\C-\\y])))\\.)+(([a-z]|[\\A-\\B\\w-\\x\\C-\\y])|(([a-z]|[\\A-\\B\\w-\\x\\C-\\y])([a-z]|\\d|-|\\.|X|~|[\\A-\\B\\w-\\x\\C-\\y])*([a-z]|[\\A-\\B\\w-\\x\\C-\\y])))\\.?)(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|X|~|[\\A-\\B\\w-\\x\\C-\\y])|(%[\\1G-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|X|~|[\\A-\\B\\w-\\x\\C-\\y])|(%[\\1G-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)*)*)?)?(\\?((([a-z]|\\d|-|\\.|X|~|[\\A-\\B\\w-\\x\\C-\\y])|(%[\\1G-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|[\\59-\\58]|\\/|\\?)*)?(\\#((([a-z]|\\d|-|\\.|X|~|[\\A-\\B\\w-\\x\\C-\\y])|(%[\\1G-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i.V(a)},1m:7(a,b){8 6.F(b)||!/57|5Z/.V(2l 56(a))},1W:7(a,b){8 6.F(b)||/^\\d{4}[\\/-]\\d{1,2}[\\/-]\\d{1,2}$/.V(a)},2j:7(a,b){8 6.F(b)||/^\\d\\d?\\.\\d\\d?\\.\\d\\d\\d?\\d?$/.V(a)},1s:7(a,b){8 6.F(b)||/^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)(?:\\.\\d+)?$/.V(a)},24:7(a,b){8 6.F(b)||/^-?(?:\\d+|\\d{1,3}(?:\\.\\d{3})+)(?:,\\d+)?$/.V(a)},1N:7(a,b){8 6.F(b)||/^\\d+$/.V(a)},2e:7(b,e){l(6.F(e))8"1E-1R";l(/[^0-9-]+/.V(b))8 H;p a=0,d=0,27=H;b=b.3B(/\\D/g,"");P(n=b.E-1;n>=0;n--){p c=b.62(n);p d=54(c,10);l(27){l((d*=2)>9)d-=9}a+=d;27=!27}8(a%10)==0},3U:7(b,c,a){a=14 a=="1p"?a:"52|66?g|51";8 6.F(c)||b.50(2l 3z(".("+a+")$","i"))},3Y:7(b,c,a){8 b==$(a).4Z()}}})})(32);(7($){p c=$.2R;p d={};$.2R=7(a){a=$.G(a,$.G({},$.4X,a));p b=a.3S;l(a.3T=="2Q"){l(d[b]){d[b].2Q()}8(d[b]=c.1Q(6,S))}8 c.1Q(6,S)}})(32);(7($){$.O({3c:\'3y\',4W:\'3x\'},7(b,a){$.1B.2K[a]={4T:7(){l($.2S.2M)8 H;6.4S(b,$.1B.2K[a].36,v)},4R:7(){l($.2S.2M)8 H;6.4Q(b,$.1B.2K[a].36,v)},36:7(e){S[0]=$.1B.33(e);S[0].1r=a;8 $.1B.2g.1Q(6,S)}}});$.G($.38,{1C:7(d,e,c){8 6.3q(d,7(a){p b=$(a.3C);l(b.2J(e)){8 c.1Q(b,S)}})},4P:7(a,b){8 6.2F(a,[$.1B.33({1r:a,3C:b})])}})})(32);',62,394,'||||||this|function|return|||||||||||||if||||var|settings|name|||validator|true|uF900|uFDCF|uFFEF||u00A0|uD7FF|uFDF0||length|optional|extend|false|element|messages|Please|form|enter|valid|each|for|delete|errorList|arguments|value|method|test|currentForm|_|elements|in||required|call|toHide|typeof|data|maxlength|rules|message|pendingRequest|else|case|errorClass|format|pending|add|invalid|showErrors|successList|trim|submitted|toShow|date|success|filter|string|errorMap|type|number|max|formSubmitted|console|url|checkable|min|validate|metadata|event|delegate|minlength|dependency|methods|da|not|unhighlight|attr|split|getLength|classRuleSettings|digits|x09|errorsFor|apply|mismatch|remote|email|normalizeRule|reset|dateISO|push|input|groups|select|debug|currentElements|check|numberDE||containers|bEven|findByName|objectLength|range|rangelength|x20|depends|creditcard|previousValue|handle|wrapper|constructor|dateDE|labelContainer|new|defaultMessage|undefined|focusInvalid|switch|addClass|highlight|parameters|staticRules|break|errors|rulesCache|hide|addWrapper|hideErrors|resetForm|selected|clean|errorLabelContainer|prepareForm|triggerHandler|errorElement|text|defaults|is|special|prepareElement|msie|x0d|characters|than|abort|ajax|browser|Number|window|param|old|dependTypes|ein|idOrName|showLabel|submit|jQuery|fix|meta|cancelSubmit|handler|removeClass|fn|lastElement|invalidElements|catch|focus|findLastActive|try|size|defaultShowErrors|grep|lastActive|map|ignoreTitle|ignore|errorContainer|Sie|checkForm|nothing|bind|invalidHandler|error|checkbox|radio|onsubmit|init|focusout|focusin|RegExp|on|replace|target|toLowerCase|numberOfInvalids|Array|attributeRules|autoCreateRanges|equal|or|makeArray|x0b|and|between|x0c|checked|x22|no|port|mode|accept|x01|the|x0a|equalTo|addClassRules|submitHandler|x7f|startRequest|classRules|metadataRules|depend|option|nodeName|null|normalizeRules|to|errorPlacement|geben|Bitte|html|generated|errorContext|show|validElements|strong|findDefined|String|customMessage|customMetaMessage|field|id|click|formatAndAdd|stopRequest|onclick|assigned|onkeyup|cancel|has|disabled|image|can|visible|onfocusout|button|blockFocusCleanup|focusCleanup|removeAttr|onfocusin|find|label|removeAttrs|textarea|file|password|keyup|triggerEvent|removeEventListener|teardown|addEventListener|setup|slice|valueCache|blur|ajaxSettings|warn|val|match|gif|png|prototype|parseInt|greater|Date|Invalid|uF8FF|uE000|unshift|less|ftp|https|x7e|long|x23|x21|x1f|x0e|least|at|unchecked|more|filled|json|dataType|extension|with|default|specified|again|blank|attributes|same|multiple|expr|addMethod|isFunction|card|x08|credit|524288|2147483647|class|only|previous|Nummer|x5b|x5d|eine|boolean|Datum|ltiges|getElementsByName|document|g�|preventDefault|insertAfter|append|parent|NaN|wrap|ISO|charAt|remove|parents|URL|jpe|defined|No|Warning|address|title|returning|throw|checking|This|when|occured|setDefaults|exception|log|continue'.split('|'),0,{})) \ No newline at end of file Index: lams_central/web/index.jsp =================================================================== diff -u -rb1a3f31300216ef2e6a6ecfd7ed348920ab9dd0e -rc234c64ad9ff9d713f6d8e3331d0c20075e49303 --- lams_central/web/index.jsp (.../index.jsp) (revision b1a3f31300216ef2e6a6ecfd7ed348920ab9dd0e) +++ lams_central/web/index.jsp (.../index.jsp) (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303) @@ -4,6 +4,7 @@ <%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> <%@ taglib uri="tags-lams" prefix="lams" %> <%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-core" prefix="c"%> @@ -22,4 +23,13 @@ - \ No newline at end of file + + + + + \ No newline at end of file Index: lams_central/web/lamscommunity/lamscommunityLogin.jsp =================================================================== diff -u --- lams_central/web/lamscommunity/lamscommunityLogin.jsp (revision 0) +++ lams_central/web/lamscommunity/lamscommunityLogin.jsp (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303) @@ -0,0 +1,64 @@ + + +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> +<%@ taglib uri="tags-lams" prefix="lams" %> +<%@ taglib uri="tags-html" prefix="html" %> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-core" prefix="c"%> + + + + <fmt:message key="index.welcome" /> + + + + + + + + + +

+ +

+
+ +

+ +

+
+
+ + + + +

+   +

+ +

+   +

+ + + +
+
+
+ +
+ +
\ No newline at end of file