require_variable($id); // Course Module ID
require_variable($url); // url to fetch
+ if (!empty($CFG->forcelogin)) {
+ require_login();
+ }
+
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
}
error("Course is misconfigured");
}
+ if ($course->category) {
+ require_login($course->id);
+ }
+
if (! $resource = get_record("resource", "id", $cm->instance)) {
error("Resource ID was incorrect");
}
require_variable($id); // course
+ if (!empty($CFG->forcelogin)) {
+ require_login();
+ }
+
if (! $course = get_record("course", "id", $id)) {
error("Course ID is incorrect");
}
require_variable($id); // Course Module ID
optional_variable($frameset, "");
+ if (!empty($CFG->forcelogin)) {
+ require_login();
+ }
+
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
}