Browse files

coursereqest MDL-25589 set context

  • Loading branch information...
1 parent b5a4964 commit f8f384b5b4a095ae74c378a7aa9994f76141cd6e @danpoltawski danpoltawski committed Dec 30, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 course/request.php
View
7 course/request.php
@@ -32,6 +32,7 @@
/// Where we came from. Used in a number of redirects.
$returnurl = $CFG->wwwroot . '/course/index.php';
+
/// Check permissions.
require_login();
if (isguestuser()) {
@@ -40,7 +41,9 @@
if (empty($CFG->enablecourserequests)) {
print_error('courserequestdisabled', '', $returnurl);
}
-require_capability('moodle/course:request', get_context_instance(CONTEXT_SYSTEM));
+$context = get_context_instance(CONTEXT_SYSTEM);
+$PAGE->set_context($context);
+require_capability('moodle/course:request', $context);
/// Set up the form.
$data = course_request::prepare();
@@ -67,4 +70,4 @@
echo $OUTPUT->heading($strtitle);
// Show the request form.
$requestform->display();
-echo $OUTPUT->footer();
+echo $OUTPUT->footer();

0 comments on commit f8f384b

Please sign in to comment.