24 include_once(
"classes/class.ilObjectAccess.php");
25 include_once
'./Modules/Course/classes/class.ilCourseConstants.php';
26 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
50 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
52 global $ilUser,
$lng, $rbacsystem, $ilAccess, $ilias;
56 $a_user_id = $ilUser->getId();
64 if($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id))
74 if($a_permission ==
'leave')
76 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
77 if(!$participants->isAssigned($a_user_id) or $participants->isLastAdmin($a_user_id))
83 if($a_permission ==
'join')
85 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
95 switch ($a_permission)
100 $tutor = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
106 if(!$tutor and !$active)
113 $tutor = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
126 if($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id))
135 if(!self::_registrationEnabled($a_obj_id))
140 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
146 if($participants->isAssigned($a_user_id))
172 $commands[] = array(
"permission" =>
"read",
"cmd" =>
"",
"lang_var" =>
"view",
"default" =>
true);
173 $commands[] = array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
176 $commands[] = array(
'permission' =>
"join",
"cmd" =>
"leave",
"lang_var" =>
"leave_waiting_list");
179 $commands[] = array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"crs_unsubscribe");
182 require_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
185 $commands[] = array(
"permission" =>
"read",
"cmd" =>
"mount_webfolder",
"lang_var" =>
"mount_webfolder",
"enable_anonymous" =>
"false");
188 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"edit");
199 $t_arr = explode(
"_", $a_target);
201 if ($t_arr[0] !=
"crs" || ((
int) $t_arr[1]) <= 0)
210 if ($ilAccess->checkAccess(
"visible",
"", $t_arr[1]))
227 $query =
"SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,
'integer').
" ";
231 return $row->view_mode;
246 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
252 $query =
"SELECT * FROM crs_settings ".
253 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
260 $end =
$row->activation_end;
292 $query =
"SELECT * FROM crs_settings ".
293 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
299 $reg_start =
$row->sub_start;
300 $reg_end =
$row->sub_end;
312 if(time() > $reg_start and