mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
fixed context parameter in has_capability() call
This commit is contained in:
parent
3fda6eb2fe
commit
0e4da9e34f
1 changed files with 2 additions and 1 deletions
|
@ -38,6 +38,7 @@ if (!$course = get_record('course', 'id', $courseid)) {
|
||||||
require_login($course->id);
|
require_login($course->id);
|
||||||
|
|
||||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||||
|
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||||
require_capability('gradereport/grader:view', $context);
|
require_capability('gradereport/grader:view', $context);
|
||||||
|
|
||||||
// If data submitted, then process and store.
|
// If data submitted, then process and store.
|
||||||
|
@ -79,7 +80,7 @@ $currenttab = 'preferences';
|
||||||
include('tabs.php');
|
include('tabs.php');
|
||||||
|
|
||||||
// If USER has admin capability, print a link to the site config page for this report
|
// If USER has admin capability, print a link to the site config page for this report
|
||||||
if (has_capability('moodle/site:config')) {
|
if (has_capability('moodle/site:config', $systemcontext)) {
|
||||||
echo '<div id="siteconfiglink"><a href="' . $CFG->wwwroot . '/admin/settings.php?section=gradereportgrader">';
|
echo '<div id="siteconfiglink"><a href="' . $CFG->wwwroot . '/admin/settings.php?section=gradereportgrader">';
|
||||||
echo get_string('changesitedefaults', 'grades');
|
echo get_string('changesitedefaults', 'grades');
|
||||||
echo "</a></div>\n";
|
echo "</a></div>\n";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue