mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
coursereqest MDL-25589 set context
This commit is contained in:
parent
b5a49647e2
commit
f8f384b5b4
1 changed files with 5 additions and 2 deletions
|
@ -32,6 +32,7 @@ $PAGE->set_url('/course/request.php');
|
||||||
/// Where we came from. Used in a number of redirects.
|
/// Where we came from. Used in a number of redirects.
|
||||||
$returnurl = $CFG->wwwroot . '/course/index.php';
|
$returnurl = $CFG->wwwroot . '/course/index.php';
|
||||||
|
|
||||||
|
|
||||||
/// Check permissions.
|
/// Check permissions.
|
||||||
require_login();
|
require_login();
|
||||||
if (isguestuser()) {
|
if (isguestuser()) {
|
||||||
|
@ -40,7 +41,9 @@ if (isguestuser()) {
|
||||||
if (empty($CFG->enablecourserequests)) {
|
if (empty($CFG->enablecourserequests)) {
|
||||||
print_error('courserequestdisabled', '', $returnurl);
|
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.
|
/// Set up the form.
|
||||||
$data = course_request::prepare();
|
$data = course_request::prepare();
|
||||||
|
@ -67,4 +70,4 @@ echo $OUTPUT->header();
|
||||||
echo $OUTPUT->heading($strtitle);
|
echo $OUTPUT->heading($strtitle);
|
||||||
// Show the request form.
|
// Show the request form.
|
||||||
$requestform->display();
|
$requestform->display();
|
||||||
echo $OUTPUT->footer();
|
echo $OUTPUT->footer();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue