ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilECSCmsCourseMemberCommandQueueHandler Class Reference

Synchronize member assignments. More...

+ Inheritance diagram for ilECSCmsCourseMemberCommandQueueHandler:
+ Collaboration diagram for ilECSCmsCourseMemberCommandQueueHandler:

Public Member Functions

 __construct (ilECSSetting $server)
 Constructor. More...
 
 getServer ()
 Get server. More...
 
 getMid ()
 get current mid More...
 
 getMappingSettings ()
 Get mapping settings. More...
 
 checkAllocationActivation (ilECSSetting $server, $a_content_id)
 Check if course allocation is activated for one recipient of the. More...
 
 handleCreate (ilECSSetting $server, $a_content_id)
 Handle create. More...
 
 handleDelete (ilECSSetting $server, $a_content_id)
 Handle delete. More...
 
 handleUpdate (ilECSSetting $server, $a_content_id)
 Handle update. More...
 

Protected Member Functions

 doUpdate ($a_content_id, $course_member)
 Perform update. More...
 
 readAssignments ($course, $course_member)
 Read assignments for all parallel groups. More...
 
 refreshAssignmentStatus ($course_member, $obj_id, $sub_id, $assigned)
 Refresh status of course member assignments. More...
 
 lookupRole ($role_value, $a_obj_type)
 Lookup local role by assignment. More...
 

Protected Attributes

 $log
 

Private Member Functions

 createMember ($a_person_id)
 Create user account. More...
 
 readCourseMember (ilECSSetting $server, $a_content_id)
 Read course from ecs. More...
 
 readCourse ($course_member)
 Read course from ecs. More...
 

Private Attributes

 $server = null
 
 $mid = 0
 
 $mapping = null
 

Detailed Description

Synchronize member assignments.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 15 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSCmsCourseMemberCommandQueueHandler::__construct ( ilECSSetting  $server)

Constructor.

Definition at line 30 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References $GLOBALS, and $server.

31  {
32  $this->log = $GLOBALS['DIC']->logger()->wsrv();
33  $this->server = $server;
34  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

Member Function Documentation

◆ checkAllocationActivation()

ilECSCmsCourseMemberCommandQueueHandler::checkAllocationActivation ( ilECSSetting  $server,
  $a_content_id 
)

Check if course allocation is activated for one recipient of the.

Parameters
ilECSSetting$server
type$a_content_id

Definition at line 69 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References ilECSParticipantSetting\getInstance(), ilECSNodeMappingSettings\getInstanceByServerMid(), getMappingSettings(), getMid(), and getServer().

Referenced by handleCreate(), and handleUpdate().

70  {
71  try {
72  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMemberConnector.php';
73  $crsm_reader = new ilECSCourseMemberConnector($server);
74  $details = $crsm_reader->getCourseMember($a_content_id, true);
75  $this->mid = $details->getMySender();
76 
77  // Check if import is enabled
78  include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
79  $part = ilECSParticipantSetting::getInstance($this->getServer()->getServerId(), $this->getMid());
80  if (!$part->isImportEnabled()) {
81  $this->log->warning('Import disabled for mid ' . $this->getMid());
82  return false;
83  }
84  // Check course allocation setting
85  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
87  $this->getServer()->getServerId(),
88  $this->getMid()
89  );
90  return $this->getMappingSettings()->isCourseAllocationEnabled();
91  } catch (ilECSConnectorException $e) {
92  $this->log->error('Reading course member details failed with message ' . $e->getMessage());
93  return false;
94  }
95  }
static getInstanceByServerMid($a_server_id, $a_mid)
Get instance.
static getInstance($a_server_id, $mid)
Get instance by server id and mid.
Connector for course member ressource.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createMember()

ilECSCmsCourseMemberCommandQueueHandler::createMember (   $a_person_id)
private

Create user account.

Parameters
type$a_person_id

