Index: lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java,v diff -u -r1.32.2.3 -r1.32.2.4 --- lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java 9 Jul 2007 07:20:02 -0000 1.32.2.3 +++ lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java 24 Jul 2007 00:46:17 -0000 1.32.2.4 @@ -80,16 +80,16 @@ public class IndexAction extends Action { private static Logger log = Logger.getLogger(IndexAction.class); - private static IUserManagementService service; - private Integer state; + private String idpId = null; @SuppressWarnings("unchecked") public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String stateParam = WebUtil.readStrParam(request, "state"); state = (stateParam.equals("active")?OrganisationState.ACTIVE:OrganisationState.ARCHIVED); + idpId = request.getHeader("Shib-Identity-Provider"); log.debug("User:"+request.getRemoteUser()); // only set header links if we are displaying 'active' organisations; i.e., on the index page @@ -280,24 +280,27 @@ LessonFederation lessonFed = (LessonFederation)extLessons.get(i); String fedServerUrl = lessonFed.getFedServer().getUrl(); String url = null; - if(contains(roles,Role.ROLE_LEARNER)) { - if (state.equals(OrganisationState.ACTIVE)) { - url = "javascript:openFedLearner(" + lessonFed.getExtLessonId() + ", " - + "'" + getURLNoPath(fedServerUrl) + "', " - + "'" + Configuration.get(ConfigurationKeys.SHIB_IDP_SSO_HANDLER) + "', " - + "'" + Configuration.get(ConfigurationKeys.SHIB_IDP_ENTITY_ID) + "')"; - } else if (state.equals(OrganisationState.ARCHIVED)) { - lessonLinks.add(new IndexLinkBean("label.export.portfolio","javascript:openExportPortfolio("+lessonFed.getExtLessonId()+")")); + String shibUrlArgs = "(" + lessonFed.getExtLessonId() + ", " + + "'" + getURLNoPath(fedServerUrl) + "', " + + "'" + Configuration.get(ConfigurationKeys.SHIB_IDP_SSO_HANDLER) + "', " + + "'" + idpId + "')"; + + if (state.equals(OrganisationState.ACTIVE)) { + if(contains(roles,Role.ROLE_LEARNER)) { + url = "javascript:openFedLearner"+shibUrlArgs; } - } - if(contains(roles,Role.ROLE_MONITOR)) { - if (state.equals(OrganisationState.ACTIVE)) { - lessonLinks.add(new IndexLinkBean("index.monitor", "javascript:openMonitorLesson(" + lessonFed.getExtLessonId()+")")); + if(contains(roles,Role.ROLE_MONITOR) || contains(roles,Role.ROLE_GROUP_MANAGER)) { + lessonLinks.add(new IndexLinkBean("index.monitor", "javascript:openFedMonitorLesson"+shibUrlArgs)); } + } else if (state.equals(OrganisationState.ARCHIVED)) { + if(contains(roles,Role.ROLE_LEARNER)) { + lessonLinks.add(new IndexLinkBean("label.export.portfolio","javascript:openFedExportPortfolio"+shibUrlArgs)); + } + if(contains(roles,Role.ROLE_GROUP_MANAGER)) { + lessonLinks.add(new IndexLinkBean("index.monitor", "javascript:openFedMonitorLesson"+shibUrlArgs)); + } } - if(contains(roles,Role.ROLE_GROUP_MANAGER)) { - lessonLinks.add(new IndexLinkBean("index.monitor", "javascript:openMonitorLesson(" + lessonFed.getExtLessonId()+")")); - } + if(lessonLinks.size()>0 || url!=null){ IndexLessonBean lessonBean = new IndexLessonBean(lessonFed.getExtLessonName(), lessonLinks); lessonBean.setUrl(url); Fisheye: Tag 1.1 refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/web/ShibExportPortfolioServlet.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_central/src/java/org/lamsfoundation/lams/web/ShibLearnerServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/Attic/ShibLearnerServlet.java,v diff -u -r1.1.2.4 -r1.1.2.5 --- lams_central/src/java/org/lamsfoundation/lams/web/ShibLearnerServlet.java 20 Jul 2007 02:58:53 -0000 1.1.2.4 +++ lams_central/src/java/org/lamsfoundation/lams/web/ShibLearnerServlet.java 24 Jul 2007 00:46:17 -0000 1.1.2.5 @@ -44,7 +44,7 @@ * @author jliew * * @web:servlet name="ShibLearnerServlet" load-on-startup="1" - * @web:servlet-mapping url-pattern="/shiblearner" + * @web:servlet-mapping url-pattern="/servlet/shiblearner" */ public class ShibLearnerServlet extends HttpServlet { @@ -90,7 +90,7 @@ if (user != null && lessonClass != null && !lessonClass.getLearners().contains(user)) { boolean result = lessonService.addLearner(lessonId, user.getUserId()); if (result) { - log.info("Added shib user "+user.getLogin()+" to lesson with id "+lessonIdStr); + log.info("Added shib user "+user.getLogin()+" as learner to lesson with id "+lessonIdStr); } } } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/web/ShibMonitorServlet.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_central/web/includes/javascript/openUrls.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/openUrls.js,v diff -u -r1.20.2.5 -r1.20.2.6 --- lams_central/web/includes/javascript/openUrls.js 20 Jul 2007 02:58:53 -0000 1.20.2.5 +++ lams_central/web/includes/javascript/openUrls.js 24 Jul 2007 00:46:16 -0000 1.20.2.6 @@ -116,6 +116,35 @@ } } + function openFedMonitorLesson( lessonId, fedServerHost, localIdPHandler, providerId ) + { + var target = fedServerHost+'/lams/servlet/shibmonitor?lessonID='+lessonId; + var shire = fedServerHost+'/Shibboleth.sso/SAML/POST'; + var url = localIdPHandler+'?target='+target+'&shire='+shire+'&providerId='+providerId; + + if(isMac) + { + if(belowMinRes) + { + monitorLessonWin = window.open(url,'mWindow','width=796,height=575,resizable,scrollbars'); + } + else + { + monitorLessonWin = window.open(url,'mWindow','width=779,height=575,resizable,scrollbars'); + } + } + else + { + if(monitorLessonWin && !monitorLessonWin.closed) + { + monitorLessonWin.location = url; + monitorLessonWin.focus(); + }else{ + monitorLessonWin = window.open(url,'mWindow','width=779,height=575,resizable,resizable,scrollbars'); + } + } + } + function openAddLesson( courseID, classID ) { if(isMac) @@ -165,7 +194,7 @@ function openFedLearner( lessonId, fedServerHost, localIdPHandler, providerId ) { - var target = fedServerHost+'/lams/shiblearner?lessonID='+lessonId; + var target = fedServerHost+'/lams/servlet/shiblearner?lessonID='+lessonId; var shire = fedServerHost+'/Shibboleth.sso/SAML/POST'; var url = localIdPHandler+'?target='+target+'&shire='+shire+'&providerId='+providerId; @@ -208,6 +237,30 @@ } } + function openFedExportPortfolio( lessonId, fedServerHost, localIdPHandler, providerId ) + { + var target = fedServerHost+'/lams/servlet/shibexportportfolio?lessonID='+lessonId; + var shire = fedServerHost+'/Shibboleth.sso/SAML/POST'; + var url = localIdPHandler+'?target='+target+'&shire='+shire+'&providerId='+providerId; + + if(isMac) + { + epWin = window.open('learning/exportWaitingPage.jsp?mode=learner&lessonID='+lessonId,'epWindow','width=796,height=570,resizable,status=yes'); + } + else + { + if(epWin && !epWin.closed ) + { + epWin.location = 'learning/exportWaitingPage.jsp?mode=learner&lessonID='+lessonId; + ep.focus(); + } + else + { + epWin = window.open('learning/exportWaitingPage.jsp?mode=learner&lessonID='+lessonId,'epWindow','width=796,height=570,resizable,status=yes'); + } + } + } + function openSysadmin() { var height = 650;