5 include_once(
"./Services/Object/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';
9 include_once
'./Services/AccessControl/interfaces/interface.ilConditionHandling.php';
29 include_once
'./Services/AccessControl/classes/class.ilConditionHandler.php';
44 public static function checkCondition($a_obj_id,$a_operator,$a_value,$a_usr_id)
46 include_once
"./Modules/Course/classes/class.ilCourseParticipants.php";
47 include_once
'./Services/AccessControl/classes/class.ilConditionHandler.php';
69 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
71 global
$ilUser,
$lng, $rbacsystem, $ilAccess, $ilias;
76 $a_user_id = $ilUser->getId();
79 if($ilUser->getId() == $a_user_id)
92 if($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id))
102 if($a_permission ==
'leave')
104 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
105 if(!$participants->isAssigned($a_user_id))
111 if($a_permission ==
'join')
113 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
124 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
132 switch ($a_permission)
137 $tutor = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
142 if(!$tutor and !$active && !$visible)
149 $tutor = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
160 if($participants->isBlocked($a_user_id) and $participants->isAssigned($a_user_id))
168 if(!self::_registrationEnabled($a_obj_id))
173 if($participants->isAssigned($a_user_id))
197 $commands[] = array(
"permission" =>
"crs_linked",
"cmd" =>
"",
"lang_var" =>
"view",
"default" =>
true);
199 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
203 'permission' =>
'read',
204 'cmd' =>
'fileManagerLaunch',
205 'lang_var' =>
'fm_start',
206 'enable_anonymous' =>
false
210 $commands[] = array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
213 $commands[] = array(
'permission' =>
"join",
"cmd" =>
"leave",
"lang_var" =>
"leave_waiting_list");
216 $commands[] = array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"crs_unsubscribe");
218 include_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
221 include_once
'./Services/WebDAV/classes/class.ilDAVUtils.php';
224 $commands[] = array(
'permission' =>
'read',
'cmd' =>
'showPasswordInstruction',
'lang_var' =>
'mount_webfolder',
'enable_anonymous' =>
'false');
228 $commands[] = array(
"permission" =>
"read",
"cmd" =>
"mount_webfolder",
"lang_var" =>
"mount_webfolder",
"enable_anonymous" =>
"false");
232 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"enableAdministrationPanel",
"lang_var" =>
"edit_content");
233 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings");
244 $t_arr = explode(
"_", $a_target);
247 if(substr($t_arr[2],0,5) ==
'rcode' and $ilUser->getId() != ANONYMOUS_USER_ID)
249 self::$using_code =
true;
254 if ($t_arr[0] !=
"crs" || ((
int) $t_arr[1]) <= 0)
261 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
262 $ilAccess->checkAccess(
"visible",
"", $t_arr[1]))
280 $query =
"SELECT view_mode FROM crs_settings WHERE obj_id = ".$ilDB->quote($a_id ,
'integer').
" ";
284 return $row->view_mode;
299 $query =
"SELECT * FROM crs_settings ".
300 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
303 return (
bool)
$row->activation_type;
315 public static function _isActivated($a_obj_id, &$a_visible_flag = null, $a_mind_member_view =
true)
318 if($a_mind_member_view)
320 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
323 $a_visible_flag =
true;
329 if(!self::_isOnline($a_obj_id))
331 $a_visible_flag =
false;
338 $a_visible_flag =
true;
340 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
342 switch($item[
'timing_type'])
345 if(time() < $item[
'timing_start'] or
346 time() > $item[
'timing_end'])
348 $a_visible_flag = $item[
'visible'];
367 $query =
"SELECT * FROM crs_settings ".
368 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
373 $type =
$row->sub_limitation_type;
374 $reg_start =
$row->sub_start;
375 $reg_end =
$row->sub_end;
387 if(time() > $reg_start and
410 $query =
'SELECT sub_limitation_type, sub_start, sub_end, sub_mem_limit, sub_max_members FROM crs_settings '.
411 'WHERE obj_id = '.$ilDB->quote($a_obj_id);
419 $info[
'reg_info_type'] =
$row->sub_limitation_type;
420 $info[
'reg_info_max_members'] =
$row->sub_max_members;
421 $info[
'reg_info_mem_limit'] =
$row->sub_mem_limit;
424 $registration_possible =
true;
432 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_start');
437 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_end');
442 $registration_possible =
false;
443 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_period');
444 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'crs_list_reg_noreg');
449 $registration_possible =
true;
453 $registration_possible =
false;
454 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'crs_list_reg_period');
455 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'crs_list_reg_noreg');
458 if($info[
'reg_info_mem_limit'] && $registration_possible)
466 if($part->getNumberOfMembers() <= $info[
'reg_info_max_members'])
468 $info[
'reg_info_list_prop_limit'][
'property'] = $lng->txt(
'crs_list_reg_limit_places');
469 $info[
'reg_info_list_prop_limit'][
'value'] = max(
471 $info[
'reg_info_max_members'] - $part->getNumberOfMembers()
476 $info[
'reg_info_list_prop_limit'][
'property'] =
'';
477 $info[
'reg_info_list_prop_limit'][
'value'] = $lng->txt(
'crs_list_reg_limit_full');
507 include_once(
"./Modules/Course/classes/class.ilCourseWaitingList.php");
510 include_once
"./Modules/Course/classes/class.ilCourseCertificateAdapter.php";