12 define(
"IL_CRS_ADMIN", 1);
13 define(
"IL_CRS_TUTOR", 3);
14 define(
"IL_CRS_MEMBER", 2);
16 define(
'IL_GRP_ADMIN', 4);
17 define(
'IL_GRP_MEMBER', 5);
19 define(
'IL_SESS_MEMBER', 6);
21 define(
'IL_LSO_ADMIN', 7);
22 define(
'IL_LSO_MEMBER', 8);
24 define(
"IL_ROLE_POSITION_ADMIN", 1);
25 define(
"IL_ROLE_POSITION_TUTOR", 2);
26 define(
"IL_ROLE_POSITION_MEMBER", 3);
77 $this->ilDB =
$GLOBALS[
'DIC']->database();
78 $this->lng =
$GLOBALS[
'DIC']->language();
79 $this->logger =
$GLOBALS[
'DIC']->logger()->mem();
81 $this->component = $a_component_name;
83 $this->ref_id = $a_ref_id;
105 return self::getInstanceByObjId(
$obj_id);
107 include_once
'./Modules/Session/classes/class.ilSessionParticipants.php';
110 $GLOBALS[
'DIC']->logger()->mem()->logStack();
111 $GLOBALS[
'DIC']->logger()->mem()->warning(
'Invalid ref_id -> obj_id given: ' . $a_ref_id .
' -> ' .
$obj_id);
112 throw new \InvalidArgumentException(
'Invalid obj_id given.');
129 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
133 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
137 include_once
'./Modules/Session/classes/class.ilSessionParticipants.php';
143 $GLOBALS[
'DIC']->logger()->mmbr()->warning(
': Invalid obj_id given: ' . $a_obj_id);
168 $access = $DIC->access();
171 $a_usr_id =
$GLOBALS[
'DIC'][
'ilUser']->getId();
178 if ($access->checkAccess(
'manage_members',
'',
$ref_id)) {
181 $part = self::getInstance(
$ref_id);
182 if ($part->isAssigned($a_usr_id)) {
183 if ($part->getType() ==
'crs') {
188 if ($part->getType() ==
'grp') {
211 $logger = $DIC->logger()->mmbr();
212 $ilDB = $DIC->database();
214 if ($a_only_member_roles) {
215 $j2 =
"JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id) ";
216 $a2 =
'AND obd2.title = ' .
$ilDB->concat(
218 array(
$ilDB->quote(
'il_',
'text')),
220 array(
$ilDB->quote(
'_member_',
'text')),
227 $query =
"SELECT DISTINCT obd.obj_id,obr.ref_id,ua.usr_id FROM rbac_ua ua " .
228 "JOIN rbac_fa fa ON ua.rol_id = fa.rol_id " .
229 "JOIN object_reference obr ON fa.parent = obr.ref_id " .
230 "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
232 "WHERE " .
$ilDB->in(
"obd.type",
$a_type,
false,
"text") .
233 "AND fa.assign = 'y' " .
234 'AND ' .
$ilDB->in(
'ua.usr_id', $a_user_ids,
false,
'integer') .
' ' .
243 $obj_ids[
$row->obj_id][] =
$row->usr_id;
266 $ilDB = $DIC[
'ilDB'];
273 if ($a_only_member_role) {
274 $j2 =
"JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id) ";
275 $a2 =
'AND obd2.title = ' .
$ilDB->concat(
277 array(
$ilDB->quote(
'il_',
'text')),
279 array(
$ilDB->quote(
'_member_',
'text')),
287 $query =
"SELECT DISTINCT obd.obj_id,obr.ref_id FROM rbac_ua ua " .
288 "JOIN rbac_fa fa ON ua.rol_id = fa.rol_id " .
289 "JOIN object_reference obr ON fa.parent = obr.ref_id " .
290 "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
292 "WHERE " .
$ilDB->in(
"obd.type",
$a_type,
false,
"text") .
293 "AND fa.assign = 'y' " .
294 "AND ua.usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
298 $ref_ids[] =
$row->obj_id;
301 return $ref_ids ? $ref_ids : array();
318 $rbacreview = $DIC[
'rbacreview'];
320 $local_roles = $rbacreview->getRolesOfRoleFolder($a_ref_id,
false);
322 return $rbacreview->isAssignedToAtLeastOneGivenRole($a_usr_id, $local_roles);
336 $rbacreview = $DIC[
'rbacreview'];
338 $lroles = $rbacreview->getRolesOfRoleFolder($a_ref_id,
false);
339 return $rbacreview->getNumberOfAssignedUsers($lroles);
353 $rbacreview = $DIC->rbac()->review();
354 $ilObjDataCache = $DIC[
'ilObjDataCache'];
356 $has_policies = $rbacreview->getLocalPolicies($a_ref_id);
358 if (!$has_policies) {
361 $lroles = $rbacreview->getRolesOfRoleFolder($a_ref_id,
false);
363 $memberRoles = array();
364 foreach ($lroles as $role_id) {
365 $title = $ilObjDataCache->lookupTitle($role_id);
366 switch (substr(
$title, 0, 8)) {
373 $memberRoles[] = $role_id;
377 return $rbacreview->getNumberOfAssignedUsers($memberRoles);
394 $ilDB = $DIC[
'ilDB'];
396 $query =
"SELECT * FROM obj_members " .
397 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
398 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
399 "AND blocked = " .
$ilDB->quote(1,
'integer');
401 return $res->numRows() ? true :
false;
417 $ilDB = $DIC[
'ilDB'];
419 $query =
"SELECT * FROM obj_members " .
420 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
421 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
424 return $res->numRows() ? true :
false;
440 $ilDB = $DIC[
'ilDB'];
442 $query =
"DELETE FROM obj_members " .
443 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" ";
446 $query =
"DELETE FROM il_subscribers " .
447 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
"";
450 $query =
'DELETE FROM crs_waiting_list ' .
451 'WHERE obj_id = ' .
$ilDB->quote($a_obj_id,
'integer');
469 $ilDB = $DIC[
'ilDB'];
471 $query =
"DELETE FROM obj_members WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
"";
474 $query =
"DELETE FROM il_subscribers WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
"";
477 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
490 if (!in_array(
$type, array(
'crs',
'grp'))) {
496 $rbacreview = $DIC[
'rbacreview'];
499 $roles = $rbacreview->getRolesOfRoleFolder($a_ref_id,
false);
501 foreach (
$roles as $role) {
503 if (substr(
$title, 0, 13) == (
'il_' .
$type .
'_member')) {
538 $ilDB = $DIC[
'ilDB'];
540 $query =
"SELECT * FROM obj_members " .
541 "WHERE notification = 1 " .
542 "AND obj_id = " .
$ilDB->quote($this->obj_id) .
" ";
546 $recp[] =
$row->usr_id;
549 return $recp ? $recp : array();
560 return count($this->members);
571 return count($this->participants);
585 return $this->participants ? $this->participants : array();
597 return $this->members ? $this->members : array();
607 return $this->admins ? $this->admins : array();
628 return $this->tutors ? $this->tutors : array();
640 return in_array($a_usr_id, $this->admins) ? true :
false;
652 return in_array($a_usr_id, $this->tutors) ? true :
false;
664 return in_array($a_usr_id, $this->members) ? true :
false;
679 return in_array($a_usr_id, $this->participants);
702 return $this->roles ? $this->roles : array();
716 $rbacreview = $DIC[
'rbacreview'];
718 foreach ($this->roles as $role) {
719 if ($rbacreview->isAssigned($a_usr_id, $role)) {
723 return $assigned ? $assigned : array();
738 $rbacreview = $DIC[
'rbacreview'];
739 $rbacadmin = $DIC[
'rbacadmin'];
741 $roles = $a_roles ? $a_roles : array();
743 foreach ($this->
getRoles() as $role_id) {
744 if ($rbacreview->isAssigned($a_usr_id, $role_id)) {
745 if (!in_array($role_id,
$roles)) {
746 $rbacadmin->deassignUser($role_id, $a_usr_id);
749 if (in_array($role_id,
$roles)) {
750 $rbacadmin->assignUser($role_id, $a_usr_id);
754 $rbacreview->clearCaches();
768 foreach ($this->
getAdmins() as $admin_id) {
769 if (!in_array($admin_id, $a_usr_ids)) {
785 if (isset($this->participants_status[$a_usr_id])) {
786 return $this->participants_status[$a_usr_id][
'blocked'] ? true :
false;
800 if (isset($this->participants_status[$a_usr_id])) {
801 return $this->participants_status[$a_usr_id][
'passed'] ? true :
false;
813 public function delete($a_usr_id)
817 $rbacadmin = $DIC[
'rbacadmin'];
818 $ilDB = $DIC[
'ilDB'];
821 foreach ($this->roles as $role_id) {
822 $rbacadmin->deassignUser($role_id, $a_usr_id);
825 $query =
"DELETE FROM obj_members " .
826 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
827 "AND obj_id = " .
$ilDB->quote($this->obj_id,
'integer');
833 $GLOBALS[
'DIC'][
'ilAppEventHandler']->raise(
837 'obj_id' => $this->obj_id,
838 'usr_id' => $a_usr_id)
856 $ilDB = $DIC[
'ilDB'];
858 $this->participants_status[$a_usr_id][
'blocked'] = (int) $a_blocked;
860 $query =
"SELECT * FROM obj_members " .
861 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" " .
862 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer');
864 if (
$res->numRows()) {
865 $query =
"UPDATE obj_members SET " .
866 "blocked = " .
$ilDB->quote((
int) $a_blocked,
'integer') .
" " .
867 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" " .
868 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer');
870 $query =
"INSERT INTO obj_members (blocked,obj_id,usr_id,notification,passed) " .
872 $ilDB->quote((
int) $a_blocked,
'integer') .
", " .
873 $ilDB->quote($this->obj_id,
'integer') .
", " .
874 $ilDB->quote($a_usr_id,
'integer') .
", " .
875 $ilDB->quote(0,
'integer') .
", " .
876 $ilDB->quote(0,
'integer') .
895 $ilDB = $DIC[
'ilDB'];
898 'UPDATE obj_members SET ' .
899 'contact = ' .
$ilDB->quote($a_contact,
'integer') .
' ' .
900 'WHERE obj_id = ' .
$ilDB->quote($this->obj_id,
'integer') .
' ' .
901 'AND usr_id = ' .
$ilDB->quote($a_usr_id,
'integer')
904 $this->participants_status[$a_usr_id][
'contact'] = $a_contact;
915 foreach ((array) $this->participants_status as $usr_id => $status) {
916 if ($status[
'contact']) {
917 $contacts[] = $usr_id;
938 $ilDB = $DIC[
'ilDB'];
940 $this->participants_status[$a_usr_id][
'notification'] = (int) $a_notification;
942 $query =
"SELECT * FROM obj_members " .
943 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" " .
944 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer');
946 if (
$res->numRows()) {
947 $query =
"UPDATE obj_members SET " .
948 "notification = " .
$ilDB->quote((
int) $a_notification,
'integer') .
" " .
949 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" " .
950 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer');
952 $query =
"INSERT INTO obj_members (notification,obj_id,usr_id,passed,blocked) " .
954 $ilDB->quote((
int) $a_notification,
'integer') .
", " .
955 $ilDB->quote($this->obj_id,
'integer') .
", " .
956 $ilDB->quote($a_usr_id,
'integer') .
", " .
957 $ilDB->quote(0,
'integer') .
", " .
958 $ilDB->quote(0,
'integer') .
976 public function add($a_usr_id, $a_role)
980 $rbacadmin = $DIC[
'rbacadmin'];
981 $ilAppEventHandler = $DIC[
'ilAppEventHandler'];
989 $this->admins[] = $a_usr_id;
993 $this->tutors[] = $a_usr_id;
997 $this->members[] = $a_usr_id;
1001 $this->admins[] = $a_usr_id;
1005 $this->members[] = $a_usr_id;
1009 $this->admins[] = $a_usr_id;
1013 $this->members[] = $a_usr_id;
1017 $this->members[] = $a_usr_id;
1021 $this->participants[] = $a_usr_id;
1022 $rbacadmin->assignUser($this->role_data[$a_role], $a_usr_id);
1027 include_once
'./Services/Membership/classes/class.ilWaitingList.php';
1030 $ilAppEventHandler->raise(
1034 'obj_id' => $this->obj_id,
1035 'usr_id' => $a_usr_id,
1036 'role_id' => $a_role)
1051 foreach ($a_user_ids as $user_id) {
1052 $this->
delete($user_id);
1099 if (isset($this->participants_status[$a_usr_id])) {
1100 return $this->participants_status[$a_usr_id][
'notification'] ? true :
false;
1112 if (isset($this->participants_status[$a_usr_id])) {
1113 return (
bool) $this->participants_status[$a_usr_id][
'contact'];
1126 if (array_key_exists($a_role_type, $this->role_data)) {
1127 return $this->role_data[$a_role_type];
1145 $rbacreview = $DIC[
'rbacreview'];
1146 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1149 $GLOBALS[
'DIC'][
'rbacreview']->clearCaches();
1150 $this->roles = $rbacreview->getRolesOfRoleFolder($this->ref_id,
false);
1153 $this->participants = array();
1154 $this->members = $this->admins = $this->tutors = array();
1156 $additional_roles = [];
1157 $auto_generated_roles = [];
1158 foreach ($this->roles as $role_id) {
1159 $title = $ilObjDataCache->lookupTitle($role_id);
1160 switch (substr(
$title, 0, 8)) {
1164 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1165 $this->members = array_unique(array_merge($assigned, $this->members));
1166 $this->role_assignments[$role_id] = $assigned;
1172 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1173 $this->admins = $rbacreview->assignedUsers($role_id);
1174 $this->role_assignments[$role_id] = $assigned;
1180 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1181 $this->tutors = $rbacreview->assignedUsers($role_id);
1182 $this->role_assignments[$role_id] = $assigned;
1188 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1189 $this->admins = $rbacreview->assignedUsers($role_id);
1190 $this->role_assignments[$role_id] = $assigned;
1196 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1197 $this->members = $rbacreview->assignedUsers($role_id);
1198 $this->role_assignments[$role_id] = $assigned;
1203 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1204 $this->members = $rbacreview->assignedUsers($role_id);
1210 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1211 $this->members = $rbacreview->assignedUsers($role_id);
1212 $this->role_assignments[$role_id] = $assigned;
1218 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1219 $this->admins = $rbacreview->assignedUsers($role_id);
1220 $this->role_assignments[$role_id] = $assigned;
1224 $additional_roles[$role_id] =
$title;
1225 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1226 $this->members = array_unique(array_merge($assigned, $this->members));
1227 $this->role_assignments[$role_id] = $assigned;
1231 asort($auto_generated_roles);
1232 asort($additional_roles);
1233 $this->roles_sorted = $auto_generated_roles + $additional_roles;
1247 $ilDB = $DIC[
'ilDB'];
1249 $query =
"SELECT * FROM obj_members " .
1250 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" ";
1252 $this->participants_status = array();
1254 $this->participants_status[
$row->usr_id][
'blocked'] =
$row->blocked;
1255 $this->participants_status[
$row->usr_id][
'notification'] =
$row->notification;
1256 $this->participants_status[
$row->usr_id][
'passed'] =
$row->passed;
1258 $this->participants_status[
$row->usr_id][
'contact'] =
$row->contact;
1274 $rbacreview = $DIC[
'rbacreview'];
1275 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1276 $ilDB = $DIC[
'ilDB'];
1280 include_once
'./Services/User/classes/class.ilObjUser.php';
1285 $and =
"AND login = " .
$ilDB->quote($tmp_user->getLogin(),
'text') .
" ";
1288 $and =
"AND email = " .
$ilDB->quote($tmp_user->getEmail(),
'text') .
" ";
1290 case 'matriculation':
1291 $and =
"AND matriculation = " .
$ilDB->quote($tmp_user->getMatriculation(),
'text') .
" ";
1295 $and =
"AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" ";
1303 $query =
"SELECT * FROM usr_data ud " .
1308 return $res->numRows() ? true :
false;
1316 $ilDB = $DIC[
'ilDB'];
1319 $query =
"SELECT usr_id FROM il_subscribers " .
1320 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
1321 "ORDER BY sub_time ";
1372 if (!is_array($a_usr_ids)
or !count($a_usr_ids)) {
1375 foreach ($a_usr_ids as
$id) {
1396 $ilErr->appendMessage($this->lng->txt(
"crs_user_notsubscribed"));
1402 $ilErr->appendMessage($tmp_obj->getLogin() .
": " . $this->lng->txt(
"crs_user_already_assigned"));
1408 $ilErr->appendMessage($this->lng->txt(
"crs_user_not_exists"));
1424 $this->
register($tmp_obj->getId());
1440 foreach ($this->subscribers as $subscriber) {
1445 #$this->sendNotification($this->NOTIFY_ACCEPT_SUBSCRIBER,$subscriber); 1462 $ilDB = $DIC[
'ilDB'];
1464 $query =
"INSERT INTO il_subscribers (usr_id,obj_id,subject,sub_time) " .
1466 $ilDB->quote($a_usr_id,
'integer') .
"," .
1467 $ilDB->quote($this->obj_id,
'integer') .
", " .
1468 $ilDB->quote(
'',
'text') .
", " .
1469 $ilDB->quote(time(),
'integer') .
1486 $ilDB = $DIC[
'ilDB'];
1488 $query =
"UPDATE il_subscribers " .
1489 "SET sub_time = " .
$ilDB->quote($a_subtime,
'integer') .
" " .
1490 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
1491 "AND obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" ";
1508 $ilDB = $DIC[
'ilDB'];
1510 $query =
"UPDATE il_subscribers " .
1511 "SET subject = " .
$ilDB->quote($a_subject,
'text') .
" " .
1512 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
1513 "AND obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" ";
1528 $ilDB = $DIC[
'ilDB'];
1530 $query =
"DELETE FROM il_subscribers " .
1531 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
1532 "AND obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" ";
1549 $ilDB = $DIC[
'ilDB'];
1551 if (!is_array($a_usr_ids)
or !count($a_usr_ids)) {
1553 $ilErr->appendMessage($this->lng->txt(
"no_usr_ids_given"));
1557 $query =
"DELETE FROM il_subscribers " .
1558 "WHERE " .
$ilDB->in(
'usr_id', (array) $a_usr_ids,
false,
'integer') .
" " .
1559 "AND obj_id = " .
$ilDB->quote($this->obj_id,
'integer');
1574 $ilDB = $DIC[
'ilDB'];
1576 $query =
"SELECT * FROM il_subscribers " .
1577 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
1578 "AND obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
"";
1597 $ilDB = $DIC[
'ilDB'];
1599 $query =
"SELECT * FROM il_subscribers " .
1600 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
1601 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
"";
1619 $ilDB = $DIC[
'ilDB'];
1621 $this->subscribers = array();
1623 $query =
"SELECT usr_id FROM il_subscribers " .
1624 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" " .
1625 "ORDER BY sub_time ";
1633 $this->subscribers[] =
$row->usr_id;
1647 $ilDB = $DIC[
'ilDB'];
1649 $query =
"SELECT * FROM il_subscribers " .
1650 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" " .
1651 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
"";
1666 $ilDB = $DIC[
'ilDB'];
1668 $query =
'SELECT * FROM il_subscribers ' .
1669 'WHERE obj_id = ' .
$ilDB->quote($a_obj_id,
'integer');
1692 $ilDB = $DIC[
'ilDB'];
1698 $j2 =
"JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id) ";
1699 $a2 =
"AND obd2.title LIKE 'il_" .
$a_type .
"_mem%' ";
1702 $query =
"SELECT DISTINCT obd.obj_id,obr.ref_id FROM rbac_ua ua " .
1703 "JOIN rbac_fa fa ON ua.rol_id = fa.rol_id " .
1704 "JOIN object_reference obr ON fa.parent = obr.ref_id " .
1705 "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
1707 "WHERE obd.type = " .
$ilDB->quote(
$a_type,
'text') .
" " .
1708 "AND fa.assign = 'y' " .
1709 "AND ua.usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
1715 $obj_ids[] =
$row->obj_id;
1718 $set =
$ilDB->query(
"SELECT obj_id, usr_id FROM obj_members " .
1719 " WHERE " .
$ilDB->in(
"obj_id", $obj_ids,
false,
"integer") .
1720 " AND contact = " .
$ilDB->quote(1,
"integer"));
1722 while ($rec =
$ilDB->fetchAssoc($set)) {
1737 $sortable_assignments =
'9999999999';
1738 foreach ($this->roles_sorted as $role_id => $trash) {
1739 if (in_array($a_user_id, (array) $this->role_assignments[$role_id])) {
1740 $sortable_assignments = substr_replace($sortable_assignments,
'1', $counter, 1);
1744 return $sortable_assignments;
getObjId()
get current obj_id
static _isParticipant($a_ref_id, $a_usr_id)
Static function to check if a user is a participant of the container object.
__construct($a_component_name, $a_ref_id)
Singleton Constructor.
getCountMembers()
Get number of members (not participants)
static _getAllSupportContactsOfUser($a_usr_id, $a_type)
Get all support contacts for a user.
addDesktopItem($a_usr_id)
Add desktop item.
static _isSubscriber($a_obj_id, $a_usr_id)
check if user is subscriber
static _getInstanceByObjId(int $obj_id)
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.
autoFillSubscribers()
Assign subscriber.
static lookupNumberOfParticipants($a_ref_id)
Lookup the number of participants (crs admins, tutors, members, grp admins, members) ...
static lookupNumberOfMembers($a_ref_id)
Lookup number of members ilRbacReview $rbacreview <type> $ilObjDataCache.
updateContact($a_usr_id, $a_contact)
Update contact setting type $ilDB.
Session participation handling.
readParticipantsStatus()
Read status of participants (blocked, notification, passed)
checkLastAdmin($a_usr_ids)
Check if user for deletion are last admins.
deleteParticipants($a_user_ids)
Delete users.
isAssigned($a_usr_id)
check if user is assigned
isLastAdmin($a_usr_id)
Check if user is last admin.
getCountAdmins()
Get number of admins.
static lookupSubscribers($a_obj_id)
updateBlocked($a_usr_id, $a_blocked)
Update blocked status.
static _deleteUser($a_usr_id)
Delete user.
assignSubscriber($a_usr_id)
Assign subscriber.
isAdmin($a_usr_id)
is user admin
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
if(!array_key_exists('StateId', $_REQUEST)) $id
isNotificationEnabled($a_usr_id)
check if notification is enabled
readSubscriberData($a_usr_id)
read subscribers
static _lookupTitle($a_id)
lookup object title
isMember($a_usr_id)
is user member
readSubscribers()
read subscribers
static getDefaultMemberRole($a_ref_id)
static _isBlocked($a_obj_id, $a_usr_id)
Check if user is blocked.
dropDesktopItem($a_usr_id)
Drop desktop item.
getAutoGeneratedRoleId($a_role_type)
Get role id of auto generated role type.
deleteSubscriber($a_usr_id)
Delete subsciber.
getAssignedRoles($a_usr_id)
Get assigned roles.
const IL_ROLE_POSITION_MEMBER
updateSubject($a_usr_id, $a_subject)
update subject
static _getInstanceByObjId($a_obj_id)
Get instance.
add($a_usr_id, $a_role)
Add user to object.
static hasParticipantListAccess($a_obj_id, $a_usr_id=null)
Check if (current) user has access to the participant list.
static _getAllReferences($a_id)
get all reference ids of object
updateNotification($a_usr_id, $a_notification)
Update notification status.
getCountSubscribers()
get number of subscribers
static lookupShowMembersEnabled($a_obj_id)
Check if show member is enabled.
static getInstance($a_ref_id)
Get instance by ref_id.
setRoleOrderPosition($a_user_id)
Set role order position.
deleteSubscribers($a_usr_ids)
Delete subscibers.
getMembers()
Get all members ids (admins and tutors are not members) Use get participants to fetch all...
static lookupShowMembersEnabled(int $a_obj_id)
foreach($_POST as $key=> $value) $res
updateSubscriptionTime($a_usr_id, $a_subtime)
Update subscription time.
isSubscriber($a_usr_id)
check if is subscriber
getCountParticipants()
Get number of participants.
getSubscribers()
get all subscribers
static _lookupObjId($a_id)
getParticipants()
Get all participants ids.
addSubscriber($a_usr_id)
Add subscriber.
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user's personal desktop
static _hasPassed($a_obj_id, $a_usr_id)
Check if user has passed course.
isContact($a_usr_id)
Check if user is contact.
const IL_CRS_ADMIN
Base class for course and group participants.
isBlocked($a_usr_id)
Check if user is blocked.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupType($a_id, $a_reference=false)
lookup object type
hasPassed($a_usr_id)
Check if user has passed course.
getRoles()
Get course roles.
static getInstance($a_ref_id)
Get instance.
static lookupSubscribersData($a_obj_id)
assignSubscribers($a_usr_ids)
Assign subscribers.
static _addDesktopItem($a_usr_id, $a_item_id, $a_type, $a_par="")
add an item to user's personal desktop
updateRoleAssignments($a_usr_id, $a_roles)
Update role assignments.
getAdmins()
Get all admins ids.
getComponent()
Get component name Used for raising events.
static _deleteUser($a_usr_id)
Delete user data.
const IL_ROLE_POSITION_ADMIN
getNotificationRecipients()
Get admin, tutor which have notification enabled.
getContacts()
get user ids which are confirgured as contact
static deleteUserEntry($a_usr_id, $a_obj_id)
Delete one user entry.
static getUserMembershipAssignmentsByType($a_user_ids, $a_type, $a_only_member_roles)
Get user membership assignments by type.
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
isGroupingMember($a_usr_id, $a_field='')
Check grouping membership.
getType()
Get object type.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
isTutor($a_usr_id)
is user tutor
getSubscriberData($a_usr_id)
get subscriber data
const IL_ROLE_POSITION_TUTOR
static _isDesktopItem($a_usr_id, $a_item_id, $a_type)
check wether an item is on the users desktop or not
readParticipants()
Read participants.
getTutors()
Get all tutors ids.