From 6e6a5ce36fee7ac4d822078157da6af8ee3bfeb3 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 19 Apr 2010 16:27:00 -0400 Subject: Restrict country code entry in the OpenVPN wizard to two letters. --- usr/local/www/wizards/openvpn_wizard.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr/local/www/wizards/openvpn_wizard.inc b/usr/local/www/wizards/openvpn_wizard.inc index 361e823..dc6e91e 100644 --- a/usr/local/www/wizards/openvpn_wizard.inc +++ b/usr/local/www/wizards/openvpn_wizard.inc @@ -188,6 +188,9 @@ function step7_submitphpaction() { } elseif (in_array($_POST['name'], $canames) || in_array($_POST['name'], $cacns)) { $stepid--; $savemsg = "Please enter a different name for the Certicicate Authority. A Certificate Authority with that name already exists."; + } elseif (strlen($_POST['country']) != 2) { + $stepid--; + $savemsg = "Please enter only a two-letter ISO country code"; } else { $config['ovpnserver']['step6']['uselist'] = "on"; $_POST['uselist'] = "on"; @@ -269,6 +272,9 @@ function step9_submitphpaction() { } elseif (in_array($_POST['name'], $certnames) || in_array($_POST['name'], $certcns)) { $stepid--; $savemsg = "Please enter a different name for the Certicicate. A Certificate with that name/common name already exists."; + } elseif (strlen($_POST['country']) != 2) { + $stepid--; + $savemsg = "Please enter only a two-letter ISO country code"; } else { $config['ovpnserver']['step9']['uselist'] = "on"; $_POST['uselist'] = "on"; -- cgit v1.1