From 0483cda5015f6dc7043bd5a440443a69fe723c85 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 11 Mar 2015 15:57:45 -0700 Subject: [PATCH] Fixed access control --- index.php | 2 +- report.php | 2 +- view.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 84f09eb..4b5d4dc 100644 --- a/index.php +++ b/index.php @@ -30,7 +30,7 @@ $id = required_param('id', PARAM_INT); // Course ID. $course = $DB->get_record('course', array('id' => $id), '*', MUST_EXIST); // Requires a login. -require_course_login($course); +require_login($course); // Set up the page variables. $PAGE->set_pagelayout('incourse'); diff --git a/report.php b/report.php index 5a4aa6d..84cf2f0 100644 --- a/report.php +++ b/report.php @@ -45,7 +45,7 @@ $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST) $customcert = $DB->get_record('customcert', array('id' => $cm->instance), '*', MUST_EXIST); // Requires a course login. -require_course_login($course->id, false, $cm); +require_login($course, false, $cm); // Check capabilities. $context = context_module::instance($cm->id); diff --git a/view.php b/view.php index 2d6f48f..08fb585 100644 --- a/view.php +++ b/view.php @@ -33,7 +33,7 @@ $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST) $customcert = $DB->get_record('customcert', array('id' => $cm->instance), '*', MUST_EXIST); // Ensure the user is allowed to view this page. -require_login($course, true, $cm); +require_login($course, false, $cm); $context = context_module::instance($cm->id); require_capability('mod/customcert:view', $context);