5 include_once(
"classes/class.ilObjectAccess.php");
6 include_once
'./Modules/Course/classes/class.ilCourseConstants.php';
7 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
8 include_once
'Modules/Course/classes/class.ilCourseParticipant.php';
32 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
34 global $ilUser,
$lng, $rbacsystem, $ilAccess, $ilias;
39 $a_user_id = $ilUser->getId();
42 if($ilUser->getId() == $a_user_id)
55 if($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id))
65 if($a_permission ==
'leave')
67 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
68 if(!$participants->isAssigned($a_user_id))
74 if($a_permission ==
'join')
76 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
86 switch ($a_permission)
91 $tutor = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
97 if(!$tutor and !$active)
104 $tutor = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
117 if($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id))
126 if(!self::_registrationEnabled($a_obj_id))
131 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
137 if($participants->isAssigned($a_user_id))
161 $commands[] = array(
"permission" =>
"read",
"cmd" =>
"",
"lang_var" =>
"view",
"default" =>
true);
162 $commands[] = array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
165 $commands[] = array(
'permission' =>
"join",
"cmd" =>
"leave",
"lang_var" =>
"leave_waiting_list");
168 $commands[] = array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"crs_unsubscribe");
170 include_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
173 include_once
'./Services/WebDAV/classes/class.ilDAVUtils.php';
176 $commands[] = array(
'permission' =>
'read',
'cmd' =>
'showPasswordInstruction',
'lang_var' =>
'mount_webfolder',
'enable_anonymous' =>
'false');
180 $commands[] = array(
"permission" =>
"read",
"cmd" =>
"mount_webfolder",
"lang_var" =>
"mount_webfolder",
"enable_anonymous" =>
"false");
184 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"edit");
193 global $ilAccess,$ilUser;
195 $t_arr = explode(
"_", $a_target);
198 if(substr($t_arr[2],0,5) ==
'rcode' and $ilUser->getId() != ANONYMOUS_USER_ID)
204 if ($t_arr[0] !=
"crs" || ((
int) $t_arr[1]) <= 0)
213 if ($ilAccess->checkAccess(
"visible",
"", $t_arr[1]))
230 $query =
"SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,
'integer').
" ";
234 return $row->view_mode;
246 public static function _isActivated($a_obj_id, $a_mind_member_view =
true)
251 if($a_mind_member_view)
253 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
260 $query =
"SELECT * FROM crs_settings ".
261 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
267 $type =
$row->activation_type;
268 $start =
$row->activation_start;
269 $end =
$row->activation_end;
280 if(time() < $start or
301 $query =
"SELECT * FROM crs_settings ".
302 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
307 $type =
$row->sub_limitation_type;
308 $reg_start =
$row->sub_start;
309 $reg_end =
$row->sub_end;
321 if(time() > $reg_start and
352 global
$ilDB, $ilUser;
354 include_once(
"./Modules/Course/classes/class.ilCourseWaitingList.php");