5 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
6 include_once
'./Services/WebServices/ECS/interfaces/interface.ilECSCommandQueueHandler.php';
7 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
8 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
67 include_once
'./Services/WebServices/ECS/classes/Course/class.ilECSCourseMemberConnector.php';
69 $details = $crsm_reader->getCourseMember($a_content_id,
true);
70 $this->mid = $details->getMySender();
73 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
75 if(!$part->isImportEnabled())
77 $GLOBALS[
'ilLog']->write(__METHOD__.
': Import disabled for mid '.$this->getMid());
81 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
90 $GLOBALS[
'ilLog']->write(__METHOD__.
': Reading course member details failed with message '. $e->getMessage());
103 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
104 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
105 include_once
'./Services/WebServices/ECS/classes/Course/class.ilECSCourseConnector.php';
115 $this->
doUpdate($a_content_id,$course_member);
120 $GLOBALS[
'ilLog']->write(__METHOD__.
': Course member creation failed with mesage ' . $e->getMessage());
152 $this->
doUpdate($a_content_id, $course_member);
157 $GLOBALS[
'ilLog']->write(__METHOD__.
': Course member update failed with mesage ' . $e->getMessage());
168 protected function doUpdate($a_content_id, $course_member)
170 $GLOBALS[
'ilLog']->write(__METHOD__.
': Starting ecs member update');
172 $course_id = (int) $course_member->lectureID;
175 $GLOBALS[
'ilLog']->write(__METHOD__.
': Missing course id');
178 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
179 $GLOBALS[
'ilLog']->write(__METHOD__.
': sid: '.$this->getServer()->getServerId().
' course_id: '.$course_id.
' mid: '.
$this->mid);
186 $GLOBALS[
'ilLog']->write(__METHOD__.
': Missing assigned course with id '. $course_id);
195 foreach((array) $assignments as $cms_id => $assigned)
197 $sub_id = ($cms_id == $course_id) ? 0 : $cms_id;
199 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
218 $put_in_course =
true;
220 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
221 switch((
int) $course->groupScenario)
224 $GLOBALS[
'ilLog']->write(__METHOD__.
': No parallel group scenario defined.');
225 $put_in_course =
true;
229 $GLOBALS[
'ilLog']->write(__METHOD__.
': Parallel group scenario one course.');
230 $put_in_course =
true;
234 $GLOBALS[
'ilLog']->write(__METHOD__.
': Parallel group scenario groups in courses.');
235 $put_in_course =
false;
239 $GLOBALS[
'ilLog']->write(__METHOD__.
': Parallel group scenario only courses.');
240 $put_in_course =
false;
244 $GLOBALS[
'ilLog']->write(__METHOD__.
': Parallel group scenario undefined.');
245 $put_in_course =
true;
249 $course_id = $course_member->lectureID;
251 foreach((array) $course_member->members as $member)
253 $assigned[$course_id][$member->personID] = array(
254 'id' => $member->personID,
255 'role' => $member->role
258 foreach((array) $member->groups as $pgroup)
263 $assigned[$pgroup->num][$member->personID] = array(
264 'id' => $member->personID,
265 'role' => $pgroup->role
270 $GLOBALS[
'ilLog']->write(__METHOD__.
': ECS member assignments '.print_r($assigned,
true));
283 include_once
'./Services/WebServices/ECS/classes/Course/class.ilECSCourseMemberAssignment.php';
288 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
293 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
299 $course_id = (int) $course_member->lectureID;
306 foreach((array) $usr_ids as $usr_id)
308 if(!isset($assigned[$usr_id]))
319 $part->delete($il_usr_id);
333 foreach((array) $assigned as $person_id => $person)
340 (
string) $person_id);
341 $GLOBALS[
'ilLog']->write(__METHOD__.
': Handling user '. (
string) $person_id);
343 if(in_array($person_id, $usr_ids))
347 $GLOBALS[
'ilLog']->write(__METHOD__.
': '. print_r($role,
true));
348 $part->updateRoleAssignments($il_usr_id, array($role));
360 $part->add($il_usr_id,$role);
366 if($role_info[
'create'])
369 $GLOBALS[
'ilLog']->write(__METHOD__.
': Added new user '. $person_id);
376 (
string) $person_id);
380 $part->add($il_usr_id,$role);
386 $assignment->setServer($this->
getServer()->getServerId());
387 $assignment->setMid($this->mid);
388 $assignment->setCmsId($course_id);
389 $assignment->setCmsSubId($sub_id);
390 $assignment->setObjId($obj_id);
391 $assignment->setUid($person_id);
408 foreach($role_mappings as $name => $map)
410 if($role_value == $map)
415 $GLOBALS[
'ilLog']->write(__METHOD__.
': No role assignment mapping for role ' . $role_value);
427 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
431 include_once
'./Services/LDAP/classes/class.ilLDAPQuery.php';
435 $users =
$query->fetchUser($a_person_id);
438 include_once
'./Services/LDAP/classes/class.ilLDAPAttributeToUser.php';
440 $xml->setNewUserAuthMode(
$server->getAuthenticationMappingKey());
441 $xml->setUserData($users);
448 $this->log->write($exc->getMessage());
461 include_once
'./Services/WebServices/ECS/classes/Course/class.ilECSCourseMemberConnector.php';
464 $member = $crs_member_reader->getCourseMember($a_content_id);
483 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
487 $course_member->lectureID
490 include_once
'./Services/WebServices/ECS/classes/Course/class.ilECSCourseConnector.php';
492 return $crs_reader->getCourse($ecs_id);