]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed Bug #4985 - Guest rights to the database module.
authorvyshane <vyshane>
Mon, 27 Mar 2006 04:13:32 +0000 (04:13 +0000)
committervyshane <vyshane>
Mon, 27 Mar 2006 04:13:32 +0000 (04:13 +0000)
mod/data/add.php
mod/data/view.php

index 6ebe2671a45bba09d70bafcc6ac8a0c7c2329096..cd3d99b3cdae28a7aba3fb826f1dee9efbdf666a 100755 (executable)
@@ -25,8 +25,6 @@
     require_once('../../config.php');
     require_once('lib.php');
 
-    require_login();
-
     $id    = optional_param('id', 0, PARAM_INT);    // course module id
     $d     = optional_param('d', 0, PARAM_INT);    // database id
     $rid   = optional_param('rid', 0, PARAM_INT);    //record id
@@ -57,6 +55,8 @@
         }
     }
     
+    require_course_login($course, false, $cm);
+    
     if (isteacher($course->id)) {
         if (!record_exists('data_fields','dataid',$data->id)) {      // Brand new database!
             redirect($CFG->wwwroot.'/mod/data/field.php?d='.$data->id);  // Redirect to field entry
index deb69ddd1caa7dc022eb256a7aab0190e3c8288a..0e256be237819efd5c794432e8050f5066b8e490 100755 (executable)
@@ -28,7 +28,7 @@
     require_once("$CFG->libdir/rsslib.php");
 
     require_once('pagelib.php');
-    require_login();
+    
 
     $id    = optional_param('id', 0, PARAM_INT);  // course module id
     $d     = optional_param('d', 0, PARAM_INT);   // database id
@@ -66,6 +66,8 @@
         }
     }
 
+    require_course_login($course, true, $cm);
+
     if (isteacher($course->id)) {
         if (!record_exists('data_fields','dataid',$data->id)) {      // Brand new database!
             redirect($CFG->wwwroot.'/mod/data/field.php?d='.$data->id);  // Redirect to field entry