From 8d339008c1252d29691e18cdd10a5638f53c2cf9 Mon Sep 17 00:00:00 2001 From: Kumi Date: Wed, 20 Nov 2024 17:46:27 +0100 Subject: [PATCH] feat: Enhances usergrades report page configuration Replaces hardcoded URL with moodle_url for flexibility and security. Adds capability requirement 'report/usergrades:view' for improved access control. --- settings.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/settings.php b/settings.php index de7d98b..534c6aa 100644 --- a/settings.php +++ b/settings.php @@ -2,5 +2,10 @@ defined('MOODLE_INTERNAL') || die(); if ($hassiteconfig) { // Needs this condition or there is error on login page - $ADMIN->add('reports', new admin_externalpage('report_usergrades', get_string('pluginname', 'report_usergrades'), "$CFG->wwwroot/report/usergrades/index.php")); + $ADMIN->add('reports', new admin_externalpage( + 'report_usergrades', + get_string('pluginname', 'report_usergrades'), + new moodle_url('/report/usergrades/index.php'), + 'report/usergrades:view' + )); }