Index: lams_common/src/java/org/lamsfoundation/lams/integration/security/LoginRequestValve.java =================================================================== diff -u -rc6867c1780952042c1c587da64b3002b60b31c85 -r9b2295f9a446dd4eabaa77f1dfd188e593cbe372 --- lams_common/src/java/org/lamsfoundation/lams/integration/security/LoginRequestValve.java (.../LoginRequestValve.java) (revision c6867c1780952042c1c587da64b3002b60b31c85) +++ lams_common/src/java/org/lamsfoundation/lams/integration/security/LoginRequestValve.java (.../LoginRequestValve.java) (revision 9b2295f9a446dd4eabaa77f1dfd188e593cbe372) @@ -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 =================================================================== diff -u -r744f5620f6d13c0fa4f44e42b708dbec50bfe9b4 -r9b2295f9a446dd4eabaa77f1dfd188e593cbe372 --- lams_common/src/java/org/lamsfoundation/lams/integration/util/LoginRequestDispatcher.java (.../LoginRequestDispatcher.java) (revision 744f5620f6d13c0fa4f44e42b708dbec50bfe9b4) +++ lams_common/src/java/org/lamsfoundation/lams/integration/util/LoginRequestDispatcher.java (.../LoginRequestDispatcher.java) (revision 9b2295f9a446dd4eabaa77f1dfd188e593cbe372) @@ -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);