ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
73  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMemberConnector.php';
74  $crsm_reader = new ilECSCourseMemberConnector($server);
75  $details = $crsm_reader->getCourseMember($a_content_id,true);
76  $this->mid = $details->getMySender();
77 
78  // Check if import is enabled
79  include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
80  $part = ilECSParticipantSetting::getInstance($this->getServer()->getServerId(), $this->getMid());
81  if(!$part->isImportEnabled())
82  {
83  $this->log->warning('Import disabled for mid '.$this->getMid());
84  return false;
85  }
86  // Check course allocation setting
87  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
89  $this->getServer()->getServerId(),
90  $this->getMid()
91  );
92  return $this->getMappingSettings()->isCourseAllocationEnabled();
93  }
94  catch(ilECSConnectorException $e)
95  {
96  $this->log->error('Reading course member details failed with message '. $e->getMessage());
97  return false;
98  }
99  }
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 506 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

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

Referenced by refreshAssignmentStatus().

507  {
508  if(!$this->getMappingSettings() instanceof ilECSNodeMappingSettings) {
509  $this->log->warning('Node mapping settings not initialized.');
510  }
511  $auth_mode = $this->getMappingSettings()->getAuthMode();
512 
513  if(
514  $this->getMappingSettings()->getAuthMode() ==
516  )
517  {
518  $this->log->info('Not handling direct user creation for auth mode: ' . $auth_mode);
519  return false;
520  }
521  if(substr($auth_mode,0,4) !== 'ldap')
522  {
523  $this->log->info('Not handling direct user creation for auth mode: ' . $auth_mode);
524  return false;
525  }
526 
527  try
528  {
529  include_once './Services/LDAP/classes/class.ilLDAPServer.php';
531  $server->doConnectionCheck();
532 
533  include_once './Services/LDAP/classes/class.ilLDAPQuery.php';
534  $query = new ilLDAPQuery($server);
536 
537  $users = $query->fetchUser($a_person_id,true);
538  if($users)
539  {
540  include_once './Services/User/classes/class.ilUserCreationContext.php';
542 
543  include_once './Services/LDAP/classes/class.ilLDAPAttributeToUser.php';
544  $xml = new ilLDAPAttributeToUser($server);
545  $xml->setNewUserAuthMode($server->getAuthenticationMappingKey());
546  $xml->setUserData($users);
547  $xml->refresh();
548  }
549 
550  }
551  catch (ilLDAPQueryException $exc)
552  {
553  $this->log->error($exc->getMessage());
554  }
555  }
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.
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 174 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

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

Referenced by handleCreate(), and handleUpdate().

175  {
176  $this->log->debug('Starting ecs member update');
177 
178  $course_id = (int) $course_member->lectureID;
179  if(!$course_id)
180  {
181  $this->log->warning('Missing course id');
182  return false;
183  }
184  include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
185  $this->log->debug('sid: '.$this->getServer()->getServerId().' course_id: '.$course_id.' mid: '.$this->mid);
186  //$crs_obj_id = ilECSImport::_lookupObjId($this->getServer()->getServerId(), $course_id, $this->mid);
187  $crs_obj_id = ilECSImport::lookupObjIdByContentId($this->getServer()->getServerId(), $this->mid, $course_id);
188 
189  if(!$crs_obj_id)
190  {
191  $this->log->info('No main course created. Group scenario >= 3 ?');
192  }
193 
194  $course = $this->readCourse($course_member);
195  // Lookup already imported users and update their status
196  $assignments = $this->readAssignments($course,$course_member);
197 
198  $this->log->debug('Parallel group assignments');
199  $this->log->dump($assignments, ilLogLevel::DEBUG);
200  $this->log->debug('------------------ End assignemtns');
201 
202  // iterate through all parallel groups
203  foreach((array) $assignments as $cms_id => $assigned)
204  {
205  $sub_id = ($cms_id == $course_id) ? null : $cms_id;
206 
207  $this->log->debug('sub id is ' . $sub_id .' for ' . $cms_id);
208 
209  include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
211  $this->getServer()->getServerId(),
212  $this->getMid(),
213  $course_id,
214  $sub_id);
215 
216  $this->refreshAssignmentStatus($course_member, $obj_id, $sub_id, $assigned);
217  }
218  return true;
219  }
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.
+ 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 107 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

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

108  {
109  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
110  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
111  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseConnector.php';
112 
113  if(!$this->checkAllocationActivation($server, $a_content_id))
114  {
115  return true;
116  }
117  try
118  {
119  //$course = $this->readCourse($server, $a_content_id);
120  $course_member = $this->readCourseMember($server,$a_content_id);
121  $this->doUpdate($a_content_id,$course_member);
122  return true;
123  }
124  catch(ilECSConnectorException $e)
125  {
126  $this->log->error('Course member creation failed with mesage ' . $e->getMessage());
127  return false;
128  }
129  return true;
130  }
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 137 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

138  {
139  // nothing todo
140  return true;
141  }

◆ handleUpdate()

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

Handle update.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

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

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

