From ca49877774663c4e258442175efe10b66762814f Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 6 Sep 2018 15:33:12 +0200 Subject: [PATCH] use 'dailyreport' config the user could enable/disable the dailyreport via the config/webui but the report did not honor/check this setting so check it, and do not send a report if this is off Signed-off-by: Dominik Csapak --- PMG/CLI/pmgreport.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PMG/CLI/pmgreport.pm b/PMG/CLI/pmgreport.pm index ce63aa7..c863fb3 100644 --- a/PMG/CLI/pmgreport.pm +++ b/PMG/CLI/pmgreport.pm @@ -351,6 +351,13 @@ __PACKAGE__->register_method ({ die "no receiver configured\n"; } + my $enable = $cfg->get('admin', 'dailyreport') // 1; + + if ($param->{auto} && !$enable) { + # do nothing when disabled + return undef; + } + my $mailfrom = "Proxmox Mail Gateway "; PMG::Utils::finalize_report($tt, 'pmgreport.tt', $vars, $mailfrom, $email, $param->{debug}); -- 2.39.2