[pmg-devel] applied: [PATCH pmg-api] use 'dailyreport' config

Dietmar Maurer dietmar at proxmox.com
Mon Sep 10 09:23:53 CEST 2018


applied, but only trigger with 'auto' parameter ...
 
> On September 6, 2018 at 3:33 PM Dominik Csapak <d.csapak at proxmox.com> wrote:
> 
> 
> 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 <d.csapak at proxmox.com>
> ---
>  PMG/CLI/pmgreport.pm | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/PMG/CLI/pmgreport.pm b/PMG/CLI/pmgreport.pm
> index ce63aa7..6ae6ca7 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 (!$enable) {
> +	    # simply do nothing when disabled
> +	    return undef;
> +	}
> +
>  	my $mailfrom = "Proxmox Mail Gateway <postmaster>";
>  	PMG::Utils::finalize_report($tt, 'pmgreport.tt', $vars, $mailfrom, $email, $param->{debug});
>  
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> pmg-devel mailing list
> pmg-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel



More information about the pmg-devel mailing list