ipblocklist.cgi: Fix settings checkbox handling

Checkboxes does not submit any values if they are not checked.
Default them to "off" in such a case.

This fixes the issue not beeing able to disable the logging.

Fixes #12979.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
This commit is contained in:
Stefan Schantl
2023-03-07 13:17:35 +01:00
committed by Peter Müller
parent 1b70ead36d
commit 0450dce6f6

View File

@@ -72,6 +72,10 @@ my @blocklists = &IPblocklist::get_blocklists();
# Process actions
if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") {
# Assign checkbox values, in case they are not checked.
$cgiparams{'ENABLE'} = "off" unless($cgiparams{'ENABLE'});
$cgiparams{'LOGGING'} = "off" unless($cgiparams{'LOGGING'});
# Array to store if blocklists are missing on the system
# and needs to be downloaded first.
my @missing_blocklists = ();