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);
81 $this->ilDB =
$GLOBALS[
'DIC']->database();
82 $this->lng =
$GLOBALS[
'DIC']->language();
83 $this->logger =
$GLOBALS[
'DIC']->logger()->mem();
85 $this->component = $a_component_name;
87 $this->ref_id = $a_ref_id;
110 return self::getInstanceByObjId(
$obj_id);
112 include_once
'./Modules/Session/classes/class.ilSessionParticipants.php';
115 $GLOBALS[
'DIC']->logger()->mem()->logStack();
116 $GLOBALS[
'DIC']->logger()->mem()->warning(
'Invalid ref_id -> obj_id given: ' . $a_ref_id .
' -> ' .
$obj_id);
117 throw new \InvalidArgumentException(
'Invalid obj_id given.');
134 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
138 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
142 include_once
'./Modules/Session/classes/class.ilSessionParticipants.php';
148 $GLOBALS[
'DIC']->logger()->mmbr()->warning(
': Invalid obj_id given: ' . $a_obj_id);
173 $access = $DIC->access();
176 $a_usr_id =
$GLOBALS[
'DIC'][
'ilUser']->getId();
183 if ($access->checkAccess(
'manage_members',
'',
$ref_id)) {
186 $part = self::getInstance(
$ref_id);
187 if ($part->isAssigned($a_usr_id)) {
188 if ($part->getType() ==
'crs') {
193 if ($part->getType() ==
'grp') {
216 $logger = $DIC->logger()->mmbr();
217 $ilDB = $DIC->database();
219 if ($a_only_member_roles) {
220 $j2 =
"JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id) ";
221 $a2 =
'AND obd2.title = ' .
$ilDB->concat(
223 array(
$ilDB->quote(
'il_',
'text')),
225 array(
$ilDB->quote(
'_member_',
'text')),
232 $query =
"SELECT DISTINCT obd.obj_id,obr.ref_id,ua.usr_id FROM rbac_ua ua " .
233 "JOIN rbac_fa fa ON ua.rol_id = fa.rol_id " .
234 "JOIN object_reference obr ON fa.parent = obr.ref_id " .
235 "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
237 "WHERE " .
$ilDB->in(
"obd.type",
$a_type,
false,
"text") .
238 "AND fa.assign = 'y' " .
239 'AND ' .
$ilDB->in(
'ua.usr_id', $a_user_ids,
false,
'integer') .
' ' .
247 while ($row =
$ilDB->fetchObject(
$res)) {
248 $obj_ids[$row->obj_id][] = $row->usr_id;
271 $ilDB = $DIC[
'ilDB'];
278 if ($a_only_member_role) {
279 $j2 =
"JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id) ";
280 $a2 =
'AND obd2.title = ' .
$ilDB->concat(
282 array(
$ilDB->quote(
'il_',
'text')),
284 array(
$ilDB->quote(
'_member_',
'text')),
292 $query =
"SELECT DISTINCT obd.obj_id,obr.ref_id FROM rbac_ua ua " .
293 "JOIN rbac_fa fa ON ua.rol_id = fa.rol_id " .
294 "JOIN object_reference obr ON fa.parent = obr.ref_id " .
295 "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
297 "WHERE " .
$ilDB->in(
"obd.type",
$a_type,
false,
"text") .
298 "AND fa.assign = 'y' " .
299 "AND ua.usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
302 while ($row =
$ilDB->fetchObject(
$res)) {
303 $ref_ids[] = $row->obj_id;
306 return $ref_ids ? $ref_ids : array();
323 $rbacreview = $DIC[
'rbacreview'];
325 $local_roles = $rbacreview->getRolesOfRoleFolder($a_ref_id,
false);
327 return $rbacreview->isAssignedToAtLeastOneGivenRole($a_usr_id, $local_roles);
341 $rbacreview = $DIC[
'rbacreview'];
343 $lroles = $rbacreview->getRolesOfRoleFolder($a_ref_id,
false);
344 return $rbacreview->getNumberOfAssignedUsers($lroles);
358 $rbacreview = $DIC->rbac()->review();
359 $ilObjDataCache = $DIC[
'ilObjDataCache'];
361 $has_policies = $rbacreview->getLocalPolicies($a_ref_id);
363 if (!$has_policies) {
366 $lroles = $rbacreview->getRolesOfRoleFolder($a_ref_id,
false);
368 $memberRoles = array();
369 foreach ($lroles as $role_id) {
370 $title = $ilObjDataCache->lookupTitle($role_id);
371 switch (substr($title, 0, 8)) {
378 $memberRoles[] = $role_id;
382 return $rbacreview->getNumberOfAssignedUsers($memberRoles);
399 $ilDB = $DIC[
'ilDB'];
401 $query =
"SELECT * FROM obj_members " .
402 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
403 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
404 "AND blocked = " .
$ilDB->quote(1,
'integer');
406 return $res->numRows() ? true :
false;
422 $ilDB = $DIC[
'ilDB'];
424 $query =
"SELECT * FROM obj_members " .
425 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
426 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
429 return $res->numRows() ? true :
false;
445 $ilDB = $DIC[
'ilDB'];
447 $query =
"DELETE FROM obj_members " .
448 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" ";
451 $query =
"DELETE FROM il_subscribers " .
452 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
"";
455 $query =
'DELETE FROM crs_waiting_list ' .
456 'WHERE obj_id = ' .
$ilDB->quote($a_obj_id,
'integer');
474 $ilDB = $DIC[
'ilDB'];
476 $query =
"DELETE FROM obj_members WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
"";
479 $query =
"DELETE FROM il_subscribers WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
"";
482 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
495 if (!in_array(
$type, array(
'crs',
'grp'))) {
501 $rbacreview = $DIC[
'rbacreview'];
504 $roles = $rbacreview->getRolesOfRoleFolder($a_ref_id,
false);
506 foreach (
$roles as $role) {
508 if (substr($title, 0, 13) == (
'il_' .
$type .
'_member')) {
543 $ilDB = $DIC[
'ilDB'];
545 $query =
"SELECT * FROM obj_members " .
546 "WHERE notification = 1 " .
547 "AND obj_id = " .
$ilDB->quote($this->obj_id) .
" ";
551 if ($this->
isAdmin($row->usr_id) or $this->
isTutor($row->usr_id)) {
552 $recp[] = $row->usr_id;
566 return count($this->members);
577 return count($this->participants);
591 return $this->participants ? $this->participants : array();
603 return $this->members ? $this->members : array();
613 return $this->admins ? $this->admins : array();
634 return $this->tutors ? $this->tutors : array();
646 return in_array($a_usr_id, $this->admins) ? true :
false;
658 return in_array($a_usr_id, $this->tutors) ? true :
false;
670 return in_array($a_usr_id, $this->members) ? true :
false;
685 return in_array($a_usr_id, $this->participants);
708 return $this->roles ? $this->roles : array();
722 $rbacreview = $DIC[
'rbacreview'];
724 foreach ($this->roles as $role) {
725 if ($rbacreview->isAssigned($a_usr_id, $role)) {
729 return $assigned ? $assigned : array();
744 $rbacreview = $DIC[
'rbacreview'];
745 $rbacadmin = $DIC[
'rbacadmin'];
747 $roles = $a_roles ? $a_roles : array();
749 foreach ($this->
getRoles() as $role_id) {
750 if ($rbacreview->isAssigned($a_usr_id, $role_id)) {
751 if (!in_array($role_id,
$roles)) {
752 $rbacadmin->deassignUser($role_id, $a_usr_id);
755 if (in_array($role_id,
$roles)) {
756 $rbacadmin->assignUser($role_id, $a_usr_id);
760 $rbacreview->clearCaches();
774 foreach ($this->
getAdmins() as $admin_id) {
775 if (!in_array($admin_id, $a_usr_ids)) {
791 if (isset($this->participants_status[$a_usr_id])) {
792 return $this->participants_status[$a_usr_id][
'blocked'] ? true :
false;
806 if (isset($this->participants_status[$a_usr_id])) {
807 return $this->participants_status[$a_usr_id][
'passed'] ? true :
false;
819 public function delete($a_usr_id)
823 $rbacadmin = $DIC[
'rbacadmin'];
824 $ilDB = $DIC[
'ilDB'];
826 $this->recommended_content_manager->removeObjectRecommendation($a_usr_id, $this->ref_id);
828 foreach ($this->roles as $role_id) {
829 $rbacadmin->deassignUser($role_id, $a_usr_id);
832 $query =
"DELETE FROM obj_members " .
833 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
834 "AND obj_id = " .
$ilDB->quote($this->obj_id,
'integer');
840 $GLOBALS[
'DIC'][
'ilAppEventHandler']->raise(
844 'obj_id' => $this->obj_id,
845 'usr_id' => $a_usr_id)
863 $ilDB = $DIC[
'ilDB'];
865 $this->participants_status[$a_usr_id][
'blocked'] = (int) $a_blocked;
867 $query =
"SELECT * FROM obj_members " .
868 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" " .
869 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer');
871 if (
$res->numRows()) {
872 $query =
"UPDATE obj_members SET " .
873 "blocked = " .
$ilDB->quote((
int) $a_blocked,
'integer') .
" " .
874 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" " .
875 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer');
877 $query =
"INSERT INTO obj_members (blocked,obj_id,usr_id,notification,passed) " .
879 $ilDB->quote((
int) $a_blocked,
'integer') .
", " .
880 $ilDB->quote($this->obj_id,
'integer') .
", " .
881 $ilDB->quote($a_usr_id,
'integer') .
", " .
882 $ilDB->quote(0,
'integer') .
", " .
883 $ilDB->quote(0,
'integer') .
902 $ilDB = $DIC[
'ilDB'];
905 'UPDATE obj_members SET ' .
906 'contact = ' .
$ilDB->quote($a_contact,
'integer') .
' ' .
907 'WHERE obj_id = ' .
$ilDB->quote($this->obj_id,
'integer') .
' ' .
908 'AND usr_id = ' .
$ilDB->quote($a_usr_id,
'integer')
911 $this->participants_status[$a_usr_id][
'contact'] = $a_contact;
922 foreach ((array) $this->participants_status as $usr_id => $status) {
923 if ($status[
'contact']) {
924 $contacts[] = $usr_id;
945 $ilDB = $DIC[
'ilDB'];
947 $this->participants_status[$a_usr_id][
'notification'] = (int) $a_notification;
949 $query =
"SELECT * FROM obj_members " .
950 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" " .
951 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer');
953 if (
$res->numRows()) {
954 $query =
"UPDATE obj_members SET " .
955 "notification = " .
$ilDB->quote((
int) $a_notification,
'integer') .
" " .
956 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" " .
957 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer');
959 $query =
"INSERT INTO obj_members (notification,obj_id,usr_id,passed,blocked) " .
961 $ilDB->quote((
int) $a_notification,
'integer') .
", " .
962 $ilDB->quote($this->obj_id,
'integer') .
", " .
963 $ilDB->quote($a_usr_id,
'integer') .
", " .
964 $ilDB->quote(0,
'integer') .
", " .
965 $ilDB->quote(0,
'integer') .
983 public function add($a_usr_id, $a_role)
987 $rbacadmin = $DIC[
'rbacadmin'];
988 $ilAppEventHandler = $DIC[
'ilAppEventHandler'];
996 $this->admins[] = $a_usr_id;
1000 $this->tutors[] = $a_usr_id;
1004 $this->members[] = $a_usr_id;
1008 $this->admins[] = $a_usr_id;
1012 $this->members[] = $a_usr_id;
1016 $this->admins[] = $a_usr_id;
1020 $this->members[] = $a_usr_id;
1024 $this->members[] = $a_usr_id;
1028 $this->participants[] = $a_usr_id;
1029 $rbacadmin->assignUser($this->role_data[$a_role], $a_usr_id);
1034 include_once
'./Services/Membership/classes/class.ilWaitingList.php';
1037 $ilAppEventHandler->raise(
1041 'obj_id' => $this->obj_id,
1042 'usr_id' => $a_usr_id,
1043 'role_id' => $a_role)
1058 foreach ($a_user_ids as $user_id) {
1059 $this->
delete($user_id);
1090 if (isset($this->participants_status[$a_usr_id])) {
1091 return $this->participants_status[$a_usr_id][
'notification'] ? true :
false;
1103 if (isset($this->participants_status[$a_usr_id])) {
1104 return (
bool) $this->participants_status[$a_usr_id][
'contact'];
1117 if (array_key_exists($a_role_type, $this->role_data)) {
1118 return $this->role_data[$a_role_type];
1136 $rbacreview = $DIC[
'rbacreview'];
1137 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1140 $GLOBALS[
'DIC'][
'rbacreview']->clearCaches();
1141 $this->roles = $rbacreview->getRolesOfRoleFolder($this->ref_id,
false);
1144 $this->participants = array();
1145 $this->members = $this->admins = $this->tutors = array();
1147 $additional_roles = [];
1148 $auto_generated_roles = [];
1149 foreach ($this->roles as $role_id) {
1150 $title = $ilObjDataCache->lookupTitle($role_id);
1151 switch (substr($title, 0, 8)) {
1155 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1156 $this->members = array_unique(array_merge($assigned, $this->members));
1157 $this->role_assignments[$role_id] = $assigned;
1163 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1164 $this->admins = $rbacreview->assignedUsers($role_id);
1165 $this->role_assignments[$role_id] = $assigned;
1171 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1172 $this->tutors = $rbacreview->assignedUsers($role_id);
1173 $this->role_assignments[$role_id] = $assigned;
1179 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1180 $this->admins = $rbacreview->assignedUsers($role_id);
1181 $this->role_assignments[$role_id] = $assigned;
1187 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1188 $this->members = $rbacreview->assignedUsers($role_id);
1189 $this->role_assignments[$role_id] = $assigned;
1194 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1195 $this->members = $rbacreview->assignedUsers($role_id);
1201 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1202 $this->members = $rbacreview->assignedUsers($role_id);
1203 $this->role_assignments[$role_id] = $assigned;
1209 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1210 $this->admins = $rbacreview->assignedUsers($role_id);
1211 $this->role_assignments[$role_id] = $assigned;
1215 $additional_roles[$role_id] = $title;
1216 $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id),
$this->participants));
1217 $this->members = array_unique(array_merge($assigned, $this->members));
1218 $this->role_assignments[$role_id] = $assigned;
1222 asort($auto_generated_roles);
1223 asort($additional_roles);
1224 $this->roles_sorted = $auto_generated_roles + $additional_roles;
1238 $ilDB = $DIC[
'ilDB'];
1240 $query =
"SELECT * FROM obj_members " .
1241 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" ";
1243 $this->participants_status = array();
1245 $this->participants_status[$row->usr_id][
'blocked'] = $row->blocked;
1246 $this->participants_status[$row->usr_id][
'notification'] = $row->notification;
1247 $this->participants_status[$row->usr_id][
'passed'] = $row->passed;
1249 $this->participants_status[$row->usr_id][
'contact'] = $row->contact;
1265 $rbacreview = $DIC[
'rbacreview'];
1266 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1267 $ilDB = $DIC[
'ilDB'];
1271 include_once
'./Services/User/classes/class.ilObjUser.php';
1276 $and =
"AND login = " .
$ilDB->quote($tmp_user->getLogin(),
'text') .
" ";
1279 $and =
"AND email = " .
$ilDB->quote($tmp_user->getEmail(),
'text') .
" ";
1281 case 'matriculation':
1282 $and =
"AND matriculation = " .
$ilDB->quote($tmp_user->getMatriculation(),
'text') .
" ";
1286 $and =
"AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" ";
1294 $query =
"SELECT * FROM usr_data ud " .
1299 return $res->numRows() ? true :
false;
1307 $ilDB = $DIC[
'ilDB'];
1310 $query =
"SELECT usr_id FROM il_subscribers " .
1311 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
1312 "ORDER BY sub_time ";
1363 if (!is_array($a_usr_ids) or !count($a_usr_ids)) {
1366 foreach ($a_usr_ids as $id) {
1387 $ilErr->appendMessage($this->lng->txt(
"crs_user_notsubscribed"));
1393 $ilErr->appendMessage($tmp_obj->getLogin() .
": " . $this->lng->txt(
"crs_user_already_assigned"));
1399 $ilErr->appendMessage($this->lng->txt(
"crs_user_not_exists"));
1415 $this->
register($tmp_obj->getId());
1431 foreach ($this->subscribers as $subscriber) {
1436 #$this->sendNotification($this->NOTIFY_ACCEPT_SUBSCRIBER,$subscriber); 1453 $ilDB = $DIC[
'ilDB'];
1455 $query =
"INSERT INTO il_subscribers (usr_id,obj_id,subject,sub_time) " .
1457 $ilDB->quote($a_usr_id,
'integer') .
"," .
1458 $ilDB->quote($this->obj_id,
'integer') .
", " .
1459 $ilDB->quote(
'',
'text') .
", " .
1460 $ilDB->quote(time(),
'integer') .
1477 $ilDB = $DIC[
'ilDB'];
1479 $query =
"UPDATE il_subscribers " .
1480 "SET sub_time = " .
$ilDB->quote($a_subtime,
'integer') .
" " .
1481 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
1482 "AND obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" ";
1499 $ilDB = $DIC[
'ilDB'];
1501 $query =
"UPDATE il_subscribers " .
1502 "SET subject = " .
$ilDB->quote($a_subject,
'text') .
" " .
1503 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
1504 "AND obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" ";
1519 $ilDB = $DIC[
'ilDB'];
1521 $query =
"DELETE FROM il_subscribers " .
1522 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
1523 "AND obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" ";
1540 $ilDB = $DIC[
'ilDB'];
1542 if (!is_array($a_usr_ids) or !count($a_usr_ids)) {
1544 $ilErr->appendMessage($this->lng->txt(
"no_usr_ids_given"));
1548 $query =
"DELETE FROM il_subscribers " .
1549 "WHERE " .
$ilDB->in(
'usr_id', (array) $a_usr_ids,
false,
'integer') .
" " .
1550 "AND obj_id = " .
$ilDB->quote($this->obj_id,
'integer');
1565 $ilDB = $DIC[
'ilDB'];
1567 $query =
"SELECT * FROM il_subscribers " .
1568 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
1569 "AND obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
"";
1588 $ilDB = $DIC[
'ilDB'];
1590 $query =
"SELECT * FROM il_subscribers " .
1591 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
1592 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
"";
1610 $ilDB = $DIC[
'ilDB'];
1612 $this->subscribers = array();
1614 $query =
"SELECT usr_id FROM il_subscribers " .
1615 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" " .
1616 "ORDER BY sub_time ";
1624 $this->subscribers[] = $row->usr_id;
1638 $ilDB = $DIC[
'ilDB'];
1640 $query =
"SELECT * FROM il_subscribers " .
1641 "WHERE obj_id = " .
$ilDB->quote($this->obj_id,
'integer') .
" " .
1642 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
"";
1646 $data[
"time"] = $row->sub_time;
1647 $data[
"usr_id"] = $row->usr_id;
1648 $data[
'subject'] = $row->subject;
1657 $ilDB = $DIC[
'ilDB'];
1659 $query =
'SELECT * FROM il_subscribers ' .
1660 'WHERE obj_id = ' .
$ilDB->quote($a_obj_id,
'integer');
1665 $data[$row->usr_id][
'time'] = $row->sub_time;
1666 $data[$row->usr_id][
'usr_id'] = $row->usr_id;
1667 $data[$row->usr_id][
'subject'] = $row->subject;
1683 $ilDB = $DIC[
'ilDB'];
1689 $j2 =
"JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id) ";
1690 $a2 =
"AND obd2.title LIKE 'il_" .
$a_type .
"_mem%' ";
1693 $query =
"SELECT DISTINCT obd.obj_id,obr.ref_id FROM rbac_ua ua " .
1694 "JOIN rbac_fa fa ON ua.rol_id = fa.rol_id " .
1695 "JOIN object_reference obr ON fa.parent = obr.ref_id " .
1696 "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
1698 "WHERE obd.type = " .
$ilDB->quote(
$a_type,
'text') .
" " .
1699 "AND fa.assign = 'y' " .
1700 "AND ua.usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
1705 while ($row =
$ilDB->fetchObject(
$res)) {
1706 $obj_ids[] = $row->obj_id;
1709 $set =
$ilDB->query(
"SELECT obj_id, usr_id FROM obj_members " .
1710 " WHERE " .
$ilDB->in(
"obj_id", $obj_ids,
false,
"integer") .
1711 " AND contact = " .
$ilDB->quote(1,
"integer"));
1713 while ($rec =
$ilDB->fetchAssoc($set)) {
1728 $sortable_assignments =
'9999999999';
1729 foreach ($this->roles_sorted as $role_id => $trash) {
1730 if (in_array($a_user_id, (array) $this->role_assignments[$role_id])) {
1731 $sortable_assignments = substr_replace($sortable_assignments,
'1', $counter, 1);
1735 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.
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.
isNotificationEnabled($a_usr_id)
check if notification is enabled
$recommended_content_manager
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.
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.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
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.
updateRoleAssignments($a_usr_id, $a_roles)
Update role assignments.
addRecommendation($a_usr_id)
Add desktop item.
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.
Recommended content manager (business logic)
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
isGroupingMember($a_usr_id, $a_field='')
Check grouping membership.
getType()
Get object type.
isTutor($a_usr_id)
is user tutor
getSubscriberData($a_usr_id)
get subscriber data
const IL_ROLE_POSITION_TUTOR
readParticipants()
Read participants.
getTutors()
Get all tutors ids.