Definition at line 452 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References $query, $server, $users, $xml, ilAuthUtils\_getAuthModeName(), ilLDAPServer\_getFirstActiveServer(), AUTH_SHIBBOLETH, ilUserCreationContext\CONTEXT_LDAP, ilUserCreationContext\getInstance(), ilLDAPServer\getInstanceByServerId(), getMappingSettings(), and IL_LDAP_BIND_DEFAULT.

Referenced by refreshAssignmentStatus().

453  {
454  if (!$this->getMappingSettings() instanceof ilECSNodeMappingSettings) {
455  $this->log->warning('Node mapping settings not initialized.');
456  }
457  $auth_mode = $this->getMappingSettings()->getAuthMode();
458 
459  if (
460  $this->getMappingSettings()->getAuthMode() ==
462  ) {
463  $this->log->info('Not handling direct user creation for auth mode: ' . $auth_mode);
464  return false;
465  }
466  if (substr($auth_mode, 0, 4) !== 'ldap') {
467  $this->log->info('Not handling direct user creation for auth mode: ' . $auth_mode);
468  return false;
469  }
470 
471  try {
472  include_once './Services/LDAP/classes/class.ilLDAPServer.php';
474  $server->doConnectionCheck();
475 
476  include_once './Services/LDAP/classes/class.ilLDAPQuery.php';
477  $query = new ilLDAPQuery($server);
479 
480  $users = $query->fetchUser($a_person_id, true);
481  if ($users) {
482  include_once './Services/User/classes/class.ilUserCreationContext.php';
484 
485  include_once './Services/LDAP/classes/class.ilLDAPAttributeToUser.php';
487  $xml->setNewUserAuthMode($server->getAuthenticationMappingKey());
488  $xml->setUserData($users);
489  $xml->refresh();
490  }
491  } catch (ilLDAPQueryException $exc) {
492  $this->log->error($exc->getMessage());
493  }
494  }
static _getFirstActiveServer()
Get first active server.
static getInstance()
Get instance.
const IL_LDAP_BIND_DEFAULT
const AUTH_SHIBBOLETH
static _getAuthModeName($a_auth_key)
static getInstanceByServerId($a_server_id)
Get instance by server id.
$xml
Definition: metadata.php:240
$query
$users
Definition: authpage.php:44
Update/create ILIAS user account by given LDAP attributes according to user attribute mapping setting...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doUpdate()

ilECSCmsCourseMemberCommandQueueHandler::doUpdate (   $a_content_id,
  $course_member 
)
protected

Perform update.

Parameters
type$a_content_id

Definition at line 162 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References array, ilLogLevel\DEBUG, getMid(), getServer(), ilECSImport\lookupObjIdByContentId(), readAssignments(), readCourse(), and refreshAssignmentStatus().

Referenced by handleCreate(), and handleUpdate().

163  {
164  $this->log->debug('Starting ecs member update');
165 
166  $course_id = (int) $course_member->lectureID;
167  if (!$course_id) {
168  $this->log->warning('Missing course id');
169  return false;
170  }
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);
173  //$crs_obj_id = ilECSImport::_lookupObjId($this->getServer()->getServerId(), $course_id, $this->mid);
174  $crs_obj_id = ilECSImport::lookupObjIdByContentId($this->getServer()->getServerId(), $this->mid, $course_id);
175 
176  if (!$crs_obj_id) {
177  $this->log->info('No main course created. Group scenario >= 3 ?');
178  }
179 
180  $course = $this->readCourse($course_member);
181  // Lookup already imported users and update their status
182  $assignments = $this->readAssignments($course, $course_member);
183 
184  $this->log->debug('Parallel group assignments');
185  $this->log->dump($assignments, ilLogLevel::DEBUG);
186  $this->log->debug('------------------ End assignemtns');
187 
188  // iterate through all parallel groups
189  foreach ((array) $assignments as $cms_id => $assigned) {
190  $sub_id = ($cms_id == $course_id) ? null : $cms_id;
191 
192  $this->log->debug('sub id is ' . $sub_id . ' for ' . $cms_id);
193 
194  include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
196  $this->getServer()->getServerId(),
197  $this->getMid(),
198  $course_id,
199  $sub_id
200  );
201 
202  $this->refreshAssignmentStatus($course_member, $obj_id, $sub_id, $assigned);
203  }
204  return true;
205  }
refreshAssignmentStatus($course_member, $obj_id, $sub_id, $assigned)
Refresh status of course member assignments.
static lookupObjIdByContentId($a_server_id, $a_mid, $a_content_id, $a_sub_id=null)
Lookup obj_id by content id.
readAssignments($course, $course_member)
Read assignments for all parallel groups.
Create styles array
The data for the language used.
PHPExcel root directory.
Definition: Database.php:30
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMappingSettings()

