diff options
author | jim-p <jimp@pfsense.org> | 2017-05-22 14:16:25 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2017-05-22 14:16:25 -0400 |
commit | 7120ef411c122e67f6585be13fb89daa9df9a152 (patch) | |
tree | 40de5313472f30f812d41821af9d0755443ed661 | |
parent | 919a0f4a4b8ec00693811d3bfb8cdbc05802da30 (diff) | |
download | pfsense-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
-rw-r--r-- | src/usr/local/www/wizards/openvpn_wizard.inc | 7 | ||||
-rw-r--r-- | src/usr/local/www/wizards/openvpn_wizard.xml | 1 |
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> |