Fixed access control

This commit is contained in:
Mark Nelson 2015-03-11 15:57:45 -07:00
parent ba12c4d42b
commit 0483cda501
3 changed files with 3 additions and 3 deletions

View file

@ -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');

View file

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

View file

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