Fixed access control
This commit is contained in:
parent
ba12c4d42b
commit
0483cda501
3 changed files with 3 additions and 3 deletions
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
2
view.php
2
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue