12define(
"IL_CRS_ADMIN", 1);
 
   13define(
"IL_CRS_TUTOR", 3);
 
   14define(
"IL_CRS_MEMBER", 2);
 
   16define(
'IL_GRP_ADMIN', 4);
 
   17define(
'IL_GRP_MEMBER', 5);
 
   19define(
'IL_SESS_MEMBER', 6);
 
   21define(
"IL_ROLE_POSITION_ADMIN", 1);
 
   22define(
"IL_ROLE_POSITION_TUTOR", 2);
 
   23define(
"IL_ROLE_POSITION_MEMBER", 3);
 
   75        $this->lng = 
$GLOBALS[
'DIC']->language();
 
   76        $this->logger = 
$GLOBALS[
'DIC']->logger()->mem();
 
   78        $this->component = $a_component_name;
 
   80        $this->ref_id = $a_ref_id;
 
  104                include_once 
'./Modules/Session/classes/class.ilSessionParticipants.php';
 
  108                $GLOBALS[
'DIC']->logger()->mem()->logStack();
 
  109                $GLOBALS[
'DIC']->logger()->mem()->warning(
'Invalid ref_id -> obj_id given: ' . $a_ref_id . 
' -> ' . 
$obj_id);
 
  110                throw new \InvalidArgumentException(
'Invalid obj_id given.');
 
  127                include_once 
'./Modules/Course/classes/class.ilCourseParticipants.php';
 
  131                include_once 
'./Modules/Group/classes/class.ilGroupParticipants.php';
 
  135                include_once 
'./Modules/Session/classes/class.ilSessionParticipants.php';
 
  140                $GLOBALS[
'ilLog']->write(__METHOD__ . 
': Invalid obj_id given: ' . $a_obj_id);
 
  141                throw new InvalidArgumentException(
'Invalid obj id given');
 
  165        $access = 
$DIC->access();
 
  168            $a_usr_id = 
