Fixed Bug #4985 - Guest rights to the database module.

This commit is contained in:
vyshane 2006-03-27 04:13:32 +00:00
parent 34f4ff351d
commit 7ddda9dbcf
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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