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';
32 $this->log =
$GLOBALS[
'DIC']->logger()->wsrv();
72 include_once
'./Services/WebServices/ECS/classes/Course/class.ilECSCourseMemberConnector.php';
74 $details = $crsm_reader->getCourseMember($a_content_id,
true);
75 $this->mid = $details->getMySender();
78 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
80 if (!$part->isImportEnabled()) {
81 $this->log->warning(
'Import disabled for mid ' . $this->
getMid());
85 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
92 $this->log->error(
'Reading course member details failed with message ' . $e->getMessage());
105 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
106 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
107 include_once
'./Services/WebServices/ECS/classes/Course/class.ilECSCourseConnector.php';
115 $this->
doUpdate($a_content_id, $course_member);
118 $this->log->error(
'Course member creation failed with mesage ' . $e->getMessage());
148 $this->
doUpdate($a_content_id, $course_member);
151 $this->log->error(
'Course member update failed with mesage ' . $e->getMessage());
162 protected function doUpdate($a_content_id, $course_member)
164 $this->log->debug(
'Starting ecs member update');
166 $course_id = (int) $course_member->lectureID;
168 $this->log->warning(
'Missing course id');
171 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
172 $this->log->debug(
'sid: ' . $this->
getServer()->getServerId() .
' course_id: ' . $course_id .
' mid: ' . $this->mid);
177 $this->log->info(
'No main course created. Group scenario >= 3 ?');
184 $this->log->debug(
'Parallel group assignments');
186 $this->log->debug(
'------------------ End assignemtns');
189 foreach ((array) $assignments as $cms_id => $assigned) {
190 $sub_id = ($cms_id == $course_id) ? null : $cms_id;
192 $this->log->debug(
'sub id is ' . $sub_id .
' for ' . $cms_id);
194 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
214 $put_in_course =
true;
216 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
217 switch ((
int) $course->groupScenario) {
219 $this->log->debug(
'Parallel group scenario one course.');
220 $put_in_course =
true;
224 $this->log->debug(
'Parallel group scenario groups in courses.');
225 $put_in_course =
false;
229 $this->log->debug(
'Parallel group scenario only courses.');
230 $put_in_course =
false;
234 $this->log->debug(
'Parallel group scenario undefined.');
235 $put_in_course =
true;
239 $course_id = $course_member->lectureID;
241 foreach ((array) $course_member->members as $member) {
242 $assigned[$course_id][$member->personID] = array(
243 'id' => $member->personID,
244 'role' => $member->role
247 $this->log->debug(
'Group scenarion "one course". Ignoring group assignments');
251 foreach ((array) $member->groups as $pgroup) {
253 $sequence_number = (int) $pgroup->num;
255 $tmp_pgroup = $course->groups[$sequence_number];
256 if (is_object($tmp_pgroup)) {
257 $pgroup_id = $tmp_pgroup->id;
259 if (strlen($pgroup_id)) {
260 $this->log->debug(
'Found parallel group with id: ' . $pgroup_id .
': for sequence number: ' . $sequence_number);
263 $assigned[$pgroup_id][$member->personID] = array(
264 'id' => $member->personID,
265 'role' => $pgroup->role
268 $this->log->warning(
'Cannot find parallel group with sequence id: ' . $sequence_number);
272 $this->log->debug(
'ECS member assignments ' . print_r($assigned,
true));
285 include_once
'./Services/WebServices/ECS/classes/Course/class.ilECSCourseMemberAssignment.php';
287 $this->log->debug(
'Currrent sub_id = ' . $sub_id .
', obj_id = ' . $obj_id);
290 if (
$type ==
'crs') {
291 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
293 } elseif (
$type ==
'grp') {
294 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
297 $this->log->warning(
'Invalid object type given for obj_id: ' . $obj_id);
301 $course_id = (int) $course_member->lectureID;
309 foreach ((array) $usr_ids as $usr_id) {
310 if (!isset($assigned[$usr_id])) {
318 $this->log->debug(
'Local user assignment: ' . (
string) $usr_id .
' <-> ' .
$login);
322 $part->delete($il_usr_id);
325 $this->log->notice(
'Deassigning unknown ILIAS user ' . $usr_id .
' ' .
'from course ' .
ilObject::_lookupTitle($obj_id));
333 $this->log->debug(
'Handled assignmnent...');
336 foreach ((array) $assigned as $person_id => $person) {
340 $this->log->debug(
'Using role info...');
345 $this->log->info(
'Handling user ' . (
string) $person_id);
347 if (in_array($person_id, $usr_ids)) {
349 $part->updateRoleAssignments($il_usr_id, array($part->getAutoGeneratedRoleId($role)));
350 } elseif ($role_info[
'create']) {
352 $this->log->info(
'Added new user ' . $person_id);
359 $part->add($il_usr_id, $role);
360 $part->sendNotification($part->NOTIFY_ACCEPT_USER, $il_usr_id);
369 $this->log->info(
'Assigning new user ' . $person_id .
' ' .
'to ' .
ilObject::_lookupTitle($obj_id) .
' using role: ' . $role);
370 $part->add($il_usr_id, $role);
371 $part->sendNotification($part->NOTIFY_ACCEPT_USER, $il_usr_id);
375 if ($role_info[
'create']) {
377 $this->log->info(
'Added new user ' . $person_id);
386 $part->add($il_usr_id, $role);
387 $part->sendNotification($part->NOTIFY_ACCEPT_USER, $il_usr_id);
393 $assignment->setServer($this->
getServer()->getServerId());
394 $assignment->setMid($this->mid);
395 $assignment->setCmsId($course_id);
396 $assignment->setCmsSubId($sub_id);
397 $assignment->setObjId($obj_id);
398 $assignment->setUid($person_id);
416 $this->log->debug(
'No role assignment attribute: role');
418 foreach ($role_mappings as
$name =>
$map) {
419 $this->log->debug(
'Role "name" is ' .
$name);
422 $exploded_map = (array) explode(
',',
$map);
423 if (in_array($role_value, $exploded_map)) {
428 if ($a_obj_type ==
'crs') {
429 $this->log->debug(
'Role: ' . $role_value .
' maps: ' . $exploded_map);
436 if ($a_obj_type ==
'grp') {
437 $this->log->debug(
'Role: ' . $role_value .
' maps: ' . $exploded_map);
444 $this->log->info(
'No role assignment mapping for role ' . $role_value);
455 $this->log->warning(
'Node mapping settings not initialized.');
463 $this->log->info(
'Not handling direct user creation for auth mode: ' . $auth_mode);
466 if (substr($auth_mode, 0, 4) !==
'ldap') {
467 $this->log->info(
'Not handling direct user creation for auth mode: ' . $auth_mode);
472 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
476 include_once
'./Services/LDAP/classes/class.ilLDAPQuery.php';
482 include_once
'./Services/User/classes/class.ilUserCreationContext.php';
485 include_once
'./Services/LDAP/classes/class.ilLDAPAttributeToUser.php';
487 $xml->setNewUserAuthMode(
$server->getAuthenticationMappingKey());
492 $this->log->error($exc->getMessage());
504 include_once
'./Services/WebServices/ECS/classes/Course/class.ilECSCourseMemberConnector.php';
507 $member = $crs_member_reader->getCourseMember($a_content_id);
521 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
525 $course_member->lectureID
528 include_once
'./Services/WebServices/ECS/classes/Course/class.ilECSCourseConnector.php';
530 return $crs_reader->getCourse($ecs_id);
handleCreate(ilECSSetting $server, $a_content_id)
Handle create.
getMappingSettings()
Get mapping settings.
static _getFirstActiveServer()
Get first active server.
static getRoleMappingInfo($a_role_type_info=0)
Get role mapping info.
__construct(ilECSSetting $server)
Constructor.
lookupRole($role_value, $a_obj_type)
Lookup local role by assignment.
static getInstance()
Get instance.
const IL_LDAP_BIND_DEFAULT
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static getInstanceByServerMid($a_server_id, $a_mid)
Get instance.
static _lookupId($a_user_str)
Lookup id by login.
refreshAssignmentStatus($course_member, $obj_id, $sub_id, $assigned)
Refresh status of course member assignments.
static _lookupTitle($a_id)
lookup object title
const PARALLEL_ONE_COURSE
checkAllocationActivation(ilECSSetting $server, $a_content_id)
Check if course allocation is activated for one recipient of the.
static lookupObjIdByContentId($a_server_id, $a_mid, $a_content_id, $a_sub_id=null)
Lookup obj_id by content id.
static _getAuthModeName($a_auth_key)
Interface for all command queue handler classes.
static getInstanceByServerId($a_server_id)
Get instance by server id.
handleDelete(ilECSSetting $server, $a_content_id)
Handle delete.
createMember($a_person_id)
Create user account.
Synchronize member assignments.
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
doUpdate($a_content_id, $course_member)
Perform update.
static lookupUserIds($a_cms_id, $a_cms_sub_id, $a_obj_id)
Lookup user ids type $ilDB.
readAssignments($course, $course_member)
Read assignments for all parallel groups.
static getInstance($a_server_id, $mid)
Get instance by server id and mid.
static lookupAssignment($a_cms_id, $a_cms_sub_id, $a_obj_id, $a_usr_id)
Lookup assignment of user type $ilDB.
const IL_CRS_ADMIN
Base class for course and group participants.
static lookupEContentIdByContentId($a_server_id, $a_mid, $a_content_id)
Lookup econtent id The econtent id is the unique id from ecs.
Connector for course member ressource.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupType($a_id, $a_reference=false)
lookup object type
const PARALLEL_ALL_COURSES
static _checkExternalAuthAccount($a_auth, $a_account, $tryFallback=true)
check whether external account and authentication method matches with a user
Storage of ecs course assignments.
readCourseMember(ilECSSetting $server, $a_content_id)
Read course from ecs.
handleUpdate(ilECSSetting $server, $a_content_id)
Handle update.
Update/create ILIAS user account by given LDAP attributes according to user attribute mapping setting...
const PARALLEL_GROUPS_IN_COURSE
readCourse($course_member)
Read course from ecs.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.