ilECSCmsCourseMemberCommandQueueHandler::getMappingSettings ( )

Get mapping settings.

Returns
ilECSnodeMappingSettings

Definition at line 59 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References $mapping.

Referenced by checkAllocationActivation(), createMember(), lookupRole(), and refreshAssignmentStatus().

+ Here is the caller graph for this function:

◆ getMid()

ilECSCmsCourseMemberCommandQueueHandler::getMid ( )

get current mid

Returns
int

Definition at line 49 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References $mid.

Referenced by checkAllocationActivation(), doUpdate(), and readCourse().

+ Here is the caller graph for this function:

◆ getServer()

ilECSCmsCourseMemberCommandQueueHandler::getServer ( )

Get server.

Returns
ilECSServerSetting

Definition at line 40 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References $server.

Referenced by checkAllocationActivation(), doUpdate(), readCourse(), and refreshAssignmentStatus().

+ Here is the caller graph for this function:

◆ handleCreate()

ilECSCmsCourseMemberCommandQueueHandler::handleCreate ( ilECSSetting  $server,
  $a_content_id 
)

Handle create.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

Definition at line 103 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References checkAllocationActivation(), doUpdate(), and readCourseMember().

104  {
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';
108 
109  if (!$this->checkAllocationActivation($server, $a_content_id)) {
110  return true;
111  }
112  try {
113  //$course = $this->readCourse($server, $a_content_id);
114  $course_member = $this->readCourseMember($server, $a_content_id);
115  $this->doUpdate($a_content_id, $course_member);
116  return true;
117  } catch (ilECSConnectorException $e) {
118  $this->log->error('Course member creation failed with mesage ' . $e->getMessage());
119  return false;
120  }
121  return true;
122  }
checkAllocationActivation(ilECSSetting $server, $a_content_id)
Check if course allocation is activated for one recipient of the.
readCourseMember(ilECSSetting $server, $a_content_id)
Read course from ecs.
+ Here is the call graph for this function:

◆ handleDelete()

ilECSCmsCourseMemberCommandQueueHandler::handleDelete ( ilECSSetting  $server,
  $a_content_id 
)

Handle delete.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

Definition at line 129 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

130  {
131  // nothing todo
132  return true;
133  }

◆ handleUpdate()

ilECSCmsCourseMemberCommandQueueHandler::handleUpdate ( ilECSSetting  $server,
  $a_content_id 
)

Handle update.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

Definition at line 140 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References checkAllocationActivation(), doUpdate(), and readCourseMember().

141  {
142  if (!$this->checkAllocationActivation($server, $a_content_id)) {
143  return true;
144  }
145 
146  try {
147  $course_member = $this->readCourseMember($server, $a_content_id);
148  $this->doUpdate($a_content_id, $course_member);
149  return true;
150  } catch (ilECSConnectorException $e) {
151  $this->log->error('Course member update failed with mesage ' . $e->getMessage());
152  return false;
153  }
154  return true;
155  }
checkAllocationActivation(ilECSSetting $server, $a_content_id)
Check if course allocation is activated for one recipient of the.
readCourseMember(ilECSSetting $server, $a_content_id)
Read course from ecs.
+ Here is the call graph for this function:

