From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adolf Belka To: development@lists.ipfire.org Subject: Re: [PATCH 2/2] ipblocklist.cgi: Fix settings checkbox handling Date: Tue, 07 Mar 2023 20:01:58 +0100 Message-ID: In-Reply-To: <20230307121735.6485-2-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2565903077367645520==" List-Id: --===============2565903077367645520== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Reviewed-by: Adolf Belka On 07/03/2023 13:17, Stefan Schantl wrote: > 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 > --- > html/cgi-bin/ipblocklist.cgi | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/html/cgi-bin/ipblocklist.cgi b/html/cgi-bin/ipblocklist.cgi > index bb438129c..b79eb155f 100644 > --- a/html/cgi-bin/ipblocklist.cgi > +++ b/html/cgi-bin/ipblocklist.cgi > @@ -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 = (); -- Sent from my laptop --===============2565903077367645520==--