Index: lams_common/src/java/org/lamsfoundation/lams/integration/security/LoginRequestValve.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/integration/security/LoginRequestValve.java,v diff -u -r1.10 -r1.11 --- lams_common/src/java/org/lamsfoundation/lams/integration/security/LoginRequestValve.java 5 Aug 2014 22:27:19 -0000 1.10 +++ lams_common/src/java/org/lamsfoundation/lams/integration/security/LoginRequestValve.java 7 May 2015 03:25:51 -0000 1.11 @@ -94,14 +94,8 @@ LoginRequestValve.log.debug("Session Id - " + hses.getId()); String userid = hreq.getParameter(LoginRequestValve.PARAM_USERID); - // get the location from an explicit parameter - String redirect = hreq.getParameter("redirectURL"); - if (redirect == null) { - // get the redirect url from RequestDispatcher - // The RequestDispatcher also setup any session variable - // required to carryout the method - redirect = LoginRequestDispatcher.getRequestURL(hreq); - } + // get the location from either redirectURL or from the method setting + String redirect = LoginRequestDispatcher.getRequestURL(hreq); // check required parameters if ((userid != null) && (redirect != null) && (hses != null)) { Index: lams_common/src/java/org/lamsfoundation/lams/integration/util/LoginRequestDispatcher.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/integration/util/LoginRequestDispatcher.java,v diff -u -r1.18 -r1.19 --- lams_common/src/java/org/lamsfoundation/lams/integration/util/LoginRequestDispatcher.java 12 Sep 2014 19:45:42 -0000 1.18 +++ lams_common/src/java/org/lamsfoundation/lams/integration/util/LoginRequestDispatcher.java 7 May 2015 03:25:51 -0000 1.19 @@ -109,14 +109,22 @@ /** * This method is called within LoginRequestValve and LoginRequestServlet. - * It simply fetch the method parameter from HttpServletRequest and build - * the url to redirect user to. + * If there is a redirectURL parameter then this becomes the redirect, otherwise it + * fetches the method parameter from HttpServletRequest and builds the redirect url. + * If the method parameter is used and a lessonId is supplied, then the user is added + * to the LessonClass. * * @param request * @return */ + public static String getRequestURL(HttpServletRequest request) throws ServletException { + // get the location from an explicit parameter if it exists + String redirect = request.getParameter("redirectURL"); + if ( redirect != null ) + return request.getContextPath() + "/" + redirect; + String method = request.getParameter(PARAM_METHOD); String lessonId = request.getParameter(PARAM_LESSON_ID); String mode = request.getParameter(PARAM_MODE);