]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20798 fixed missing access control for module intros
authorPetr Skoda <skodak@moodle.org>
Tue, 10 Nov 2009 14:04:50 +0000 (14:04 +0000)
committerPetr Skoda <skodak@moodle.org>
Tue, 10 Nov 2009 14:04:50 +0000 (14:04 +0000)
pluginfile.php

index f1e9f771b4821467194d998dfe03949598d51e47..17332e1036b61ae296a5f1d12a71240c620ecc2d 100644 (file)
@@ -461,6 +461,11 @@ if ($context->contextlevel == CONTEXT_SYSTEM) {
         if (!plugin_supports('mod', $modname, FEATURE_MOD_INTRO, true)) {
             send_file_not_found();
         }
+        if (!$cm = get_coursemodule_from_instance($modname, $cminfo->instance, $course->id)) {
+            send_file_not_found();
+        }
+        require_course_login($course, true, $cm);
+
         if (!$cminfo->uservisible) {
             send_file_not_found();
         }