From: Stefan Schantl <stefan.schantl@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH 2/2] ipblocklist.cgi: Fix settings checkbox handling
Date: Tue, 07 Mar 2023 13:17:35 +0100 [thread overview]
Message-ID: <20230307121735.6485-2-stefan.schantl@ipfire.org> (raw)
In-Reply-To: <20230307121735.6485-1-stefan.schantl@ipfire.org>
[-- Attachment #1: Type: text/plain, Size: 958 bytes --]
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(a)ipfire.org>
---
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 = ();
--
2.30.2
next prev parent reply other threads:[~2023-03-07 12:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-07 12:17 [PATCH 1/2] firewall: Silence warnings if blocklist logging is not set Stefan Schantl
2023-03-07 12:17 ` Stefan Schantl [this message]
2023-03-07 19:01 ` [PATCH 2/2] ipblocklist.cgi: Fix settings checkbox handling Adolf Belka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230307121735.6485-2-stefan.schantl@ipfire.org \
--to=stefan.schantl@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox