5 include_once(
"classes/class.ilObjectAccess.php");
33 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
35 global $ilUser,
$lng, $rbacsystem, $ilAccess;
39 $a_user_id = $ilUser->getId();
42 switch ($a_permission)
46 (!$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id)))
56 && !$rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id)) ||
85 array(
"permission" =>
"read",
"cmd" =>
"view",
"lang_var" =>
"show",
87 array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"edit"),
104 if (isset(self::$online[$a_id]))
106 return self::$online[$a_id];
108 $q =
"SELECT is_online FROM file_based_lm WHERE id = ".$ilDB->quote($a_id,
"integer");
109 $set = $ilDB->query($q);
110 $rec = $ilDB->fetchAssoc($set);
114 return self::$online[$a_id];
124 if (isset(self::$startfile[$a_id]))
126 $start_file = self::$startfile[$a_id];
130 $q =
"SELECT startfile FROM file_based_lm WHERE id = ".$ilDB->quote($a_id,
"integer");
131 $set = $ilDB->query($q);
132 $rec = $ilDB->fetchAssoc($set);
133 $start_file = $rec[
"startfile"];
134 self::$startfile[$a_id] = $start_file.
"";
139 if (($start_file !=
"") &&
140 (@is_file(
$dir.
"/".$start_file)))
142 return "./".$dir.
"/".$start_file;
144 else if (@is_file(
$dir.
"/index.html"))
146 return "./".$dir.
"/index.html";
148 else if (@is_file(
$dir.
"/index.htm"))
150 return "./".$dir.
"/index.htm";
163 $t_arr = explode(
"_", $a_target);
165 if ($t_arr[0] !=
"htlm" || ((
int) $t_arr[1]) <= 0)
170 if ($ilAccess->checkAccess(
"visible",
"", $t_arr[1]))
185 $lm_dir = $lm_data_dir.DIRECTORY_SEPARATOR.
"lm_".$a_id;
210 global
$ilDB, $ilUser;
212 $q =
"SELECT id, is_online, startfile FROM file_based_lm WHERE ".
213 $ilDB->in(
"id", $a_obj_ids,
false,
"integer");
215 $lm_set = $ilDB->query($q);
216 while ($rec = $ilDB->fetchAssoc($lm_set))
218 self::$online[$rec[
"id"]] =
ilUtil::yn2tf($rec[
"is_online"]);
219 self::$startfile[$rec[
"id"]] = $rec[
"startfile"].
"";