$GLOBALS[
'ilUser']->getId();
 
  175        if ($access->checkAccess(
'manage_members', 
'', 
$ref_id)) {
 
  179        if ($part->isAssigned($a_usr_id)) {
 
  180            if ($part->getType() == 
'crs') {
 
  185            if ($part->getType() == 
'grp') {
 
  216        if ($a_only_member_role) {
 
  217            $j2 = 
"JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id) ";
 
  218            $a2 = 
'AND obd2.title = ' . 
$ilDB->concat(
 
  220                    array(
$ilDB->quote(
'il_', 
'text')),
 
  222                    array(
$ilDB->quote(
'_member_', 
'text')),
 
  230        $query = 
"SELECT DISTINCT obd.obj_id,obr.ref_id FROM rbac_ua ua " .
 
  231            "JOIN rbac_fa fa ON ua.rol_id = fa.rol_id " .
 
  232            "JOIN object_reference obr ON fa.parent = obr.ref_id " .
 
  233            "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
 
  235            "WHERE " . 
$ilDB->in(
"obd.type", 
$a_type, 
false, 
"text") .
 
  236            "AND fa.assign = 'y' " .
 
  237            "AND ua.usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
  241            $ref_ids[] = 
$row->obj_id;
 
  244        return $ref_ids ? $ref_ids : array();
 
  261        $local_roles = $rbacreview->getRolesOfRoleFolder($a_ref_id, 
false);
 
  263        return $rbacreview->isAssignedToAtLeastOneGivenRole($a_usr_id, $local_roles);
 
  277        $lroles = $rbacreview->getRolesOfRoleFolder($a_ref_id, 
false);
 
  278        return $rbacreview->getNumberOfAssignedUsers($lroles);
 
  290        global $rbacreview, $ilObjDataCache;
 
  292        $has_policies = $rbacreview->getLocalPolicies($a_ref_id);
 
  294        if (!$has_policies) {
 
  297        $lroles = $rbacreview->getRolesOfRoleFolder($a_ref_id, 
false);
 
  299        $memberRoles = array();
 
  300        foreach ($lroles as $role_id) {
 
  301            $title = $ilObjDataCache->lookupTitle($role_id);
 
  302            switch (substr(
$title, 0, 8)) {
 
  309                    $memberRoles[] = $role_id;
 
  313        return $rbacreview->getNumberOfAssignedUsers($memberRoles);
 
  330        $query = 
"SELECT * FROM obj_members " .
 
  331            "WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
'integer') . 
" " .
 
  332            "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
  333            "AND blocked = " . 
$ilDB->quote(1, 
'integer');
 
  335        return $res->numRows() ? true : 
false;
 
  351        $query = 
"SELECT * FROM obj_members " .
 
  352            "WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
'integer') . 
" " .
 
  353            "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
  356        return $res->numRows() ? true : 
false;
 
  372        $query = 
"DELETE FROM obj_members " .
 
  373            "WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
'integer') . 
" ";
 
  376        $query = 
"DELETE FROM il_subscribers " .
 
  377            "WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
'integer') . 
"";
 
  380        $query = 
'DELETE FROM crs_waiting_list ' .
 
  381                'WHERE obj_id = ' . 
$ilDB->quote($a_obj_id, 
'integer');
 
  399        $query = 
"DELETE FROM obj_members WHERE usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
"";
 
  402        $query = 
"DELETE FROM il_subscribers WHERE usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
"";
 
  405        include_once 
'./Modules/Course/classes/class.ilCourseWaitingList.php';
 
  416        if (!in_array(
$type, array(
'crs',
'grp'))) {
 
  423        $roles = $rbacreview->getRolesOfRoleFolder($a_ref_id, 
false);
 
  425        foreach (
$roles as $role) {
 
  427            if (substr(
$title, 0, 13) == (
'il_' . 
$type . 
'_member')) {
 
  462        $query = 
"SELECT * FROM obj_members " .
 
  463            "WHERE notification = 1 " .
 
  464            "AND obj_id = " . 
$ilDB->quote($this->obj_id) . 
" ";
 
  468                $recp[] = 
$row->usr_id;
 
  471        return $recp ? $recp : array();
 
  482        return count($this->members);
 
  493        return count($this->participants);
 
  507        return $this->participants ? $this->participants : array();
 
  519        return $this->members ? $this->members : array();
 
  529        return $this->admins ? $this->admins : array();
 
  550        return $this->tutors ? $this->tutors : array();
 
  562        return in_array($a_usr_id, $this->admins) ? true : 
false;
 
  574        return in_array($a_usr_id, $this->tutors) ? true : 
false;
 
  586        return in_array($a_usr_id, $this->members) ? true : 
false;
 
  601        return in_array($a_usr_id, $this->participants);
 
  624        return $this->roles ? $this->roles : array();
 
  638        foreach ($this->roles as $role) {
 
  639            if ($rbacreview->isAssigned($a_usr_id, $role)) {
 
  643        return $assigned ? $assigned : array();
 
  656        global $rbacreview,$rbacadmin;
 
  658        $roles = $a_roles ? $a_roles : array();
 
  660        foreach ($this->
getRoles() as $role_id) {
 
  661            if ($rbacreview->isAssigned($a_usr_id, $role_id)) {
 
  662                if (!in_array($role_id, 
$roles)) {
 
  663                    $rbacadmin->deassignUser($role_id, $a_usr_id);
 
  666                if (in_array($role_id, 
$roles)) {
 
  667                    $rbacadmin->assignUser($role_id, $a_usr_id);
 
  671        $rbacreview->clearCaches();
 
  685        foreach ($this->
getAdmins() as $admin_id) {
 
  686            if (!in_array($admin_id, $a_usr_ids)) {
 
  702        if (isset($this->participants_status[$a_usr_id])) {
 
  703            return $this->participants_status[$a_usr_id][
'blocked'] ? true : 
false;
 
  717        if (isset($this->participants_status[$a_usr_id])) {
 
  718            return $this->participants_status[$a_usr_id][
'passed'] ? true : 
false;
 
  730    public function delete($a_usr_id)
 
  732        global $rbacadmin,
$ilDB;
 
  735        foreach ($this->roles as $role_id) {
 
  736            $rbacadmin->deassignUser($role_id, $a_usr_id);
 
  739        $query = 
"DELETE FROM obj_members " .
 
  740            "WHERE usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
  741            "AND obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer');
 
  747        $GLOBALS[
'ilAppEventHandler']->raise(
 
  751                    'obj_id' => $this->obj_id,
 
  752                    'usr_id' => $a_usr_id)
 
  770        $this->participants_status[$a_usr_id][
'blocked'] = (int) $a_blocked;
 
  772        $query = 
"SELECT * FROM obj_members " .
 
  773        "WHERE obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer') . 
" " .
 
  774        "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer');
 
  776        if (
$res->numRows()) {
 
  777            $query = 
"UPDATE obj_members SET " .
 
  778                "blocked = " . 
$ilDB->quote((
int) $a_blocked, 
'integer') . 
" " .
 
  779                "WHERE obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer') . 
" " .
 
  780                "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer');
 
  782            $query = 
"INSERT INTO obj_members (blocked,obj_id,usr_id,notification,passed) " .
 
  784                $ilDB->quote((
int) $a_blocked, 
'integer') . 
", " .
 
  785                $ilDB->quote($this->obj_id, 
'integer') . 
", " .
 
  786                $ilDB->quote($a_usr_id, 
'integer') . 
", " .
 
  787                $ilDB->quote(0, 
'integer') . 
", " .
 
  788                $ilDB->quote(0, 
'integer') .
 
  808            'UPDATE obj_members SET ' .
 
  809                'contact = ' . 
$ilDB->quote($a_contact, 
'integer') . 
' ' .
 
  810                'WHERE obj_id = ' . 
$ilDB->quote($this->obj_id, 
'integer') . 
' ' .
 
  811                'AND usr_id = ' . 
$ilDB->quote($a_usr_id, 
'integer')
 
  814        $this->participants_status[$a_usr_id][
'contact'] = $a_contact;
 
  825        foreach ((array) $this->participants_status as $usr_id => $status) {
 
  826            if ($status[
'contact']) {
 
  827                $contacts[] = $usr_id;
 
  848        $this->participants_status[$a_usr_id][
'notification'] = (int) $a_notification;
 
  850        $query = 
"SELECT * FROM obj_members " .
 
  851        "WHERE obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer') . 
" " .
 
  852        "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer');
 
  854        if (
$res->numRows()) {
 
  855            $query = 
"UPDATE obj_members SET " .
 
  856                "notification = " . 
$ilDB->quote((
int) $a_notification, 
'integer') . 
" " .
 
  857                "WHERE obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer') . 
" " .
 
  858                "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer');
 
  860            $query = 
"INSERT INTO obj_members (notification,obj_id,usr_id,passed,blocked) " .
 
  862                $ilDB->quote((
int) $a_notification, 
'integer') . 
", " .
 
  863                $ilDB->quote($this->obj_id, 
'integer') . 
", " .
 
  864                $ilDB->quote($a_usr_id, 
'integer') . 
", " .
 
  865                $ilDB->quote(0, 
'integer') . 
", " .
 
  866                $ilDB->quote(0, 
'integer') .
 
  884    public function add($a_usr_id, $a_role)
 
  886        global $rbacadmin,
$ilLog,$ilAppEventHandler;
 
  894                $this->admins[] = $a_usr_id;
 
  898                $this->tutors[] = $a_usr_id;
 
  902                $this->members[] = $a_usr_id;
 
  906                $this->admins[] = $a_usr_id;
 
  910                $this->members[] = $a_usr_id;
 
  914                $this->members[] = $a_usr_id;
 
  918        $this->participants[] = $a_usr_id;
 
  919        $rbacadmin->assignUser($this->role_data[$a_role], $a_usr_id);
 
  924        include_once 
'./Services/Membership/classes/class.ilWaitingList.php';
 
  927        $ilLog->write(__METHOD__ . 
': Raise new event: ' . $this->
getComponent() . 
' addParticipant');
 
  928        $ilAppEventHandler->raise(
 
  932                    'obj_id' => $this->obj_id,
 
  933                    'usr_id' => $a_usr_id,
 
  934                    'role_id' => $a_role)
 
  949        foreach ($a_user_ids as $user_id) {
 
  950            $this->
delete($user_id);
 
  997        if (isset($this->participants_status[$a_usr_id])) {
 
  998            return $this->participants_status[$a_usr_id][
'notification'] ? true : 
false;
 
 1010        if (isset($this->participants_status[$a_usr_id])) {
 
 1011            return (
bool) $this->participants_status[$a_usr_id][
'contact'];
 
 1024        if (array_key_exists($a_role_type, $this->role_data)) {
 
 1025            return $this->role_data[$a_role_type];
 
 1041        global $rbacreview,$ilObjDataCache,
$ilLog;
 
 1043        $GLOBALS[
'rbacreview']->clearCaches();
 
 1044        $this->roles = $rbacreview->getRolesOfRoleFolder($this->ref_id, 
false);
 
 1047        $this->participants = array();
 
 1048        $this->members = $this->admins = $this->tutors = array();
 
 1050        $additional_roles = [];
 
 1051        $auto_generated_roles = [];
 
 1052        foreach ($this->roles as $role_id) {
 
 1053            $title = $ilObjDataCache->lookupTitle($role_id);
 
 1054            switch (substr(
$title, 0, 8)) {
 
 1058                    $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id), $this->participants));
 
 1059                    $this->members = array_unique(array_merge($assigned, $this->members));
 
 1060                    $this->role_assignments[$role_id] = $assigned;
 
 1066                    $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id), $this->participants));
 
 1067                    $this->admins = $rbacreview->assignedUsers($role_id);
 
 1068                    $this->role_assignments[$role_id] = $assigned;
 
 1074                    $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id), $this->participants));
 
 1075                    $this->tutors = $rbacreview->assignedUsers($role_id);
 
 1076                    $this->role_assignments[$role_id] = $assigned;
 
 1082                    $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id), $this->participants));
 
 1083                    $this->admins = $rbacreview->assignedUsers($role_id);
 
 1084                    $this->role_assignments[$role_id] = $assigned;
 
 1090                    $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id), $this->participants));
 
 1091                    $this->members = $rbacreview->assignedUsers($role_id);
 
 1092                    $this->role_assignments[$role_id] = $assigned;
 
 1097                    $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id), $this->participants));
 
 1098                    $this->members = $rbacreview->assignedUsers($role_id);
 
 1103                    $additional_roles[$role_id] = 
$title;
 
 1104                    $this->participants = array_unique(array_merge($assigned = $rbacreview->assignedUsers($role_id), $this->participants));
 
 1105                    $this->members = array_unique(array_merge($assigned, $this->members));
 
 1106                    $this->role_assignments[$role_id] = $assigned;
 
 1110        asort($auto_generated_roles);
 
 1111        asort($additional_roles);
 
 1112        $this->roles_sorted = $auto_generated_roles + $additional_roles;
 
 1126        $query = 
"SELECT * FROM obj_members " .
 
 1127            "WHERE obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer') . 
" ";
 
 1129        $this->participants_status = array();
 
 1131            $this->participants_status[
$row->usr_id][
'blocked'] = 
$row->blocked;
 
 1132            $this->participants_status[
$row->usr_id][
'notification']  = 
$row->notification;
 
 1133            $this->participants_status[
$row->usr_id][
'passed'] = 
$row->passed;
 
 1135            $this->participants_status[
$row->usr_id][
'contact'] = 
$row->contact;
 
 1149        global $rbacreview,$ilObjDataCache,
$ilDB;
 
 1153            include_once 
'./Services/User/classes/class.ilObjUser.php';
 
 1158                    $and = 
"AND login = " . 
$ilDB->quote($tmp_user->getLogin(), 
'text') . 
" ";
 
 1161                    $and = 
"AND email = " . 
$ilDB->quote($tmp_user->getEmail(), 
'text') . 
" ";
 
 1163                case 'matriculation':
 
 1164                    $and = 
"AND matriculation = " . 
$ilDB->quote($tmp_user->getMatriculation(), 
'text') . 
" ";
 
 1168                    $and = 
"AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" ";
 
 1176            $query = 
"SELECT * FROM usr_data ud " .
 
 1177                "WHERE " . $ilDB->in(
'usr_id', $this->
getParticipants(), 
false, 
'integer') . 
" " .
 
 1181            return $res->numRows() ? true : 
false;
 
 1190        $query = 
"SELECT usr_id FROM il_subscribers " .
 
 1191            "WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
'integer') . 
" " .
 
 1192            "ORDER BY sub_time ";
 
 1243        if (!is_array($a_usr_ids) or !count($a_usr_ids)) {
 
 1246        foreach ($a_usr_ids as 
$id) {
 
 1265            $ilErr->appendMessage($this->lng->txt(
"crs_user_notsubscribed"));
 
 1271            $ilErr->appendMessage($tmp_obj->getLogin() . 
": " . $this->lng->txt(
"crs_user_already_assigned"));
 
 1277            $ilErr->appendMessage($this->lng->txt(
"crs_user_not_exists"));
 
 1290            $this->
register($tmp_obj->getId());
 
 1306        foreach ($this->subscribers as $subscriber) {
 
 1311                #$this->sendNotification($this->NOTIFY_ACCEPT_SUBSCRIBER,$subscriber); 
 1328        $query = 
"INSERT INTO il_subscribers (usr_id,obj_id,subject,sub_time) " .
 
 1330            $ilDB->quote($a_usr_id, 
'integer') . 
"," .
 
 1331            $ilDB->quote($this->obj_id, 
'integer') . 
", " .
 
 1332            $ilDB->quote(
'', 
'text') . 
", " .
 
 1333            $ilDB->quote(time(), 
'integer') .
 
 1350        $query = 
"UPDATE il_subscribers " .
 
 1351            "SET sub_time = " . 
$ilDB->quote($a_subtime, 
'integer') . 
" " .
 
 1352            "WHERE usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
 1353            "AND obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer') . 
" ";
 
 1370        $query = 
"UPDATE il_subscribers " .
 
 1371            "SET subject = " . 
$ilDB->quote($a_subject, 
'text') . 
" " .
 
 1372            "WHERE usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
 1373            "AND obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer') . 
" ";
 
 1388        $query = 
"DELETE FROM il_subscribers " .
 
 1389            "WHERE usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
 1390            "AND obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer') . 
" ";
 
 1406        if (!is_array($a_usr_ids) or !count($a_usr_ids)) {
 
 1408            $ilErr->appendMessage($this->lng->txt(
"no_usr_ids_given"));
 
 1412        $query = 
"DELETE FROM il_subscribers " .
 
 1413            "WHERE " . 
$ilDB->in(
'usr_id', (array) $a_usr_ids, 
false, 
'integer') . 
" " .
 
 1414            "AND obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer');
 
 1429        $query = 
"SELECT * FROM il_subscribers " .
 
 1430            "WHERE usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
 1431            "AND obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer') . 
"";
 
 1450        $query = 
"SELECT * FROM il_subscribers " .
 
 1451            "WHERE usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
 1452            "AND obj_id = " . 
$ilDB->quote($a_obj_id, 
'integer') . 
"";
 
 1470        $this->subscribers = array();
 
 1472        $query = 
"SELECT usr_id FROM il_subscribers " .
 
 1473            "WHERE obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer') . 
" " .
 
 1474            "ORDER BY sub_time ";
 
 1482            $this->subscribers[] = 
$row->usr_id;
 
 1496        $query = 
"SELECT * FROM il_subscribers " .
 
 1497            "WHERE obj_id = " . 
$ilDB->quote($this->obj_id, 
'integer') . 
" " .
 
 1498            "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
"";
 
 1513        $query = 
'SELECT * FROM il_subscribers ' .
 
 1514            'WHERE obj_id = ' . 
$ilDB->quote($a_obj_id, 
'integer');
 
 1541        $j2 = 
"JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id) ";
 
 1542        $a2 = 
"AND obd2.title LIKE 'il_" . 
$a_type . 
"_mem%' ";
 
 1545        $query = 
"SELECT DISTINCT obd.obj_id,obr.ref_id FROM rbac_ua ua " .
 
 1546            "JOIN rbac_fa fa ON ua.rol_id = fa.rol_id " .
 
 1547            "JOIN object_reference obr ON fa.parent = obr.ref_id " .
 
 1548            "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
 
 1550            "WHERE obd.type = " . 
$ilDB->quote(
$a_type, 
'text') . 
" " .
 
 1551            "AND fa.assign = 'y' " .
 
 1552            "AND ua.usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
 1558            $obj_ids[] = 
$row->obj_id;
 
 1561        $set = 
$ilDB->query(
"SELECT obj_id, usr_id FROM obj_members " .
 
 1562            " WHERE " . 
$ilDB->in(
"obj_id", $obj_ids, 
false, 
"integer") .
 
 1563            " AND contact = " . 
$ilDB->quote(1, 
"integer"));
 
 1565        while ($rec = 
$ilDB->fetchAssoc($set)) {
 
 1580        $sortable_assignments = 
'9999999999';
 
 1581        foreach ($this->roles_sorted as $role_id => $trash) {
 
 1582            if (in_array($a_user_id, (array) $this->role_assignments[$role_id])) {
 
 1583                $sortable_assignments = substr_replace($sortable_assignments, 
'1', 
$counter, 1);
 
 1587        return $sortable_assignments;
 
An exception for terminatinating execution or to throw for unit testing.
const IL_CRS_ADMIN
Base class for course and group participants.
const IL_ROLE_POSITION_TUTOR
const IL_ROLE_POSITION_ADMIN
const IL_ROLE_POSITION_MEMBER
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
query($sql, $a_handle_error=true)
Query.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static lookupShowMembersEnabled($a_obj_id)
Check if show member is enabled.
static lookupShowMembersEnabled(int $a_obj_id)
static _isDesktopItem($a_usr_id, $a_item_id, $a_type)
check wether an item is on the users desktop or not
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user's personal desktop
static _addDesktopItem($a_usr_id, $a_item_id, $a_type, $a_par="")
add an item to user's personal desktop
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
getAdmins()
Get all admins ids.
getComponent()
Get component name Used for raising events.
isLastAdmin($a_usr_id)
Check if user is last admin.
isAssigned($a_usr_id)
check if user is assigned
updateSubject($a_usr_id, $a_subject)
update subject
assignSubscribers($a_usr_ids)
Assign subscribers.
static getDefaultMemberRole($a_ref_id)
isTutor($a_usr_id)
is user tutor
static hasParticipantListAccess($a_obj_id, $a_usr_id=null)
Check if (current) user has access to the participant list.
getParticipants()
Get all participants ids.
readParticipants()
Read participants.
static _isSubscriber($a_obj_id, $a_usr_id)
check if user is subscriber
deleteSubscriber($a_usr_id)
Delete subsciber.
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
getRoles()
Get course roles.
getCountParticipants()
Get number of participants.
isMember($a_usr_id)
is user member
isAdmin($a_usr_id)
is user admin
getSubscriberData($a_usr_id)
get subscriber data
getType()
Get object type.
dropDesktopItem($a_usr_id)
Drop desktop item.
updateSubscriptionTime($a_usr_id, $a_subtime)
Update subscription time.
add($a_usr_id, $a_role)
Add user to object.
__construct($a_component_name, $a_ref_id)
Singleton Constructor.
static _isParticipant($a_ref_id, $a_usr_id)
Static function to check if a user is a participant of the container object.
getAssignedRoles($a_usr_id)
Get assigned roles.
static _getAllSupportContactsOfUser($a_usr_id, $a_type)
Get all support contacts for a user.
static lookupNumberOfParticipants($a_ref_id)
Lookup the number of participants (crs admins, tutors, members, grp admins, members)
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership
static _isBlocked($a_obj_id, $a_usr_id)
Check if user is blocked.
readParticipantsStatus()
Read status of participants (blocked, notification, passed)
isGroupingMember($a_usr_id, $a_field='')
Check grouping membership.
updateNotification($a_usr_id, $a_notification)
Update notification status.
updateRoleAssignments($a_usr_id, $a_roles)
Update role assignments.
addDesktopItem($a_usr_id)
Add desktop item.
getCountSubscribers()
get number of subscribers
autoFillSubscribers()
Assign subscriber.
static lookupSubscribersData($a_obj_id)
getNotificationRecipients()
Get admin, tutor which have notification enabled.
static lookupSubscribers($a_obj_id)
deleteSubscribers($a_usr_ids)
Delete subscibers.
getMembers()
Get all members ids (admins and tutors are not members) Use get participants to fetch all.
isNotificationEnabled($a_usr_id)
check if notification is enabled
getSubscribers()
get all subscribers
getCountMembers()
Get number of members (not participants)
getObjId()
get current obj_id
assignSubscriber($a_usr_id)
Assign subscriber.
static getInstance($a_ref_id)
Get instance by ref_id.
getContacts()
get user ids which are confirgured as contact
hasPassed($a_usr_id)
Check if user has passed course.
static _hasPassed($a_obj_id, $a_usr_id)
Check if user has passed course.
deleteParticipants($a_user_ids)
Delete users.
isSubscriber($a_usr_id)
check if is subscriber
setRoleOrderPosition($a_user_id)
Set role order position.
static lookupNumberOfMembers($a_ref_id)
Lookup number of members @global ilRbacReview $rbacreview @global <type> $ilObjDataCache.
updateContact($a_usr_id, $a_contact)
Update contact setting @global type $ilDB.
static _deleteUser($a_usr_id)
Delete user data.
readSubscriberData($a_usr_id)
read subscribers
getCountAdmins()
Get number of admins.
checkLastAdmin($a_usr_ids)
Check if user for deletion are last admins.
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.
readSubscribers()
read subscribers
getTutors()
Get all tutors ids.
getAutoGeneratedRoleId($a_role_type)
Get role id of auto generated role type.
addSubscriber($a_usr_id)
Add subscriber.
updateBlocked($a_usr_id, $a_blocked)
Update blocked status.
isContact($a_usr_id)
Check if user is contact.
isBlocked($a_usr_id)
Check if user is blocked.
Session participation handling.
static _getInstanceByObjId($a_obj_id)
Get instance.
static getInstance($a_ref_id)
Get instance.
static _deleteUser($a_usr_id)
Delete user.
static deleteUserEntry($a_usr_id, $a_obj_id)
Delete one user entry.
if(!array_key_exists('StateId', $_REQUEST)) $id
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
foreach($_POST as $key=> $value) $res