From 7ddda9dbcf704868fa540cc28d95ea30ddfa8cf6 Mon Sep 17 00:00:00 2001 From: vyshane Date: Mon, 27 Mar 2006 04:13:32 +0000 Subject: [PATCH] Fixed Bug #4985 - Guest rights to the database module. --- mod/data/add.php | 4 ++-- mod/data/view.php | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mod/data/add.php b/mod/data/add.php index 6ebe2671a45..cd3d99b3cda 100755 --- a/mod/data/add.php +++ b/mod/data/add.php @@ -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 diff --git a/mod/data/view.php b/mod/data/view.php index deb69ddd1ca..0e256be2378 100755 --- a/mod/data/view.php +++ b/mod/data/view.php @@ -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