summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2017-05-22 14:16:25 -0400
committerjim-p <jimp@pfsense.org>2017-05-22 14:16:25 -0400
commit7120ef411c122e67f6585be13fb89daa9df9a152 (patch)
tree40de5313472f30f812d41821af9d0755443ed661 /src
parent919a0f4a4b8ec00693811d3bfb8cdbc05802da30 (diff)
downloadpfsense-7120ef411c122e67f6585be13fb89daa9df9a152.zip
pfsense-7120ef411c122e67f6585be13fb89daa9df9a152.tar.gz
In the OpenVPN wizard, if the user chooses a different auth server type, clear out stored settings so the wizard does not pre-fill bad info. Fixes #7569
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/wizards/openvpn_wizard.inc7
-rw-r--r--src/usr/local/www/wizards/openvpn_wizard.xml1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/usr/local/www/wizards/openvpn_wizard.inc b/src/usr/local/www/wizards/openvpn_wizard.inc
index c6fdca0..0b4cf16 100644
--- a/src/usr/local/www/wizards/openvpn_wizard.inc
+++ b/src/usr/local/www/wizards/openvpn_wizard.inc
@@ -29,6 +29,13 @@ function has_special_chars($text) {
return preg_match('/[^A-Za-z0-9 _-]/', $text);
}
+function step1_stepsubmitbeforesave() {
+ global $stepid, $config;
+ if (($_POST['authtype'] != NULL) && ($_POST['authtype'] != $config['ovpnserver']['step1']['type'])) {
+ unset($config['ovpnserver']['step2']);
+ }
+}
+
function step1_submitphpaction() {
global $stepid, $config;
if ($_POST['authtype'] == "local") {
diff --git a/src/usr/local/www/wizards/openvpn_wizard.xml b/src/usr/local/www/wizards/openvpn_wizard.xml
index 45b6956..09093ae 100644
--- a/src/usr/local/www/wizards/openvpn_wizard.xml
+++ b/src/usr/local/www/wizards/openvpn_wizard.xml
@@ -58,6 +58,7 @@
<type>submit</type>
</field>
</fields>
+ <stepsubmitbeforesave>step1_stepsubmitbeforesave();</stepsubmitbeforesave>
<stepsubmitphpaction>step1_submitphpaction();</stepsubmitphpaction>
<includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
</step>
OpenPOWER on IntegriCloud