ILIAS  trunk Revision v12.0_alpha-1338-g8f7e531aa3c
class.ilParticipants.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
30abstract class ilParticipants
31{
32 public const IL_CRS_ADMIN = 1;
33 public const IL_CRS_TUTOR = 3;
34 public const IL_CRS_MEMBER = 2;
35 public const IL_GRP_ADMIN = 4;
36 public const IL_GRP_MEMBER = 5;
37 public const IL_SESS_MEMBER = 6;
38 public const IL_LSO_ADMIN = 7;
39 public const IL_LSO_MEMBER = 8;
40 public const IL_ROLE_POSITION_ADMIN = 1;
41 public const IL_ROLE_POSITION_TUTOR = 2;
42 public const IL_ROLE_POSITION_MEMBER = 3;
43
44 protected string $component = '';
45 protected int $ref_id = 0;
46 protected int $obj_id = 0;
47 protected string $type = '';
48 protected array $roles = [];
49 protected array $role_data = [];
50 protected array $roles_sorted = [];
51 protected array $role_assignments = [];
52 protected array $participants = [];
53 protected array $participants_status = [];
54 protected array $members = [];
55 protected array $tutors = [];
56 protected array $admins = [];
57 protected array $subscribers = [];
63 protected ilLanguage $lng;
64 protected ilLogger $logger;
67
72 public function __construct(string $a_component_name, int $a_ref_id)
73 {
74 global $DIC;
75
76 $this->ilDB = $DIC->database();
77 $this->lng = $DIC->language();
78 $this->logger = $DIC->logger()->mmbr();
79 $this->eventHandler = $DIC->event();
80 $this->rbacReview = $DIC->rbac()->review();
81 $this->rbacAdmin = $DIC->rbac()->admin();
82 $this->objectDataCache = $DIC['ilObjDataCache'];
83 $this->error = $DIC['ilErr'];
84 $this->component = $a_component_name;
85 $this->ref_id = $a_ref_id;
86 $this->obj_id = ilObject::_lookupObjId($a_ref_id);
87 $this->type = ilObject::_lookupType($this->obj_id);
88 $this->recommended_content_manager = new ilRecommendedContentManager();
89
90 $this->readParticipants();
92 }
93
94 public static function getInstance(int $a_ref_id): ilParticipants
95 {
96 global $DIC;
97
98 $logger = $DIC->logger()->mmbr();
99
100 $obj_id = ilObject::_lookupObjId($a_ref_id);
102
103 switch ($type) {
104 case 'crs':
105 case 'grp':
106 case 'lso':
108 case 'sess':
109 return ilSessionParticipants::getInstance($a_ref_id);
110 default:
111 $logger->logStack();
112 $logger->warning('Invalid ref_id -> obj_id given: ' . $a_ref_id . ' -> ' . $obj_id);
113 throw new InvalidArgumentException('Invalid obj_id given.');
114 }
115 }
116
122 public static function getInstanceByObjId(int $a_obj_id): ilParticipants
123 {
124 global $DIC;
125
126 $logger = $DIC->logger()->mmbr();
127
128 $type = ilObject::_lookupType($a_obj_id);
129 switch ($type) {
130 case 'crs':
132
133 case 'grp':
135
136 case 'sess':
138 case 'lso':
140 default:
142 $logger()->mmbr()->warning(': Invalid obj_id given: ' . $a_obj_id);
143 throw new InvalidArgumentException('Invalid obj id given');
144 }
145 }
146
151 protected function getComponent(): string
152 {
153 return $this->component;
154 }
155
159 public static function hasParticipantListAccess(int $a_obj_id, ?int $a_usr_id = null): bool
160 {
161 global $DIC;
162
163 $access = $DIC->access();
164
165 if (!$a_usr_id) {
166 $a_usr_id = $DIC->user()->getId();
167 }
168
169 // if write access granted => return true
170 $refs = ilObject::_getAllReferences($a_obj_id);
171 $ref_id = end($refs);
172
173 if ($access->checkAccess('manage_members', '', $ref_id)) {
174 return true;
175 }
176 $part = self::getInstance($ref_id);
177 if ($part->isAssigned($a_usr_id)) {
178 if ($part->getType() === 'crs') {
180 return false;
181 }
182 }
183 if ($part->getType() === 'grp') {
184 if (!ilObjGroup::lookupShowMembersEnabled($a_obj_id)) {
185 return false;
186 }
187 }
188 return true;
189 }
190 // User is not assigned to course/group => no read access
191 return false;
192 }
193
198 public static function canSendMailToMembers(
199 int|ilObject $ref_id_or_instance,
200 ?int $usr_id = null,
201 ?int $mail_obj_ref_id = null
202 ): bool {
203 global $DIC;
204
205 $access = $DIC->access();
206 $rbacsystem = $DIC->rbac()->system();
207
208 if (is_null($usr_id)) {
209 $usr_id = $DIC->user()->getId();
210 }
211 if (is_null($mail_obj_ref_id)) {
212 $mail_obj_ref_id = (new ilMail($usr_id))->getMailObjectReferenceId();
213 }
214 if (is_int($ref_id_or_instance)) {
215 $ref_id = $ref_id_or_instance;
216 } elseif ($ref_id_or_instance instanceof ilObject) {
217 $ref_id = (int) $ref_id_or_instance->getRefId();
218 if ($ref_id === 0) {
219 $ref_id = array_keys(ilObject::_getAllReferences($ref_id_or_instance->getId()))[0];
220 }
221 } else {
222 return false;
223 }
224
225 if (
226 $access->checkAccess('manage_members', '', $ref_id) &&
227 $rbacsystem->checkAccess('internal_mail', $mail_obj_ref_id)
228 ) {
229 return true;
230 }
231
232 $part = self::getInstance($ref_id);
233 if (!$part->isAssigned($usr_id)) {
234 return false;
235 }
236
237 $object = $ref_id_or_instance;
238 if (is_int($ref_id_or_instance)) {
239 $object = ilObjectFactory::getInstanceByRefId($ref_id_or_instance);
240 }
241
242 if ($object instanceof ilObjCourse) {
243 return $object->getMailToMembersType() == ilCourseConstants::MAIL_ALLOWED_ALL;
244 } elseif ($object instanceof ilObjGroup) {
245 return $object->getMailToMembersType() == ilObjGroup::MAIL_ALLOWED_ALL;
246 } elseif ($object instanceof ilObjSession) {
247 return $object->getMailToMembersType() == ilObjSession::MAIL_ALLOWED_ALL;
248 }
249
250 return false;
251 }
252
253
258 array $a_user_ids,
259 array $a_type,
260 bool $a_only_member_roles
261 ): array {
262 global $DIC;
263
264 $ilDB = $DIC->database();
265
266 $j2 = $a2 = '';
267 if ($a_only_member_roles) {
268 $j2 = "JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id) ";
269 $a2 = 'AND obd2.title = ' . $ilDB->concat(
270 array(
271 array($ilDB->quote('il_', 'text')),
272 array('obd.type'),
273 array($ilDB->quote('_member_', 'text')),
274 array('obr.ref_id'),
275 ),
276 false
277 );
278 }
279
280 $query = "SELECT DISTINCT obd.obj_id,obr.ref_id,ua.usr_id FROM rbac_ua ua " .
281 "JOIN rbac_fa fa ON ua.rol_id = fa.rol_id " .
282 "JOIN object_reference obr ON fa.parent = obr.ref_id " .
283 "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
284 $j2 .
285 "WHERE " . $ilDB->in("obd.type", $a_type, false, "text") .
286 "AND fa.assign = 'y' " .
287 'AND ' . $ilDB->in('ua.usr_id', $a_user_ids, false, 'integer') . ' ' .
288 $a2;
289
290 $obj_ids = [];
291 $res = $ilDB->query($query);
292 while ($row = $ilDB->fetchObject($res)) {
293 $obj_ids[(int) $row->obj_id][] = (int) $row->usr_id;
294 }
295 return $obj_ids;
296 }
297
305 public static function _getMembershipByType(
306 int $a_usr_id,
307 array $a_type,
308 bool $a_only_member_role = false
309 ): array {
310 global $DIC;
311
312 $ilDB = $DIC['ilDB'];
313
314 $j2 = '';
315 $a2 = '';
316 // this will also dismiss local roles!
317 if ($a_only_member_role) {
318 $j2 = "JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id) ";
319 $a2 = 'AND obd2.title = ' . $ilDB->concat(
320 array(
321 array($ilDB->quote('il_', 'text')),
322 array('obd.type'),
323 array($ilDB->quote('_member_', 'text')),
324 array('obr.ref_id'),
325 ),
326 false
327 );
328 }
329
330 // #14290 - no role folder anymore
331 $query = "SELECT DISTINCT obd.obj_id,obr.ref_id FROM rbac_ua ua " .
332 "JOIN rbac_fa fa ON ua.rol_id = fa.rol_id " .
333 "JOIN object_reference obr ON fa.parent = obr.ref_id " .
334 "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
335 $j2 .
336 "WHERE " . $ilDB->in("obd.type", $a_type, false, "text") . ' ' .
337 "AND fa.assign = 'y' " .
338 "AND ua.usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " " .
339 'AND obr.deleted IS NULL ' .
340 $a2;
341 $res = $ilDB->query($query);
342 $ref_ids = [];
343 while ($row = $ilDB->fetchObject($res)) {
344 $ref_ids[] = (int) $row->obj_id;
345 }
346 return $ref_ids;
347 }
348
352 public static function _isParticipant(int $a_ref_id, int $a_usr_id): bool
353 {
354 global $DIC;
355
356 $rbacreview = $DIC->rbac()->review();
357 $local_roles = $rbacreview->getRolesOfRoleFolder($a_ref_id, false);
358 return $rbacreview->isAssignedToAtLeastOneGivenRole($a_usr_id, $local_roles);
359 }
360
364 public static function lookupNumberOfParticipants(int $a_ref_id): int
365 {
366 global $DIC;
367
368 $rbacreview = $DIC->rbac()->review();
369 $lroles = $rbacreview->getRolesOfRoleFolder($a_ref_id, false);
370 return $rbacreview->getNumberOfAssignedUsers($lroles);
371 }
372
376 public static function lookupNumberOfMembers(int $a_ref_id): int
377 {
378 global $DIC;
379
380 $rbacreview = $DIC->rbac()->review();
381 $ilObjDataCache = $DIC['ilObjDataCache'];
382 $has_policies = $rbacreview->getLocalPolicies($a_ref_id);
383 if (!$has_policies) {
384 return 0;
385 }
386 $lroles = $rbacreview->getRolesOfRoleFolder($a_ref_id, false);
387 $memberRoles = array();
388 foreach ($lroles as $role_id) {
389 $title = $ilObjDataCache->lookupTitle($role_id);
390 switch (substr($title, 0, 8)) {
391 case 'il_crs_a':
392 case 'il_crs_t':
393 case 'il_grp_a':
394 break;
395
396 default:
397 $memberRoles[] = $role_id;
398 break;
399 }
400 }
401 return $rbacreview->getNumberOfAssignedUsers($memberRoles);
402 }
403
407 public static function _isBlocked(int $a_obj_id, int $a_usr_id): bool
408 {
409 global $DIC;
410
411 $ilDB = $DIC->database();
412 $query = "SELECT * FROM obj_members " .
413 "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
414 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " " .
415 "AND blocked = " . $ilDB->quote(1, 'integer');
416 $res = $ilDB->query($query);
417 return (bool) $res->numRows();
418 }
419
423 public static function _hasPassed(int $a_obj_id, int $a_usr_id): bool
424 {
425 global $DIC;
426
427 $ilDB = $DIC->database();
428 $query = "SELECT * FROM obj_members " .
429 "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
430 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " " .
431 "AND passed = '1'";
432 $res = $ilDB->query($query);
433 return (bool) $res->numRows();
434 }
435
440 public static function _deleteAllEntries(int $a_obj_id): void
441 {
442 global $DIC;
443
444 $ilDB = $DIC->database();
445 $query = "DELETE FROM obj_members " .
446 "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
447 $res = $ilDB->manipulate($query);
448
449 $query = "DELETE FROM il_subscribers " .
450 "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
451 $res = $ilDB->manipulate($query);
452
453 $query = 'DELETE FROM crs_waiting_list ' .
454 'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
455 $ilDB->manipulate($query);
456 }
457
461 public static function _deleteUser(int $a_usr_id): void
462 {
463 global $DIC;
464
465 $ilDB = $DIC->database();
466 $query = "DELETE FROM obj_members WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer');
467 $res = $ilDB->manipulate($query);
468
469 $query = "DELETE FROM il_subscribers WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer');
470 $res = $ilDB->manipulate($query);
471
473 }
474
475 public static function getDefaultMemberRole(int $a_ref_id): int
476 {
477 global $DIC;
478
479 $rbacreview = $DIC->rbac()->review();
480
481 $obj_id = ilObject::_lookupObjId($a_ref_id);
482 $type = ilObject::_lookupType($obj_id);
483
484 if (!in_array($type, array('crs', 'grp'))) {
485 return 0;
486 }
487
488 $roles = $rbacreview->getRolesOfRoleFolder($a_ref_id, false);
489 foreach ($roles as $role) {
490 $title = ilObject::_lookupTitle($role);
491 if (strpos($title, ('il_' . $type . '_member')) === 0) {
492 return $role;
493 }
494 }
495 return 0;
496 }
497
498 public function getObjId(): int
499 {
500 return $this->obj_id;
501 }
502
503 public function getType(): string
504 {
505 return $this->type;
506 }
507
512 public function getNotificationRecipients(): array
513 {
514 $query = "SELECT * FROM obj_members " .
515 "WHERE notification = 1 " .
516 "AND obj_id = " . $this->ilDB->quote($this->obj_id, ilDBConstants::T_INTEGER) . " ";
517 $res = $this->ilDB->query($query);
518 $recp = [];
519 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
520 if ($this->isAdmin((int) $row->usr_id) || $this->isTutor((int) $row->usr_id)) {
521 $recp[] = (int) $row->usr_id;
522 }
523 }
524 return $recp;
525 }
526
530 public function getCountMembers(): int
531 {
532 return count($this->members);
533 }
534
538 public function getCountParticipants(): int
539 {
540 return count($this->participants);
541 }
542
547 public function getParticipants(): array
548 {
549 return $this->participants;
550 }
551
557 public function getMembers(): array
558 {
559 return $this->members;
560 }
561
566 public function getAdmins(): array
567 {
568 return $this->admins;
569 }
570
571 public function getCountAdmins(): int
572 {
573 return count($this->getAdmins());
574 }
575
580 public function getTutors(): array
581 {
582 return $this->tutors;
583 }
584
588 public function isAdmin(int $a_usr_id): bool
589 {
590 return in_array($a_usr_id, $this->admins);
591 }
592
596 public function isTutor(int $a_usr_id): bool
597 {
598 return in_array($a_usr_id, $this->tutors);
599 }
600
604 public function isMember(int $a_usr_id): bool
605 {
606 return in_array($a_usr_id, $this->members);
607 }
608
612 public function isAssigned(int $a_usr_id): bool
613 {
614 return in_array($a_usr_id, $this->participants);
615 }
616
620 public function isLastAdmin(int $a_usr_id): bool
621 {
622 return in_array($a_usr_id, $this->getAdmins()) && count($this->getAdmins()) === 1;
623 }
624
628 public function getRoles(): array
629 {
630 return $this->roles;
631 }
632
636 public function getAssignedRoles(int $a_usr_id): array
637 {
638 $assigned = [];
639 foreach ($this->roles as $role) {
640 if ($this->rbacReview->isAssigned($a_usr_id, $role)) {
641 $assigned[] = $role;
642 }
643 }
644 return $assigned;
645 }
646
653 public function updateRoleAssignments($a_usr_id, $a_roles): void
654 {
655 foreach ($this->getRoles() as $role_id) {
656 if ($this->rbacReview->isAssigned($a_usr_id, $role_id)) {
657 if (!in_array($role_id, $a_roles)) {
658 $this->rbacAdmin->deassignUser($role_id, $a_usr_id);
659 }
660 } elseif (in_array($role_id, $a_roles)) {
661 $this->rbacAdmin->assignUser($role_id, $a_usr_id);
662 }
663 }
664 $this->rbacReview->clearCaches();
665 $this->readParticipants();
666 $this->readParticipantsStatus();
667 }
668
675 public function checkLastAdmin(array $a_usr_ids): bool
676 {
677 foreach ($this->getAdmins() as $admin_id) {
678 if (!in_array($admin_id, $a_usr_ids)) {
679 return true;
680 }
681 }
682 return false;
683 }
684
688 public function isBlocked(int $a_usr_id): bool
689 {
690 if (isset($this->participants_status[$a_usr_id])) {
691 return (bool) ($this->participants_status[$a_usr_id]['blocked'] ?? false);
692 }
693 return false;
694 }
695
699 public function hasPassed(int $a_usr_id): bool
700 {
701 if (isset($this->participants_status[$a_usr_id])) {
702 return (bool) ($this->participants_status[$a_usr_id]['passed'] ?? false);
703 }
704 return false;
705 }
706
710 public function delete(int $a_usr_id): void
711 {
712 $this->recommended_content_manager->removeObjectRecommendation($a_usr_id, $this->ref_id);
713 foreach ($this->roles as $role_id) {
714 $this->rbacAdmin->deassignUser($role_id, $a_usr_id);
715 }
716
717 $query = "DELETE FROM obj_members " .
718 "WHERE usr_id = " . $this->ilDB->quote($a_usr_id, 'integer') . " " .
719 "AND obj_id = " . $this->ilDB->quote($this->obj_id, 'integer');
720 $res = $this->ilDB->manipulate($query);
721
722 $this->readParticipants();
723 $this->readParticipantsStatus();
724
725 $this->eventHandler->raise(
726 $this->getComponent(),
727 "deleteParticipant",
728 [
729 'obj_id' => $this->obj_id,
730 'usr_id' => $a_usr_id
731 ]
732 );
733 }
734
738 public function updateBlocked(int $a_usr_id, bool $a_blocked): void
739 {
740 $this->participants_status[$a_usr_id]['blocked'] = (int) $a_blocked;
741 $query = "SELECT * FROM obj_members " .
742 "WHERE obj_id = " . $this->ilDB->quote($this->obj_id, 'integer') . " " .
743 "AND usr_id = " . $this->ilDB->quote($a_usr_id, 'integer');
744 $res = $this->ilDB->query($query);
745 if ($res->numRows()) {
746 $query = "UPDATE obj_members SET " .
747 "blocked = " . $this->ilDB->quote((int) $a_blocked, 'integer') . " " .
748 "WHERE obj_id = " . $this->ilDB->quote($this->obj_id, 'integer') . " " .
749 "AND usr_id = " . $this->ilDB->quote($a_usr_id, 'integer');
750 } else {
751 $query = "INSERT INTO obj_members (blocked,obj_id,usr_id,notification,passed) " .
752 "VALUES ( " .
753 $this->ilDB->quote((int) $a_blocked, 'integer') . ", " .
754 $this->ilDB->quote($this->obj_id, 'integer') . ", " .
755 $this->ilDB->quote($a_usr_id, 'integer') . ", " .
756 $this->ilDB->quote(0, 'integer') . ", " .
757 $this->ilDB->quote(0, 'integer') .
758 ") ON DUPLICATE KEY UPDATE blocked = VALUES(blocked)";
759 }
760 $res = $this->ilDB->manipulate($query);
761 }
762
763 public function updateContact(int $a_usr_id, bool $a_contact): void
764 {
765 $this->ilDB->manipulate(
766 'UPDATE obj_members SET ' .
767 'contact = ' . $this->ilDB->quote($a_contact, 'integer') . ' ' .
768 'WHERE obj_id = ' . $this->ilDB->quote($this->obj_id, 'integer') . ' ' .
769 'AND usr_id = ' . $this->ilDB->quote($a_usr_id, 'integer')
770 );
771 $this->participants_status[$a_usr_id]['contact'] = $a_contact;
772 }
773
778 public function getContacts(): array
779 {
780 $contacts = array();
781 foreach ($this->participants_status as $usr_id => $status) {
782 if ($status['contact']) {
783 $contacts[] = (int) $usr_id;
784 }
785 }
786 return $contacts;
787 }
788
792 public function updateNotification(int $a_usr_id, bool $a_notification): void
793 {
794 $this->participants_status[$a_usr_id]['notification'] = $a_notification;
795
796 $query = "SELECT * FROM obj_members " .
797 "WHERE obj_id = " . $this->ilDB->quote($this->obj_id, 'integer') . " " .
798 "AND usr_id = " . $this->ilDB->quote($a_usr_id, 'integer');
799 $res = $this->ilDB->query($query);
800 if ($res->numRows()) {
801 $query = "UPDATE obj_members SET " .
802 "notification = " . $this->ilDB->quote((int) $a_notification, 'integer') . " " .
803 "WHERE obj_id = " . $this->ilDB->quote($this->obj_id, 'integer') . " " .
804 "AND usr_id = " . $this->ilDB->quote($a_usr_id, 'integer');
805 } else {
806 $query = "INSERT INTO obj_members (notification,obj_id,usr_id,passed,blocked) " .
807 "VALUES ( " .
808 $this->ilDB->quote((int) $a_notification, 'integer') . ", " .
809 $this->ilDB->quote($this->obj_id, 'integer') . ", " .
810 $this->ilDB->quote($a_usr_id, 'integer') . ", " .
811 $this->ilDB->quote(0, 'integer') . ", " .
812 $this->ilDB->quote(0, 'integer') .
813 ") ON DUPLICATE KEY UPDATE notification = VALUES(notification)";
814 }
815 $res = $this->ilDB->manipulate($query);
816 }
817
818 public function add(int $a_usr_id, int $a_role): bool
819 {
820 if ($this->isAssigned($a_usr_id)) {
821 return false;
822 }
823
824 switch ($a_role) {
825 case self::IL_LSO_ADMIN:
826 case self::IL_GRP_ADMIN:
827 case self::IL_CRS_ADMIN:
828 $this->admins[] = $a_usr_id;
829 break;
830
831 case self::IL_CRS_TUTOR:
832 $this->tutors[] = $a_usr_id;
833 break;
834
835 case self::IL_SESS_MEMBER:
836 case self::IL_LSO_MEMBER:
837 case self::IL_GRP_MEMBER:
838 case self::IL_CRS_MEMBER:
839 $this->members[] = $a_usr_id;
840 break;
841 }
842
843 $this->participants[] = $a_usr_id;
844 $this->rbacAdmin->assignUser($this->role_data[$a_role], $a_usr_id);
845
846 // Delete subscription request
847 $this->deleteSubscriber($a_usr_id);
848
849 ilWaitingList::deleteUserEntry($a_usr_id, $this->obj_id);
850
851 $this->eventHandler->raise(
852 $this->getComponent(),
853 "addParticipant",
854 array(
855 'obj_id' => $this->obj_id,
856 'usr_id' => $a_usr_id,
857 'role_id' => $a_role
858 )
859 );
860 return true;
861 }
862
866 public function deleteParticipants(array $a_user_ids): bool
867 {
868 foreach ($a_user_ids as $user_id) {
869 $this->delete($user_id);
870 }
871 return true;
872 }
873
878 public function addRecommendation(int $a_usr_id): void
879 {
880 // deactivated for now, see discussion at
881 // https://docu.ilias.de/goto_docu_wiki_wpage_5620_1357.html
882 // $this->recommended_content_manager->addObjectRecommendation($a_usr_id, $this->ref_id);
883 }
884
885 public function isNotificationEnabled(int $a_usr_id): bool
886 {
887 if (isset($this->participants_status[$a_usr_id])) {
888 return (bool) ($this->participants_status[$a_usr_id]['notification'] ?? false);
889 }
890 return false;
891 }
892
893 public function isContact(int $a_usr_id): bool
894 {
895 if (isset($this->participants_status[$a_usr_id])) {
896 return (bool) ($this->participants_status[$a_usr_id]['contact'] ?? false);
897 }
898 return false;
899 }
900
901 public function getAutoGeneratedRoleId(int $a_role_type): int
902 {
903 if (array_key_exists($a_role_type, $this->role_data)) {
904 return $this->role_data[$a_role_type];
905 }
906 return 0;
907 }
908
909 protected function readParticipants(): void
910 {
911 $this->roles = $this->rbacReview->getRolesOfRoleFolder($this->ref_id, false);
912 $this->participants = [];
913 $this->members = $this->admins = $this->tutors = [];
914
915 $additional_roles = [];
916 $auto_generated_roles = [];
917 foreach ($this->roles as $role_id) {
918 $title = $this->objectDataCache->lookupTitle($role_id);
919 switch (substr($title, 0, 8)) {
920 case 'il_crs_m':
921 $auto_generated_roles[$role_id] = self::IL_ROLE_POSITION_MEMBER;
922 $this->role_data[self::IL_CRS_MEMBER] = $role_id;
923 $this->participants = array_unique(array_merge(
924 $assigned = $this->rbacReview->assignedUsers($role_id),
925 $this->participants
926 ));
927 $this->members = array_unique(array_merge($assigned, $this->members));
928 $this->role_assignments[$role_id] = $assigned;
929 break;
930
931 case 'il_crs_a':
932 $auto_generated_roles[$role_id] = self::IL_ROLE_POSITION_ADMIN;
933 $this->role_data[self::IL_CRS_ADMIN] = $role_id;
934 $this->participants = array_unique(array_merge(
935 $assigned = $this->rbacReview->assignedUsers($role_id),
936 $this->participants
937 ));
938 $this->admins = $this->rbacReview->assignedUsers($role_id);
939 $this->role_assignments[$role_id] = $assigned;
940 break;
941
942 case 'il_crs_t':
943 $auto_generated_roles[$role_id] = self::IL_ROLE_POSITION_TUTOR;
944 $this->role_data[self::IL_CRS_TUTOR] = $role_id;
945 $this->participants = array_unique(array_merge(
946 $assigned = $this->rbacReview->assignedUsers($role_id),
947 $this->participants
948 ));
949 $this->tutors = $this->rbacReview->assignedUsers($role_id);
950 $this->role_assignments[$role_id] = $assigned;
951 break;
952
953 case 'il_grp_a':
954 $auto_generated_roles[$role_id] = self::IL_ROLE_POSITION_ADMIN;
955 $this->role_data[self::IL_GRP_ADMIN] = $role_id;
956 $this->participants = array_unique(array_merge(
957 $assigned = $this->rbacReview->assignedUsers($role_id),
958 $this->participants
959 ));
960 $this->admins = $this->rbacReview->assignedUsers($role_id);
961 $this->role_assignments[$role_id] = $assigned;
962 break;
963
964 case 'il_grp_m':
965 $auto_generated_roles[$role_id] = self::IL_ROLE_POSITION_MEMBER;
966 $this->role_data[self::IL_GRP_MEMBER] = $role_id;
967 $this->participants = array_unique(array_merge(
968 $assigned = $this->rbacReview->assignedUsers($role_id),
969 $this->participants
970 ));
971 $this->members = $this->rbacReview->assignedUsers($role_id);
972 $this->role_assignments[$role_id] = $assigned;
973 break;
974
975 case 'il_sess_':
976 $this->role_data[self::IL_SESS_MEMBER] = $role_id;
977 $this->participants = array_unique(array_merge(
978 $assigned = $this->rbacReview->assignedUsers($role_id),
979 $this->participants
980 ));
981 $this->members = $this->rbacReview->assignedUsers($role_id);
982 break;
983
984 case 'il_lso_m':
985 $auto_generated_roles[$role_id] = self::IL_ROLE_POSITION_MEMBER;
986 $this->role_data[self::IL_LSO_MEMBER] = $role_id;
987 $this->participants = array_unique(array_merge(
988 $assigned = $this->rbacReview->assignedUsers($role_id),
989 $this->participants
990 ));
991 $this->members = $this->rbacReview->assignedUsers($role_id);
992 $this->role_assignments[$role_id] = $assigned;
993 break;
994
995 case 'il_lso_a':
996 $auto_generated_roles[$role_id] = self::IL_ROLE_POSITION_ADMIN;
997 $this->role_data[self::IL_LSO_ADMIN] = $role_id;
998 $this->participants = array_unique(array_merge(
999 $assigned = $this->rbacReview->assignedUsers($role_id),
1000 $this->participants
1001 ));
1002 $this->admins = $this->rbacReview->assignedUsers($role_id);
1003 $this->role_assignments[$role_id] = $assigned;
1004 break;
1005
1006 default:
1007 $additional_roles[$role_id] = $title;
1008 $this->participants = array_unique(array_merge(
1009 $assigned = $this->rbacReview->assignedUsers($role_id),
1010 $this->participants
1011 ));
1012 $this->members = array_unique(array_merge($assigned, $this->members));
1013 $this->role_assignments[$role_id] = $assigned;
1014 break;
1015 }
1016 }
1017 asort($auto_generated_roles);
1018 asort($additional_roles);
1019 $this->roles_sorted = $auto_generated_roles + $additional_roles;
1020 }
1021
1025 protected function readParticipantsStatus(): void
1026 {
1027 $query = "SELECT * FROM obj_members " .
1028 "WHERE obj_id = " . $this->ilDB->quote($this->obj_id, 'integer') . " ";
1029 $res = $this->ilDB->query($query);
1030 $this->participants_status = [];
1031 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1032 $this->participants_status[(int) $row->usr_id]['blocked'] = (bool) $row->blocked;
1033 $this->participants_status[(int) $row->usr_id]['notification'] = (bool) $row->notification;
1034 $this->participants_status[(int) $row->usr_id]['passed'] = (bool) $row->passed;
1035 $this->participants_status[(int) $row->usr_id]['contact'] = (bool) $row->contact;
1036 }
1037 }
1038
1042 public function isGroupingMember(int $a_usr_id, string $a_field = ''): bool
1043 {
1044 if ($a_field === '') {
1045 return false;
1046 }
1047 // Used for membership limitations -> check membership by given field
1048 $tmp_user = ilObjectFactory::getInstanceByObjId($a_usr_id);
1049 if (!$tmp_user instanceof ilObjUser) {
1050 $this->logger->logStack(ilLogLevel::ERROR);
1051 throw new DomainException('Invalid user id given: ' . $a_usr_id);
1052 }
1053 switch ($a_field) {
1054 case 'login':
1055 $and = "AND login = " . $this->ilDB->quote($tmp_user->getLogin(), 'text') . " ";
1056 break;
1057 case 'email':
1058 $and = "AND email = " . $this->ilDB->quote($tmp_user->getEmail(), 'text') . " ";
1059 break;
1060 case 'matriculation':
1061 $and = "AND matriculation = " . $this->ilDB->quote($tmp_user->getMatriculation(), 'text') . " ";
1062 break;
1063
1064 default:
1065 $and = "AND usr_id = " . $this->ilDB->quote($a_usr_id, 'integer') . " ";
1066 break;
1067 }
1068
1069 if (!$this->getParticipants()) {
1070 return false;
1071 }
1072
1073 $query = "SELECT * FROM usr_data ud " .
1074 "WHERE " . $this->ilDB->in('usr_id', $this->getParticipants(), false, 'integer') . " " .
1075 $and;
1076
1077 $res = $this->ilDB->query($query);
1078 return (bool) $res->numRows();
1079 }
1080
1084 public static function lookupSubscribers(int $a_obj_id): array
1085 {
1086 global $DIC;
1087
1088 $ilDB = $DIC['ilDB'];
1089 $subscribers = array();
1090 $query = "SELECT usr_id FROM il_subscribers " .
1091 "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
1092 "ORDER BY sub_time ";
1093
1094 $res = $ilDB->query($query);
1095 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1096 $subscribers[] = (int) $row->usr_id;
1097 }
1098 return $subscribers;
1099 }
1100
1105 public function getSubscribers(): array
1106 {
1107 $this->readSubscribers();
1108 return $this->subscribers;
1109 }
1110
1111 public function getCountSubscribers(): int
1112 {
1113 return count($this->getSubscribers());
1114 }
1115
1116 public function getSubscriberData(int $a_usr_id): array
1117 {
1118 return $this->readSubscriberData($a_usr_id);
1119 }
1120
1121 public function assignSubscribers(array $a_usr_ids): bool
1122 {
1123 if (!is_array($a_usr_ids) || !count($a_usr_ids)) {
1124 return false;
1125 }
1126 foreach ($a_usr_ids as $id) {
1127 if (!$this->assignSubscriber($id)) {
1128 return false;
1129 }
1130 }
1131 return true;
1132 }
1133
1134 public function assignSubscriber(int $a_usr_id): bool
1135 {
1136 $this->error->setMessage("");
1137 if (!$this->isSubscriber($a_usr_id)) {
1138 $this->error->appendMessage($this->lng->txt("crs_user_notsubscribed"));
1139
1140 return false;
1141 }
1142 if ($this->isAssigned($a_usr_id)) {
1143 $tmp_obj = ilObjectFactory::getInstanceByObjId($a_usr_id);
1144 $this->error->appendMessage($tmp_obj->getLogin() . ": " . $this->lng->txt("crs_user_already_assigned"));
1145
1146 return false;
1147 }
1148
1149 if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($a_usr_id, false)) {
1150 $this->error->appendMessage($this->lng->txt("crs_user_not_exists"));
1151 return false;
1152 }
1153
1154 if ($this instanceof ilCourseParticipants) {
1155 $this->add($tmp_obj->getId(), self::IL_CRS_MEMBER);
1156 }
1157 if ($this instanceof ilGroupParticipants) {
1158 $this->add($tmp_obj->getId(), self::IL_GRP_MEMBER);
1159 }
1160 if ($this instanceof ilLearningSequenceParticipants) {
1161 $this->add($tmp_obj->getId(), self::IL_LSO_MEMBER);
1162 }
1163 if ($this instanceof ilSessionParticipants) {
1164 $this->register($tmp_obj->getId());
1165 }
1166 $this->deleteSubscriber($a_usr_id);
1167 return true;
1168 }
1169
1173 public function autoFillSubscribers(): int
1174 {
1175 $this->readSubscribers();
1176 $counter = 0;
1177 foreach ($this->subscribers as $subscriber) {
1178 if (!$this->assignSubscriber($subscriber)) {
1179 continue;
1180 }
1181 ++$counter;
1182 }
1183 return $counter;
1184 }
1185
1186 public function addSubscriber(int $a_usr_id): void
1187 {
1188 $query = "INSERT INTO il_subscribers (usr_id,obj_id,subject,sub_time) " .
1189 " VALUES (" .
1190 $this->ilDB->quote($a_usr_id, 'integer') . "," .
1191 $this->ilDB->quote($this->obj_id, 'integer') . ", " .
1192 $this->ilDB->quote('', 'text') . ", " .
1193 $this->ilDB->quote(time(), 'integer') .
1194 ")";
1195 $res = $this->ilDB->manipulate($query);
1196 }
1197
1198 public function updateSubscriptionTime(int $a_usr_id, int $a_subtime): void
1199 {
1200 $query = "UPDATE il_subscribers " .
1201 "SET sub_time = " . $this->ilDB->quote($a_subtime, 'integer') . " " .
1202 "WHERE usr_id = " . $this->ilDB->quote($a_usr_id, 'integer') . " " .
1203 "AND obj_id = " . $this->ilDB->quote($this->obj_id, 'integer') . " ";
1204 $res = $this->ilDB->manipulate($query);
1205 }
1206
1207 public function updateSubject(int $a_usr_id, string $a_subject): void
1208 {
1209 $query = "UPDATE il_subscribers " .
1210 "SET subject = " . $this->ilDB->quote($a_subject, 'text') . " " .
1211 "WHERE usr_id = " . $this->ilDB->quote($a_usr_id, 'integer') . " " .
1212 "AND obj_id = " . $this->ilDB->quote($this->obj_id, 'integer') . " ";
1213 $res = $this->ilDB->manipulate($query);
1214 }
1215
1216 public function deleteSubscriber(int $a_usr_id): void
1217 {
1218 $query = "DELETE FROM il_subscribers " .
1219 "WHERE usr_id = " . $this->ilDB->quote($a_usr_id, 'integer') . " " .
1220 "AND obj_id = " . $this->ilDB->quote($this->obj_id, 'integer') . " ";
1221 $res = $this->ilDB->manipulate($query);
1222 }
1223
1224 public function deleteSubscribers(array $a_usr_ids): bool
1225 {
1226 if (!count($a_usr_ids)) {
1227 $this->error->setMessage('');
1228 $this->error->appendMessage($this->lng->txt("no_usr_ids_given"));
1229 return false;
1230 }
1231 $query = "DELETE FROM il_subscribers " .
1232 "WHERE " . $this->ilDB->in('usr_id', $a_usr_ids, false, 'integer') . " " .
1233 "AND obj_id = " . $this->ilDB->quote($this->obj_id, 'integer');
1234 $res = $this->ilDB->query($query);
1235 return true;
1236 }
1237
1238 public function isSubscriber(int $a_usr_id): bool
1239 {
1240 $query = "SELECT * FROM il_subscribers " .
1241 "WHERE usr_id = " . $this->ilDB->quote($a_usr_id, 'integer') . " " .
1242 "AND obj_id = " . $this->ilDB->quote($this->obj_id, 'integer');
1243
1244 $res = $this->ilDB->query($query);
1245 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1246 return true;
1247 }
1248 return false;
1249 }
1250
1251 public static function _isSubscriber(int $a_obj_id, int $a_usr_id): bool
1252 {
1253 global $DIC;
1254
1255 $ilDB = $DIC->database();
1256 $query = "SELECT * FROM il_subscribers " .
1257 "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " " .
1258 "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
1259
1260 $res = $ilDB->query($query);
1261 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1262 return true;
1263 }
1264 return false;
1265 }
1266
1270 protected function readSubscribers(): void
1271 {
1272 $this->subscribers = [];
1273 $query = "SELECT usr_id FROM il_subscribers " .
1274 "WHERE obj_id = " . $this->ilDB->quote($this->obj_id, 'integer') . " " .
1275 "ORDER BY sub_time ";
1276
1277 $res = $this->ilDB->query($query);
1278 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1279 if (!ilObjectFactory::getInstanceByObjId((int) $row->usr_id, false)) {
1280 $this->deleteSubscriber((int) $row->usr_id);
1281 }
1282 $this->subscribers[] = (int) $row->usr_id;
1283 }
1284 }
1285
1289 protected function readSubscriberData(int $a_usr_id): array
1290 {
1291 $query = "SELECT * FROM il_subscribers " .
1292 "WHERE obj_id = " . $this->ilDB->quote($this->obj_id, 'integer') . " " .
1293 "AND usr_id = " . $this->ilDB->quote($a_usr_id, 'integer');
1294
1295 $res = $this->ilDB->query($query);
1296 $data = [];
1297 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1298 $data["time"] = (int) $row->sub_time;
1299 $data["usr_id"] = (int) $row->usr_id;
1300 $data['subject'] = (string) $row->subject;
1301 }
1302 return $data;
1303 }
1304
1309 public static function lookupSubscribersData(int $a_obj_id): array
1310 {
1311 global $DIC;
1312
1313 $ilDB = $DIC->database();
1314 $query = 'SELECT * FROM il_subscribers ' .
1315 'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
1316 $res = $ilDB->query($query);
1317
1318 $data = array();
1319 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1320 $data[$row->usr_id]['time'] = (int) $row->sub_time;
1321 $data[$row->usr_id]['usr_id'] = (int) $row->usr_id;
1322 $data[$row->usr_id]['subject'] = (string) $row->subject;
1323 }
1324 return $data;
1325 }
1326
1335 public static function _getAllSupportContactsOfUser(int $a_usr_id, string $a_type): array
1336 {
1337 global $DIC;
1338
1339 $ilDB = $DIC['ilDB'];
1340
1341 // for the first part
1342
1343 // this will also dismiss local roles!
1344 $j2 = "JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id) ";
1345 $a2 = "AND obd2.title LIKE 'il_" . $a_type . "_mem%' ";
1346
1347 // #14290 - no role folder anymore
1348 $query = "SELECT DISTINCT obd.obj_id,obr.ref_id FROM rbac_ua ua " .
1349 "JOIN rbac_fa fa ON ua.rol_id = fa.rol_id " .
1350 "JOIN object_reference obr ON fa.parent = obr.ref_id " .
1351 "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
1352 $j2 .
1353 "WHERE obd.type = " . $ilDB->quote($a_type, 'text') . " " .
1354 "AND fa.assign = 'y' " .
1355 "AND ua.usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " " .
1356 $a2;
1357
1358 $res = $ilDB->query($query);
1359 $obj_ids = array();
1360 while ($row = $ilDB->fetchObject($res)) {
1361 $obj_ids[] = (int) $row->obj_id;
1362 }
1363
1364 $set = $ilDB->query("SELECT obj_id, usr_id FROM obj_members " .
1365 " WHERE " . $ilDB->in("obj_id", $obj_ids, false, "integer") .
1366 " AND contact = " . $ilDB->quote(1, "integer"));
1367 $res = array();
1368 while ($rec = $ilDB->fetchAssoc($set)) {
1369 $res[] = $rec;
1370 }
1371 return $res;
1372 }
1373
1377 public function setRoleOrderPosition(int $a_user_id): string
1378 {
1379 $counter = 0;
1380 $sortable_assignments = '9999999999';
1381 foreach ($this->roles_sorted as $role_id => $trash) {
1382 if (in_array($a_user_id, (array) $this->role_assignments[$role_id])) {
1383 $sortable_assignments = substr_replace($sortable_assignments, '1', $counter, 1);
1384 }
1385 ++$counter;
1386 }
1387 return $sortable_assignments;
1388 }
1389}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
error(string $a_errmsg)
Global event handler.
static _getInstanceByObjId(int $a_obj_id)
const FETCHMODE_OBJECT
Error Handling & global info handling.
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
language handling
Component logger with individual log levels by component id.
warning(string $message, array $context=[])
logStack(?int $level=null, string $message='', array $context=[])
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupShowMembersEnabled(int $a_obj_id)
Class ilObjGroup.
static lookupShowMembersEnabled(int $a_obj_id)
const MAIL_ALLOWED_ALL
User class.
class ilObjectDataCache
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObject Basic functions for all objects.
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
Base class for course and group participants.
getAdmins()
Get all admins ids.
isContact(int $a_usr_id)
deleteSubscribers(array $a_usr_ids)
getComponent()
Get component name Used for raising events.
static _getMembershipByType(int $a_usr_id, array $a_type, bool $a_only_member_role=false)
get membership by type Get course or group membership
static lookupNumberOfMembers(int $a_ref_id)
Lookup number of members.
static _hasPassed(int $a_obj_id, int $a_usr_id)
Check if user has passed course.
setRoleOrderPosition(int $a_user_id)
Set role order position.
addRecommendation(int $a_usr_id)
Add desktop item @access public.
isNotificationEnabled(int $a_usr_id)
updateBlocked(int $a_usr_id, bool $a_blocked)
Update blocked status.
getParticipants()
Get all participants ids.
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
ilAppEventHandler $eventHandler
updateContact(int $a_usr_id, bool $a_contact)
static canSendMailToMembers(int|ilObject $ref_id_or_instance, ?int $usr_id=null, ?int $mail_obj_ref_id=null)
This method was introduced as a band-aid fix for #22764.
getRoles()
Get object roles.
getCountParticipants()
Get number of participants.
static getInstance(int $a_ref_id)
static lookupSubscribers(int $a_obj_id)
ilRbacReview $rbacReview
deleteParticipants(array $a_user_ids)
isTutor(int $a_usr_id)
is user tutor
static lookupNumberOfParticipants(int $a_ref_id)
Lookup the number of participants (crs admins, tutors, members, grp admins, members)
updateNotification(int $a_usr_id, bool $a_notification)
Update notification status.
isBlocked(int $a_usr_id)
Check if user is blocked.
isLastAdmin(int $a_usr_id)
Check if user is last admin.
readParticipantsStatus()
Read status of participants (blocked, notification, passed)
updateRoleAssignments($a_usr_id, $a_roles)
Update role assignments @access public.
getSubscriberData(int $a_usr_id)
assignSubscribers(array $a_usr_ids)
getNotificationRecipients()
Get admin, tutor which have notification enabled.
ilObjectDataCache $objectDataCache
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.
getMembers()
Get all members ids (admins and tutors are not members) Use get participants to fetch all.
getAutoGeneratedRoleId(int $a_role_type)
static _deleteAllEntries(int $a_obj_id)
Delete all entries Normally called in case of object deletion.
getSubscribers()
get all subscribers int[]
static getUserMembershipAssignmentsByType(array $a_user_ids, array $a_type, bool $a_only_member_roles)
Get user membership assignments by type.
static _isBlocked(int $a_obj_id, int $a_usr_id)
Check if user is blocked.
getCountMembers()
Get number of members (not participants)
ilRecommendedContentManager $recommended_content_manager
static _deleteUser(int $a_usr_id)
Delete user data.
static _getAllSupportContactsOfUser(int $a_usr_id, string $a_type)
Get all support contacts for a user.
ilErrorHandling $error
getContacts()
get user ids which are confirgured as contact
isAssigned(int $a_usr_id)
check if user is assigned
isSubscriber(int $a_usr_id)
static lookupSubscribersData(int $a_obj_id)
checkLastAdmin(array $a_usr_ids)
Check if users for deletion are last admins @access public.
__construct(string $a_component_name, int $a_ref_id)
static _isSubscriber(int $a_obj_id, int $a_usr_id)
static getDefaultMemberRole(int $a_ref_id)
isGroupingMember(int $a_usr_id, string $a_field='')
Check membership for.
assignSubscriber(int $a_usr_id)
static hasParticipantListAccess(int $a_obj_id, ?int $a_usr_id=null)
Check if (current) user has access to the participant list.
hasPassed(int $a_usr_id)
Check if user has passed object.
addSubscriber(int $a_usr_id)
updateSubscriptionTime(int $a_usr_id, int $a_subtime)
deleteSubscriber(int $a_usr_id)
readSubscriberData(int $a_usr_id)
getTutors()
Get all tutors ids.
getAssignedRoles(int $a_usr_id)
Get assigned roles.
isMember(int $a_usr_id)
is user member
updateSubject(int $a_usr_id, string $a_subject)
isAdmin(int $a_usr_id)
check if user is admin
add(int $a_usr_id, int $a_role)
Class ilRbacAdmin Core functions for role based access control.
class ilRbacReview Contains Review functions of core Rbac.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Session participation handling.
static getInstance(int $a_ref_id)
static _getInstanceByObjId(int $a_obj_id)
static deleteUserEntry(int $a_usr_id, int $a_obj_id)
static _deleteUser(int $a_usr_id)
Interface ilDBInterface.
$res
Definition: ltiservices.php:69
global $DIC
Definition: shib_login.php:26
$counter