From: Alexander Marx <alexander.marx@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH] BUG11137: Captive save action messes up the form
Date: Wed, 29 Jun 2016 12:47:55 +0200 [thread overview]
Message-ID: <1467197275-6949-1-git-send-email-alexander.marx@ipfire.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 2235 bytes --]
When configuring the captiveportal for the first time the form
will be empty after clicking on save button if not all relevant fields are set.
Now the settings are stored even if there is an error.
Signed-off-by: Alexander Marx <alexander.marx(a)ipfire.org>
---
html/cgi-bin/captive.cgi | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/html/cgi-bin/captive.cgi b/html/cgi-bin/captive.cgi
index ab5e932..803c03d 100755
--- a/html/cgi-bin/captive.cgi
+++ b/html/cgi-bin/captive.cgi
@@ -72,6 +72,18 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){
$errormessage=$Lang::tr{'Captive wrong ext'};
}
}
+
+ $settings{'ENABLE_GREEN'} = $cgiparams{'ENABLE_GREEN'};
+ $settings{'ENABLE_BLUE'} = $cgiparams{'ENABLE_BLUE'};
+ $settings{'AUTH'} = $cgiparams{'AUTH'};
+ $settings{'EXPIRE'} = $cgiparams{'EXP_HOUR'}+$cgiparams{'EXP_DAY'}+$cgiparams{'EXP_WEEK'}+$cgiparams{'EXP_MONTH'};
+ $settings{'EXP_HOUR'} = $cgiparams{'EXP_HOUR'};
+ $settings{'EXP_DAY'} = $cgiparams{'EXP_DAY'};
+ $settings{'EXP_WEEK'} = $cgiparams{'EXP_WEEK'};
+ $settings{'EXP_MONTH'} = $cgiparams{'EXP_MONTH'};
+ $settings{'TITLE'} = $cgiparams{'TITLE'};
+ $settings{'UNLIMITED'} = $cgiparams{'UNLIMITED'};
+
if (!$errormessage){
#Check if we need to upload a new logo
if($file){
@@ -103,17 +115,7 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){
$cgiparams{'EXP_WEEK'} = '0';
$cgiparams{'EXP_MONTH'} = '0';
}
-
- $settings{'ENABLE_GREEN'} = $cgiparams{'ENABLE_GREEN'};
- $settings{'ENABLE_BLUE'} = $cgiparams{'ENABLE_BLUE'};
- $settings{'AUTH'} = $cgiparams{'AUTH'};
- $settings{'EXPIRE'} = $cgiparams{'EXP_HOUR'}+$cgiparams{'EXP_DAY'}+$cgiparams{'EXP_WEEK'}+$cgiparams{'EXP_MONTH'};
- $settings{'EXP_HOUR'} = $cgiparams{'EXP_HOUR'};
- $settings{'EXP_DAY'} = $cgiparams{'EXP_DAY'};
- $settings{'EXP_WEEK'} = $cgiparams{'EXP_WEEK'};
- $settings{'EXP_MONTH'} = $cgiparams{'EXP_MONTH'};
- $settings{'TITLE'} = $cgiparams{'TITLE'};
- $settings{'UNLIMITED'} = $cgiparams{'UNLIMITED'};
+
&General::writehash("$settingsfile", \%settings);
#write Licensetext if defined
--
2.7.4
reply other threads:[~2016-06-29 10:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1467197275-6949-1-git-send-email-alexander.marx@ipfire.org \
--to=alexander.marx@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