Index: lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java =================================================================== diff -u -r96033f32ff880d045b4c087f52628d233dc98095 -rb89b4282be5db1310440d337d16c232e4e1a46d6 --- lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java (.../LessonManagerServlet.java) (revision 96033f32ff880d045b4c087f52628d233dc98095) +++ lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java (.../LessonManagerServlet.java) (revision b89b4282be5db1310440d337d16c232e4e1a46d6) @@ -929,7 +929,7 @@ // integrationService.addExtUserToLesson(extServer, IntegrationConstants.METHOD_LEARNER, lessonId, // userName, firstName, lastName, email, courseId, countryIsoCode, langIsoCode); integrationService.addExtUserToCourseAndLesson(extServer, IntegrationConstants.METHOD_LEARNER, - lessonId, userName, firstName, lastName, email, courseId, country, locale); + lessonId, userName, firstName, lastName, email, courseId, country, locale, true); } i++; } @@ -947,7 +947,7 @@ if (StringUtils.isNotBlank(userName)) { integrationService.addExtUserToCourseAndLesson(extServer, IntegrationConstants.METHOD_MONITOR, - lessonId, userName, firstName, lastName, email, courseId, country, locale); + lessonId, userName, firstName, lastName, email, courseId, country, locale, true); } i++; } Index: lams_common/src/java/org/lamsfoundation/lams/integration/service/IIntegrationService.java =================================================================== diff -u -r25789285b22f2b11797f61c46e176abeffb3b2cf -rb89b4282be5db1310440d337d16c232e4e1a46d6 --- lams_common/src/java/org/lamsfoundation/lams/integration/service/IIntegrationService.java (.../IIntegrationService.java) (revision 25789285b22f2b11797f61c46e176abeffb3b2cf) +++ lams_common/src/java/org/lamsfoundation/lams/integration/service/IIntegrationService.java (.../IIntegrationService.java) (revision b89b4282be5db1310440d337d16c232e4e1a46d6) @@ -254,16 +254,16 @@ * Adds an external user to the course with specified courseId. */ ExtUserUseridMap addExtUserToCourse(ExtServer extServer, String method, String username, String firstName, - String lastName, String email, String extCourseId, String countryIsoCode, String langIsoCode) - throws UserInfoFetchException, UserInfoValidationException; + String lastName, String email, String extCourseId, String countryIsoCode, String langIsoCode, + boolean usePrefix) throws UserInfoFetchException, UserInfoValidationException; /** * Add an external user to the course with specified courseId and then adds it the the lesson with specified * lessonId. (This method makes internal call to addExtUserToCourse()). */ ExtUserUseridMap addExtUserToCourseAndLesson(ExtServer extServer, String method, Long lessonId, String username, String firstName, String lastName, String email, String extCourseId, String countryIsoCode, - String langIsoCode) throws UserInfoFetchException, UserInfoValidationException; + String langIsoCode, boolean usePrefix) throws UserInfoFetchException, UserInfoValidationException; /** * Creates an external org and normal org. It does not set roles for the creator. Index: lams_common/src/java/org/lamsfoundation/lams/integration/service/IntegrationService.java =================================================================== diff -u -ra4cac24066ba39701ad51a8dd4c512b6e4100873 -rb89b4282be5db1310440d337d16c232e4e1a46d6 --- lams_common/src/java/org/lamsfoundation/lams/integration/service/IntegrationService.java (.../IntegrationService.java) (revision a4cac24066ba39701ad51a8dd4c512b6e4100873) +++ lams_common/src/java/org/lamsfoundation/lams/integration/service/IntegrationService.java (.../IntegrationService.java) (revision b89b4282be5db1310440d337d16c232e4e1a46d6) @@ -906,8 +906,8 @@ @Override public ExtUserUseridMap addExtUserToCourse(ExtServer extServer, String method, String username, String firstName, - String lastName, String email, String extCourseId, String countryIsoCode, String langIsoCode) - throws UserInfoFetchException, UserInfoValidationException { + String lastName, String email, String extCourseId, String countryIsoCode, String langIsoCode, + boolean usePrefix) throws UserInfoFetchException, UserInfoValidationException { if (log.isDebugEnabled()) { log.debug("Adding user '" + username + "' as " + method + " to course with extCourseId '" + extCourseId @@ -918,32 +918,28 @@ if ((firstName == null) && (lastName == null)) { userMap = getExtUserUseridMap(extServer, username); } else { - final boolean usePrefix = true; final boolean isUpdateUserDetails = false; userMap = getImplicitExtUserUseridMap(extServer, username, firstName, lastName, langIsoCode, countryIsoCode, email, usePrefix, isUpdateUserDetails); } // adds user to group - ExtCourseClassMap orgMap = getExtCourseClassMap(extServer, userMap, extCourseId, null, method); - //TODO when merging to newer branch, check and maybe change to the following -// getExtCourseClassMap(extServer, userMap, courseId, countryIsoCode, langIsoCode, null, -// method); + getExtCourseClassMap(extServer, userMap, extCourseId, null, method); return userMap; } @Override public ExtUserUseridMap addExtUserToCourseAndLesson(ExtServer extServer, String method, Long lesssonId, String username, String firstName, String lastName, String email, String extCourseId, String countryIsoCode, - String langIsoCode) throws UserInfoFetchException, UserInfoValidationException { + String langIsoCode, boolean usePrefix) throws UserInfoFetchException, UserInfoValidationException { if (log.isDebugEnabled()) { log.debug("Adding user '" + username + "' as " + method + " to lesson with id '" + lesssonId + "'."); } ExtUserUseridMap userMap = addExtUserToCourse(extServer, method, username, firstName, lastName, email, - extCourseId, countryIsoCode, langIsoCode); + extCourseId, countryIsoCode, langIsoCode, usePrefix); User user = userMap.getUser(); if (user == null) { @@ -1103,9 +1099,9 @@ //empty lessonId means we need to only add users to the course. Otherwise we add them to course AND lesson ExtUserUseridMap extUser = lessonId == null ? addExtUserToCourse(extServer, method, extUserId, firstName, lastName, email, courseId, - countryIsoCode, langIsoCode) + countryIsoCode, langIsoCode, true) : addExtUserToCourseAndLesson(extServer, method, lessonId, extUserId, firstName, lastName, email, - courseId, countryIsoCode, langIsoCode); + courseId, countryIsoCode, langIsoCode, true); // If a result sourcedid is provided, save it to the user object JsonNode messages = membership.get("message");