From: Gordon Bateson Date: Mon, 9 Nov 2009 01:29:57 +0000 (+0000) Subject: ensure user has_capability('mod/hotpot:attempt', $module) when viewing a HotPot or... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bf38af3f55885b5892f684c486bb0e8174ef61ef;p=moodle.git ensure user has_capability('mod/hotpot:attempt', $module) when viewing a HotPot or submitting results --- diff --git a/mod/hotpot/attempt.php b/mod/hotpot/attempt.php index 2dbfdacc3e..fdbd7d05f4 100644 --- a/mod/hotpot/attempt.php +++ b/mod/hotpot/attempt.php @@ -26,6 +26,8 @@ // make sure this user is enrolled in this course require_login($course, true, $cm); + $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(); diff --git a/mod/hotpot/view.php b/mod/hotpot/view.php index 2e935a28ac..c48b611591 100644 --- a/mod/hotpot/view.php +++ b/mod/hotpot/view.php @@ -39,6 +39,7 @@ } require_login($course, true, $cm); $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";