24 require_once
"./include/inc.header.php";
25 require_once
"./Services/Utilities/classes/class.ilUtil.php";
26 require_once
"./classes/class.ilObject.php";
27 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
112 $this->checked_list = &
$_SESSION[
"WebAccessChecked"];
113 $this->params = array();
116 $uri = parse_url($_SERVER[
"REQUEST_URI"]);
117 parse_str($uri[
"query"], $this->params);
120 $this->subpath = urldecode(substr($uri[
"path"], strpos($uri[
"path"], $pattern)));
143 if (file_exists($this->file))
149 $this->errorcode = 404;
150 $this->errortext = $this->lng->txt(
"url_not_found");
164 $pos1 = strpos($this->subpath,
"lm_data/lm_") + 11;
165 $pos2 = strpos($this->subpath,
"/", $pos1);
167 if ($pos1 == 11 or $pos2 ===
false)
170 $pos1 = strpos($this->subpath,
"mobs/mm_") + 8;
171 $pos2 = strpos($this->subpath,
"/", $pos1);
172 if ($pos1 ===
false or $pos2 ===
false)
174 $this->errorcode = 404;
175 $this->errortext = $this->lng->txt(
"url_not_found");
180 $mob_id = substr($this->subpath, $pos1, $pos2-$pos1);
181 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
183 foreach($usages as $usage)
193 if ($usage[
"type"] ==
"news")
195 include_once(
"./Modules/MediaCast/classes/class.ilObjMediaCastAccess.php");
196 include_once(
"./Services/News/classes/class.ilNewsItem.php");
208 $obj_ids[] = substr($this->subpath, $pos1, $pos2-$pos1);
209 foreach($obj_ids as $obj_id)
211 if (!is_numeric($obj_id))
213 $this->errorcode = 404;
214 $this->errortext = $this->lng->txt(
"obj_not_found");
219 if (is_array($this->checked_list))
221 if (in_array($obj_id, $this->checked_list))
232 $this->errorcode = 403;
233 $this->errortext = $this->lng->txt(
"permission_denied");
242 if ($this->ilAccess->checkAccess(
"read",
"view", $ref_id, $obj_type, $obj_id))
251 $this->checked_list[] = $obj_id;
256 $this->errorcode = 403;
257 $this->errortext = $this->lng->txt(
"permission_denied");
269 $this->disposition = $a_disposition;
296 if (!isset($_SERVER[
"HTTPS"]))
298 header(
"Cache-Control: no-cache, must-revalidate");
299 header(
"Pragma: no-cache");
302 header(
"Content-Type: " . $this->mimetype);
303 header(
"Content-Length: ".(
string)(filesize($this->file)));
305 if (isset($_SERVER[
"HTTPS"]))
307 header(
'Cache-Control: must-revalidate, post-check=0, pre-check=0');
308 header(
'Pragma: public');
311 header(
"Connection: close");
324 switch ($this->errorcode)
327 header(
"HTTP/1.0: 403 Forbidden");
330 header(
"HTTP/1.0: 404 Not Found");
333 exit($this->errortext);