MDL-7821 wrong use of cm in data mod and added proper require_login()

This commit is contained in:
skodak
2006-12-06 20:17:58 +00:00
parent de312b53bb
commit c088d6039d
7 changed files with 18 additions and 27 deletions
+5 -3
View File
@@ -24,10 +24,12 @@
if (! $course = get_record('course', 'id', $data->course)) {
error('Course is misconfigured');
}
if (! $cm = get_coursemodule_from_instance('data', $data->id, $course->id)) {
error('Course Module ID was incorrect');
}
require_login($course->id);
require_login($course->id, false, $cm);
$cm = data_get_cm($data);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
if ($commentid) {
@@ -111,7 +113,7 @@
default: //print all listing, and add comment form
print_header();
data_print_comments($data, $record, $search, $template, $sort, $page, $rid, $order, $group);
data_print_comments($data, $record, $page);
print_footer();
break;