]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
ipblocklist.cgi: Fix settings checkbox handling
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 7 Mar 2023 12:17:35 +0000 (13:17 +0100)
committerPeter Müller <peter.mueller@ipfire.org>
Sat, 11 Mar 2023 16:27:32 +0000 (16:27 +0000)
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>
html/cgi-bin/ipblocklist.cgi

index bb438129c94ce9013ffc2008c694fc41abbda5ed..b79eb155fe8f63d5da863e0dec46dc7c8d1f497d 100644 (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 = ();