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))
170 $commands[] = array(
"permission" =>
"read",
"cmd" =>
"",
"lang_var" =>
"view",
"default" =>
true);
171 $commands[] = array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
174 $commands[] = array(
'permission' =>
"join",
"cmd" =>
"leave",
"lang_var" =>
"leave_waiting_list");
177 $commands[] = array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"crs_unsubscribe");
179 include_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
182 include_once
'./Services/WebDAV/classes/class.ilDAVUtils.php';
185 $commands[] = array(
'permission' =>
'read',
'cmd' =>
'showPasswordInstruction',
'lang_var' =>
'mount_webfolder',
'enable_anonymous' =>
'false');
189 $commands[] = array(
"permission" =>
"read",
"cmd" =>
"mount_webfolder",
"lang_var" =>
"mount_webfolder",
"enable_anonymous" =>
"false");
193 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"edit");
202 global $ilAccess,$ilUser;
204 $t_arr = explode(
"_", $a_target);
207 if(substr($t_arr[2],0,5) ==
'rcode' and $ilUser->getId() != ANONYMOUS_USER_ID)
213 if ($t_arr[0] !=
"crs" || ((
int) $t_arr[1]) <= 0)
222 if ($ilAccess->checkAccess(
"visible",
"", $t_arr[1]))
239 $query =
"SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,
'integer').
" ";
243 return $row->view_mode;
258 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
264 $query =
"SELECT * FROM crs_settings ".
265 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
271 $type =
$row->activation_type;
272 $start =
$row->activation_start;
273 $end =
$row->activation_end;
284 if(time() < $start or
305 $query =
"SELECT * FROM crs_settings ".
306 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
311 $type =
$row->sub_limitation_type;
312 $reg_start =
$row->sub_start;
313 $reg_end =
$row->sub_end;
325 if(time() > $reg_start and