◆ lookupRole()

ilECSCmsCourseMemberCommandQueueHandler::lookupRole (   $role_value,
  $a_obj_type 
)
protected

Lookup local role by assignment.

Parameters
string$role_value
Returns
int

Definition at line 410 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References $name, array, getMappingSettings(), IL_CRS_ADMIN, IL_CRS_MEMBER, IL_CRS_TUTOR, IL_GRP_ADMIN, and IL_GRP_MEMBER.

Referenced by refreshAssignmentStatus().

411  {
412  $role_mappings = $this->getMappingSettings()->getRoleMappings();
413 
414  /* Zero is an allowed value */
415  if (!$role_value) {
416  $this->log->debug('No role assignment attribute: role');
417  }
418  foreach ($role_mappings as $name => $map) {
419  $this->log->debug('Role "name" is ' . $name);
420 
421  // map is a string of ids seperated by ","
422  $exploded_map = (array) explode(',', $map);
423  if (in_array($role_value, $exploded_map)) {
424  switch ($name) {
425  case IL_CRS_ADMIN:
426  case IL_CRS_TUTOR:
427  case IL_CRS_MEMBER:
428  if ($a_obj_type == 'crs') {
429  $this->log->debug('Role: ' . $role_value . ' maps: ' . $exploded_map);
430  return $name;
431  }
432  break;
433 
434  case IL_GRP_ADMIN:
435  case IL_GRP_MEMBER:
436  if ($a_obj_type == 'grp') {
437  $this->log->debug('Role: ' . $role_value . ' maps: ' . $exploded_map);
438  return $name;
439  }
440  break;
441  }
442  }
443  }
444  $this->log->info('No role assignment mapping for role ' . $role_value);
445  return 0;
446  }
const IL_GRP_ADMIN
const IL_CRS_TUTOR
const IL_GRP_MEMBER
const IL_CRS_MEMBER
if($format !==null) $name
Definition: metadata.php:146
const IL_CRS_ADMIN
Base class for course and group participants.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readAssignments()

ilECSCmsCourseMemberCommandQueueHandler::readAssignments (   $course,
  $course_member 
)
protected

Read assignments for all parallel groups.

Parameters
type$course
type$course_member

Definition at line 212 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References array, ilECSMappingUtils\PARALLEL_ALL_COURSES, ilECSMappingUtils\PARALLEL_GROUPS_IN_COURSE, and ilECSMappingUtils\PARALLEL_ONE_COURSE.

Referenced by doUpdate().

213  {
214  $put_in_course = true;
215 
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;
221  break;
222 
224  $this->log->debug('Parallel group scenario groups in courses.');
225  $put_in_course = false;
226  break;
227 
229  $this->log->debug('Parallel group scenario only courses.');
230  $put_in_course = false;
231  break;
232 
233  default:
234  $this->log->debug('Parallel group scenario undefined.');
235  $put_in_course = true;
236  break;
237  }
238 
239  $course_id = $course_member->lectureID;
240  $assigned = array();
241  foreach ((array) $course_member->members as $member) {
242  $assigned[$course_id][$member->personID] = array(
243  'id' => $member->personID,
244  'role' => $member->role
245  );
246  if ((int) $course->groupScenario == ilECSMappingUtils::PARALLEL_ONE_COURSE) {
247  $this->log->debug('Group scenarion "one course". Ignoring group assignments');
248  continue;
249  }
250 
251  foreach ((array) $member->groups as $pgroup) {
252  // the sequence number in the course ressource
253  $sequence_number = (int) $pgroup->num;
254  // find parallel group with by sequence number
255  $tmp_pgroup = $course->groups[$sequence_number];
256  if (is_object($tmp_pgroup)) {
257  $pgroup_id = $tmp_pgroup->id;
258  }
259  if (strlen($pgroup_id)) {
260  $this->log->debug('Found parallel group with id: ' . $pgroup_id . ': for sequence number: ' . $sequence_number);
261 
262  // @todo check hierarchy of roles
263  $assigned[$pgroup_id][$member->personID] = array(
264  'id' => $member->personID,
265  'role' => $pgroup->role
266  );
267  } else {
268  $this->log->warning('Cannot find parallel group with sequence id: ' . $sequence_number);
269  }
270  }
271  }
272  $this->log->debug('ECS member assignments ' . print_r($assigned, true));
273  return $assigned;
274  }
Create styles array
The data for the language used.
PHPExcel root directory.
Definition: Database.php:30
+ Here is the caller graph for this function:

