]> git.mjollnir.org Git - moodle.git/commitdiff
Added some checks for forcelogin on resources
authormoodler <moodler>
Tue, 11 May 2004 13:16:20 +0000 (13:16 +0000)
committermoodler <moodler>
Tue, 11 May 2004 13:16:20 +0000 (13:16 +0000)
mod/resource/fetch.php
mod/resource/index.php
mod/resource/view.php

index 0dfd3e4f787cfd01ccf3853e1ab20001d68a0634..cbd9ebd0244503eeadd6961dc7e8fac6633fcb1a 100644 (file)
@@ -7,6 +7,10 @@
     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");
     }
index 416165a06d43b0b23d9f2798c687f7794d67ab6a..3a6146801a44a7aa9fb50d78d2f5825f313f90d5 100644 (file)
@@ -4,6 +4,10 @@
 
     require_variable($id);   // course
 
+    if (!empty($CFG->forcelogin)) {
+        require_login();
+    }
+
     if (! $course = get_record("course", "id", $id)) {
         error("Course ID is incorrect");
     }
index c7a83970c1bf06ebe16fe2d96af055e19770c6c4..3b3ac886569d1e3a30f81a20515063eab2892371 100644 (file)
@@ -6,6 +6,10 @@
     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");
     }