Permalink
Browse files

ensure user has_capability('mod/hotpot:attempt', $module) when viewin…

…g a HotPot or submitting results
  • Loading branch information...
gbateson committed Nov 9, 2009
1 parent 68bddc6 commit e8c35867b7a431c9bb7bc0886d6821ddebc51286
Showing with 3 additions and 0 deletions.
  1. +2 −0 mod/hotpot/attempt.php
  2. +1 −0 mod/hotpot/view.php
View
@@ -23,6 +23,8 @@
// make sure this user is enrolled in this course
require_login($course->id);
+ $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();
View
@@ -36,6 +36,7 @@
}
require_login($course->id);
$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";

0 comments on commit e8c3586

Please sign in to comment.