mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-10890 all require_login() in modules reviewed and fixed use of $cm
This commit is contained in:
parent
a104debf4f
commit
bb5b72244a
20 changed files with 26 additions and 21 deletions
|
@ -22,7 +22,7 @@
|
|||
}
|
||||
|
||||
// make sure this user is enrolled in this course
|
||||
require_login($course->id);
|
||||
require_login($course, true, $cm);
|
||||
|
||||
$next_url = "$CFG->wwwroot/course/view.php?id=$course->id";
|
||||
$time = time();
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
// set homeurl of couse (for error messages)
|
||||
$course_homeurl = "$CFG->wwwroot/course/view.php?id=$course->id";
|
||||
|
||||
require_login($course->id);
|
||||
require_login($course, true, $cm);
|
||||
|
||||
// get report mode
|
||||
if (has_capability('mod/hotpot:viewreport',$modulecontext)) {
|
||||
|
|
|
@ -31,9 +31,10 @@
|
|||
if (! $attempt = get_record("hotpot_attempts", "id", $attempt)) {
|
||||
error("Attempt ID was incorrect");
|
||||
}
|
||||
|
||||
require_login($course, true, $cm);
|
||||
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
require_login($course->id);
|
||||
if (!has_capability('mod/hotpot:viewreport',$context)) {
|
||||
if (!$hotpot->review) {
|
||||
error(get_string("noreview", "quiz"));
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
}
|
||||
|
||||
}
|
||||
require_login($course->id);
|
||||
require_login($course, true, $cm);
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
}
|
||||
// set nextpage (for error messages)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue