MDL-73598 reportbuilder: feature switch for custom reports.

This commit is contained in:
Paul Holden 2022-01-18 18:04:37 +00:00
parent a01f1fa71c
commit 335012580b
6 changed files with 105 additions and 8 deletions

View file

@ -38,13 +38,18 @@ class send_schedule extends adhoc_task {
* Execute the task
*/
public function execute(): void {
global $USER, $DB;
global $CFG, $USER, $DB;
[
'reportid' => $reportid,
'scheduleid' => $scheduleid,
] = (array) $this->get_custom_data();
// Custom reports are disabled.
if (empty($CFG->enablecustomreports)) {
return;
}
$schedule = schedule::get_record(['id' => $scheduleid, 'reportid' => $reportid]);
if ($schedule === false) {
$this->log('Invalid schedule', 0);