mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
ec81373f50
(While I was at it I also turned the autologinguests off for most module pages, except on the index.php pages and the view.php pages for those modules that allow guests)
30 lines
823 B
PHP
30 lines
823 B
PHP
<?php // $Id$
|
|
// Fetches an external URL and passes it through the filters
|
|
|
|
require_once("../../config.php");
|
|
require_once("lib.php");
|
|
|
|
require_variable($id); // Course Module ID
|
|
require_variable($url); // url to fetch
|
|
|
|
if (! $cm = get_record("course_modules", "id", $id)) {
|
|
error("Course Module ID was incorrect");
|
|
}
|
|
|
|
if (! $course = get_record("course", "id", $cm->course)) {
|
|
error("Course is misconfigured");
|
|
}
|
|
|
|
require_course_login($course, true, $cm);
|
|
|
|
if (! $resource = get_record("resource", "id", $cm->instance)) {
|
|
error("Resource ID was incorrect");
|
|
}
|
|
|
|
$content = resource_fetch_remote_file($cm, $url);
|
|
|
|
$formatoptions->noclean = true;
|
|
echo format_text($content->results, FORMAT_HTML, $formatoptions, $course->id);
|
|
|
|
?>
|