149  {
150  if(!$this->checkAllocationActivation($server, $a_content_id))
151  {
152  return true;
153  }
154 
155  try
156  {
157  $course_member = $this->readCourseMember($server,$a_content_id);
158  $this->doUpdate($a_content_id, $course_member);
159  return true;
160  }
161  catch(ilECSConnectorException $e)
162  {
163  $this->log->error('Course member update failed with mesage ' . $e->getMessage());
164  return false;
165  }
166  return true;
167  }
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 458 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

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

Referenced by refreshAssignmentStatus().

459  {
460  $role_mappings = $this->getMappingSettings()->getRoleMappings();
461 
462  /* Zero is an allowed value */
463  if(!$role_value)
464  {
465  $this->log->debug('No role assignment attribute: role');
466  }
467  foreach($role_mappings as $name => $map)
468  {
469  $this->log->debug('Role "name" is ' . $name);
470 
471  // map is a string of ids seperated by ","
472  $exploded_map = (array) explode(',', $map);
473  if(in_array($role_value, $exploded_map))
474  {
475  switch($name)
476  {
477  case IL_CRS_ADMIN:
478  case IL_CRS_TUTOR:
479  case IL_CRS_MEMBER:
480  if($a_obj_type == 'crs')
481  {
482  $this->log->debug('Role: ' . $role_value. ' maps: ' . $exploded_map);
483  return $name;
484  }
485  break;
486 
487  case IL_GRP_ADMIN:
488  case IL_GRP_MEMBER:
489  if($a_obj_type == 'grp')
490  {
491  $this->log->debug('Role: ' . $role_value. ' maps: ' . $exploded_map);
492  return $name;
493  }
494  break;
495  }
496  }
497  }
498  $this->log->info('No role assignment mapping for role ' . $role_value);
499  return 0;
500  }
const IL_GRP_ADMIN
const IL_CRS_TUTOR
const IL_GRP_MEMBER
const IL_CRS_MEMBER
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 226 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

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

Referenced by doUpdate().

227  {
228  $put_in_course = true;
229 
230  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
231  switch((int) $course->groupScenario)
232  {
234  $this->log->debug('Parallel group scenario one course.');
235  $put_in_course = true;
236  break;
237 
239  $this->log->debug('Parallel group scenario groups in courses.');
240  $put_in_course = false;
241  break;
242 
244  $this->log->debug('Parallel group scenario only courses.');
245  $put_in_course = false;
246  break;
247 
248  default:
249  $this->log->debug('Parallel group scenario undefined.');
250  $put_in_course = true;
251  break;
252  }
253 
254  $course_id = $course_member->lectureID;
255  $assigned = array();
256  foreach((array) $course_member->members as $member)
257  {
258  $assigned[$course_id][$member->personID] = array(
259  'id' => $member->personID,
260  'role' => $member->role
261  );
262  if((int) $course->groupScenario == ilECSMappingUtils::PARALLEL_ONE_COURSE)
263  {
264  $this->log->debug('Group scenarion "one course". Ignoring group assignments');
265  continue;
266  }
267 
268  foreach((array) $member->groups as $pgroup)
269  {
270  // the sequence number in the course ressource
271  $sequence_number = (int) $pgroup->num;
272  // find parallel group with by sequence number
273  $tmp_pgroup = $course->groups[$sequence_number];
274  if(is_object($tmp_pgroup))
275  {
276  $pgroup_id = $tmp_pgroup->id;
277  }
278  if(strlen($pgroup_id))
279  {
280  $this->log->debug('Found parallel group with id: '. $pgroup_id. ': for sequence number: '.$sequence_number);
281 
282  // @todo check hierarchy of roles
283  $assigned[$pgroup_id][$member->personID] = array(
284  'id' => $member->personID,
285  'role' => $pgroup->role
286  );
287  }
288  else
289  {
290  $this->log->warning('Cannot find parallel group with sequence id: ' . $sequence_number);
291  }
292  }
293  }
294  $this->log->debug('ECS member assignments '.print_r($assigned,true));
295  return $assigned;
296  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ readCourse()

ilECSCmsCourseMemberCommandQueueHandler::readCourse (   $course_member)
private

Read course from ecs.

Returns
boolean

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

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

Referenced by doUpdate().

583  {
584  try
585  {
586  include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
588  $this->getServer()->getServerId(),
589  $this->getMid(),
590  $course_member->lectureID
591  );
592 
593  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseConnector.php';
594  $crs_reader = new ilECSCourseConnector($this->getServer());
595  return $crs_reader->getCourse($ecs_id);
596  }
597  catch(ilECSConnectorException $e)
598  {
599  throw $e;
600  }
601  }
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 562 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

Referenced by handleCreate(), and handleUpdate().

563  {
564  try
565  {
566  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMemberConnector.php';
567  $crs_member_reader = new ilECSCourseMemberConnector($server);
568 
569  $member = $crs_member_reader->getCourseMember($a_content_id);
570  return $member;
571  }
572  catch(ilECSConnectorException $e)
573  {
574  throw $e;
575  }
576  }
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 305 of file class.ilECSCmsCourseMemberCommandQueueHandler.php.

References 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().

306  {
307  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMemberAssignment.php';
308 
309  $this->log->debug('Currrent sub_id = ' . $sub_id.', obj_id = ' . $obj_id);
310 
311  $type = ilObject::_lookupType($obj_id);
312  if($type == 'crs')
313  {
314  include_once './Modules/Course/classes/class.ilCourseParticipants.php';
316  }
317  elseif($type == 'grp')
318  {
319  include_once './Modules/Group/classes/class.ilGroupParticipants.php';
321  }
322  else
323  {
324  $this->log->warning('Invalid object type given for obj_id: ' . $obj_id);
325  return false;
326  }
327 
328  $course_id = (int) $course_member->lectureID;
330  $course_id,
331  $sub_id,
332  $obj_id);
333 
334  // Delete remote deleted
335  foreach((array) $usr_ids as $usr_id)
336  {
337  if(!isset($assigned[$usr_id]))
338  {
339  $ass = ilECSCourseMemberAssignment::lookupAssignment($course_id, $sub_id,$obj_id, $usr_id);
340  if($ass instanceof ilECSCourseMemberAssignment)
341  {
343  $this->getMappingSettings()->getAuthMode(),
344  (string) $usr_id
345  );
346 
347  $this->log->debug('Local user assignment: ' . (string) $usr_id .' <-> ' . $login);
348 
349  if($il_usr_id = ilObjUser::_lookupId($login))
350  {
351  // this removes also admin, tutor roles
352  $part->delete($il_usr_id);
353  $this->log->info('Deassigning user ' . $usr_id. ' '. 'from course '. ilObject::_lookupTitle($obj_id));
354  }
355  else
356  {
357  $this->log->notice('Deassigning unknown ILIAS user ' . $usr_id. ' '. 'from course '. ilObject::_lookupTitle($obj_id));
358  }
359 
360  $ass->delete();
361  }
362  }
363  }
364 
365  $this->log->debug('Handled assignmnent...');
366 
367  // Assign new participants
368  foreach((array) $assigned as $person_id => $person)
369  {
370  $role = $this->lookupRole($person['role'],$type);
371  $role_info = ilECSMappingUtils::getRoleMappingInfo($role);
372 
373  $this->log->debug('Using role info...');
375  $this->getMappingSettings()->getAuthMode(),
376  (string) $person_id
377  );
378  $this->log->info('Handling user '. (string) $person_id);
379 
380  if(in_array($person_id, $usr_ids))
381  {
382  if($il_usr_id = ilObjUser::_lookupId($login))
383  {
384  $part->updateRoleAssignments($il_usr_id, array($part->getAutoGeneratedRoleId($role)));
385  }
386  elseif($role_info['create'])
387  {
388  $this->createMember($person_id);
389  $this->log->info('Added new user '. $person_id);
391  $this->getMappingSettings()->getAuthMode(),
392  (string) $person_id
393  );
394  if($role)
395  {
396  if($il_usr_id = ilObjUser::_lookupId($login))
397  {
398  $part->add($il_usr_id,$role);
399  $part->sendNotification($part->NOTIFY_ACCEPT_USER, $il_usr_id);
400  }
401  }
402  }
403  }
404  else
405  {
406  if($il_usr_id = ilObjUser::_lookupId($login))
407  {
408  // user exists => assign to course/group
409  if($role)
410  {
411  // Assign user
412  $this->log->info('Assigning new user ' . $person_id. ' '. 'to '. ilObject::_lookupTitle($obj_id).' using role: ' . $role);
413  $part->add($il_usr_id,$role);
414  $part->sendNotification($part->NOTIFY_ACCEPT_USER, $il_usr_id);
415  }
416  }
417  else
418  {
419  // no local user exists
420  if($role_info['create'])
421  {
422  $this->createMember($person_id);
423  $this->log->info('Added new user '. $person_id);
425  $this->getMappingSettings()->getAuthMode(),
426  (string) $person_id
427  );
428  }
429  // Assign to role
430  if($role)
431  {
432  if($il_usr_id = ilObjUser::_lookupId($login))
433  {
434  $part->add($il_usr_id,$role);
435  $part->sendNotification($part->NOTIFY_ACCEPT_USER, $il_usr_id);
436  }
437  }
438  }
439 
440  $assignment = new ilECSCourseMemberAssignment();
441  $assignment->setServer($this->getServer()->getServerId());
442  $assignment->setMid($this->mid);
443  $assignment->setCmsId($course_id);
444  $assignment->setCmsSubId($sub_id);
445  $assignment->setObjId($obj_id);
446  $assignment->setUid($person_id);
447  $assignment->save();
448  }
449  }
450  return true;
451  }
static getRoleMappingInfo($a_role_type_info=0)
Get role mapping info.
lookupRole($role_value, $a_obj_type)
Lookup local role by assignment.
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
Storage of ecs course assignments.
static _checkExternalAuthAccount($a_auth, $a_account)
check whether external account and authentication method matches with a user
+ 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: