diff options
author | jim-p <jim@pingle.org> | 2010-04-19 16:46:01 -0400 |
---|---|---|
committer | jim-p <jim@pingle.org> | 2010-04-19 16:46:01 -0400 |
commit | c88c2df9ee71f051fd30460216f3ea341eb3b51a (patch) | |
tree | 62795d8ce1f6db6d1e7e26797ba96b6b9039af86 /usr/local | |
parent | 6e6a5ce36fee7ac4d822078157da6af8ee3bfeb3 (diff) | |
download | pfsense-c88c2df9ee71f051fd30460216f3ea341eb3b51a.zip pfsense-c88c2df9ee71f051fd30460216f3ea341eb3b51a.tar.gz |
Perform IP/Host and Port number validation for Authentication servers in the OpenVPN Wizard.
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/wizards/openvpn_wizard.inc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/usr/local/www/wizards/openvpn_wizard.inc b/usr/local/www/wizards/openvpn_wizard.inc index dc6e91e..eea1a85 100644 --- a/usr/local/www/wizards/openvpn_wizard.inc +++ b/usr/local/www/wizards/openvpn_wizard.inc @@ -82,6 +82,9 @@ function step3_submitphpaction() { $config['ovpnserver']['step2']['port'] = 389; elseif ($_POST['transport'] == "ssl") $config['ovpnserver']['step2']['port'] = 636; + } elseif (!is_port($_POST['port'])) { + $stepid--; + $savemsg = "Please enter a valid port number."; } if (empty($_POST['name']) || empty($_POST['ip']) ||empty($_POST['transport']) || @@ -91,6 +94,9 @@ function step3_submitphpaction() { } else if (count(($authcfg = auth_get_authserver($_POST['name']))) > 0) { $stepid--; $savemsg = "Please choose a different name because an authentication server with this name already exists."; + } elseif (!is_fqdn($_POST['ip']) && !is_ipaddr($_POST['ip'])) { + $stepid--; + $savemsg = "Please enter a valid IP address or hostname for the authentication server."; } else { $config['ovpnserver']['step2']['uselist'] = "on"; $_POST['uselist'] = "on"; @@ -132,8 +138,12 @@ function step5_submitphpaction() { global $stepid, $savemsg, $config; /* Default RADIUS Auth port = 1812 */ - if (empty($_POST['port'])) + if (empty($_POST['port'])) { $config['ovpnserver']['step2']['port'] = 1812; + } elseif (!is_port($_POST['port'])) { + $stepid--; + $savemsg = "Please enter a valid port number."; + } if (empty($_POST['name']) || empty($_POST['ip']) || empty($_POST['secret'])) { $stepid--; @@ -141,6 +151,9 @@ function step5_submitphpaction() { } else if (count(($authcfg = auth_get_authserver($_POST['name']))) > 0) { $stepid--; $savemsg = "Please choose a different name because an authentication server with this name already exists."; + } elseif (!is_fqdn($_POST['ip']) && !is_ipaddr($_POST['ip'])) { + $stepid--; + $savemsg = "Please enter a valid IP address or hostname for the authentication server."; } else { $config['ovpnserver']['step2']['uselist'] = "on"; $_POST['uselist'] = "on"; |