ensure user has_capability('mod/hotpot:attempt', $module) when viewing a HotPot or submitting results
This commit is contained in:
@@ -21,8 +21,10 @@
|
||||
error("Course Module ID is incorrect");
|
||||
}
|
||||
|
||||
// make sure this user is enrolled in this course
|
||||
// make sure this user is enrolled in this course and can access this HotPot
|
||||
require_login($course);
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
require_capability('mod/hotpot:attempt', $context);
|
||||
|
||||
$next_url = "$CFG->wwwroot/course/view.php?id=$course->id";
|
||||
$time = time();
|
||||
|
||||
@@ -34,8 +34,10 @@
|
||||
}
|
||||
|
||||
}
|
||||
// make sure this user is enrolled in this course and can access this HotPot
|
||||
require_login($course);
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
require_capability('mod/hotpot:attempt', $context);
|
||||
}
|
||||
// set nextpage (for error messages)
|
||||
$nextpage = "$CFG->wwwroot/course/view.php?id=$course->id";
|
||||
|
||||
Reference in New Issue
Block a user