◆ readCourse()

ilECSCmsCourseMemberCommandQueueHandler::readCourse (   $course_member)
private

Read course from ecs.

Returns
boolean

Definition at line 518 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References getMid(), getServer(), and ilECSImport\lookupEContentIdByContentId().

Referenced by doUpdate().

519  {
520  try {
521  include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
523  $this->getServer()->getServerId(),
524  $this->getMid(),
525  $course_member->lectureID
526  );
527 
528  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseConnector.php';
529  $crs_reader = new ilECSCourseConnector($this->getServer());
530  return $crs_reader->getCourse($ecs_id);
531  } catch (ilECSConnectorException $e) {
532  throw $e;
533  }
534  }
static lookupEContentIdByContentId($a_server_id, $a_mid, $a_content_id)
Lookup econtent id The econtent id is the unique id from ecs.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readCourseMember()

ilECSCmsCourseMemberCommandQueueHandler::readCourseMember ( ilECSSetting  $server,
  $a_content_id 
)
private

Read course from ecs.

Returns
boolean

Definition at line 501 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

Referenced by handleCreate(), and handleUpdate().

502  {
503  try {
504  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMemberConnector.php';
505  $crs_member_reader = new ilECSCourseMemberConnector($server);
506 
507  $member = $crs_member_reader->getCourseMember($a_content_id);
508  return $member;
509  } catch (ilECSConnectorException $e) {
510  throw $e;
511  }
512  }
Connector for course member ressource.
+ Here is the caller graph for this function:

◆ refreshAssignmentStatus()

ilECSCmsCourseMemberCommandQueueHandler::refreshAssignmentStatus (   $course_member,
  $obj_id,
  $sub_id,
  $assigned 
)
protected

Refresh status of course member assignments.

Parameters
object$course_member
int$obj_id

Definition at line 283 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References $type, ilObjUser\_checkExternalAuthAccount(), ilGroupParticipants\_getInstanceByObjId(), ilCourseParticipants\_getInstanceByObjId(), ilObjUser\_lookupId(), ilObject\_lookupTitle(), ilObject\_lookupType(), array, createMember(), getMappingSettings(), ilECSMappingUtils\getRoleMappingInfo(), getServer(), ilECSCourseMemberAssignment\lookupAssignment(), lookupRole(), and ilECSCourseMemberAssignment\lookupUserIds().

Referenced by doUpdate().

284  {
285  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMemberAssignment.php';
286 
287  $this->log->debug('Currrent sub_id = ' . $sub_id . ', obj_id = ' . $obj_id);
288 
289  $type = ilObject::_lookupType($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';
296  } else {
297  $this->log->warning('Invalid object type given for obj_id: ' . $obj_id);
298  return false;
299  }
300 
301  $course_id = (int) $course_member->lectureID;
303  $course_id,
304  $sub_id,
305  $obj_id
306  );
307 
308  // Delete remote deleted
309  foreach ((array) $usr_ids as $usr_id) {
310  if (!isset($assigned[$usr_id])) {
311  $ass = ilECSCourseMemberAssignment::lookupAssignment($course_id, $sub_id, $obj_id, $usr_id);
312  if ($ass instanceof ilECSCourseMemberAssignment) {
314  $this->getMappingSettings()->getAuthMode(),
315  (string) $usr_id
316  );
317 
318  $this->log->debug('Local user assignment: ' . (string) $usr_id . ' <-> ' . $login);
319 
320  if ($il_usr_id = ilObjUser::_lookupId($login)) {
321  // this removes also admin, tutor roles
322  $part->delete($il_usr_id);
323  $this->log->info('Deassigning user ' . $usr_id . ' ' . 'from course ' . ilObject::_lookupTitle($obj_id));
324  } else {
325  $this->log->notice('Deassigning unknown ILIAS user ' . $usr_id . ' ' . 'from course ' . ilObject::_lookupTitle($obj_id));
326  }
327 
328  $ass->delete();
329  }
330  }
331  }
332 
333  $this->log->debug('Handled assignmnent...');
334 
335  // Assign new participants
336  foreach ((array) $assigned as $person_id => $person) {
337  $role = $this->lookupRole($person['role'], $type);
338  $role_info = ilECSMappingUtils::getRoleMappingInfo($role);
339 
340  $this->log->debug('Using role info...');
342  $this->getMappingSettings()->getAuthMode(),
343  (string) $person_id
344  );
345  $this->log->info('Handling user ' . (string) $person_id);
346 
347  if (in_array($person_id, $usr_ids)) {
348  if ($il_usr_id = ilObjUser::_lookupId($login)) {
349  $part->updateRoleAssignments($il_usr_id, array($part->getAutoGeneratedRoleId($role)));
350  } elseif ($role_info['create']) {
351  $this->createMember($person_id);
352  $this->log->info('Added new user ' . $person_id);
354  $this->getMappingSettings()->getAuthMode(),
355  (string) $person_id
356  );
357  if ($role) {
358  if ($il_usr_id = ilObjUser::_lookupId($login)) {
359  $part->add($il_usr_id, $role);
360  $part->sendNotification($part->NOTIFY_ACCEPT_USER, $il_usr_id);
361  }
362  }
363  }
364  } else {
365  if ($il_usr_id = ilObjUser::_lookupId($login)) {
366  // user exists => assign to course/group
367  if ($role) {
368  // Assign user
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);
372  }
373  } else {
374  // no local user exists
375  if ($role_info['create']) {
376  $this->createMember($person_id);
377  $this->log->info('Added new user ' . $person_id);
379  $this->getMappingSettings()->getAuthMode(),
380  (string) $person_id
381  );
382  }
383  // Assign to role
384  if ($role) {
385  if ($il_usr_id = ilObjUser::_lookupId($login)) {
386  $part->add($il_usr_id, $role);
387  $part->sendNotification($part->NOTIFY_ACCEPT_USER, $il_usr_id);
388  }
389  }
390  }
391 
392  $assignment = new ilECSCourseMemberAssignment();
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);
399  $assignment->save();
400  }
401  }
402  return true;
403  }
static getRoleMappingInfo($a_role_type_info=0)
Get role mapping info.
lookupRole($role_value, $a_obj_type)
Lookup local role by assignment.
$type
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupId($a_user_str)
Lookup id by login.
static _lookupTitle($a_id)
lookup object title
static lookupUserIds($a_cms_id, $a_cms_sub_id, $a_obj_id)
Lookup user ids type $ilDB.
static lookupAssignment($a_cms_id, $a_cms_sub_id, $a_obj_id, $a_usr_id)
Lookup assignment of user type $ilDB.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _checkExternalAuthAccount($a_auth, $a_account, $tryFallback=true)
check whether external account and authentication method matches with a user
Storage of ecs course assignments.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $log

ilECSCmsCourseMemberCommandQueueHandler::$log
protected

◆ $mapping

ilECSCmsCourseMemberCommandQueueHandler::$mapping = null
private

◆ $mid

ilECSCmsCourseMemberCommandQueueHandler::$mid = 0
private

Definition at line 23 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

Referenced by getMid().

◆ $server

ilECSCmsCourseMemberCommandQueueHandler::$server = null
private

The documentation for this class was generated from the following file: