summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-01-06 14:22:31 -0200
committerRenato Botelho <renato@netgate.com>2016-01-06 14:27:55 -0200
commitbe5132091a7d7dbc5bf01380ba40db85163941ce (patch)
treecd2edbb219afeb0e1fed80a4838d3bf25cc34c22
parent09d720fcbaa7d23b4248bcf5f7f6862ed3cbb501 (diff)
downloadpfsense-be5132091a7d7dbc5bf01380ba40db85163941ce.zip
pfsense-be5132091a7d7dbc5bf01380ba40db85163941ce.tar.gz
Replace n_l2tp_units field by a drop-down from 1 to 255 and add a post validation just to be sure. Ticket #5720
-rw-r--r--src/usr/local/www/vpn_l2tp.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/usr/local/www/vpn_l2tp.php b/src/usr/local/www/vpn_l2tp.php
index 092a0ba..1251355 100644
--- a/src/usr/local/www/vpn_l2tp.php
+++ b/src/usr/local/www/vpn_l2tp.php
@@ -123,6 +123,10 @@ if ($_POST) {
$input_errors[] = gettext("Secret and confirmation must match");
}
+ if (!is_numericint($_POST['n_l2tp_units']) || $_POST['n_l2tp_units'] > 255) {
+ $input_errors[] = gettext("Number of L2TP users must be between 1 and 255");
+ }
+
/* if this is an AJAX caller then handle via JSON */
if (isAjax() && is_array($input_errors)) {
input_errors2Ajax($input_errors);
@@ -282,12 +286,11 @@ $section->addInput(new Form_IpAddress(
))->addMask(l2tp_subnet, $pconfig['l2tp_subnet'])
->setHelp('Specify the starting address for the client IP address subnet.');
-$section->addInput(new Form_Input(
+$section->addInput(new Form_Select(
'n_l2tp_units',
'Number of L2TP users',
- 'number',
$pconfig['n_l2tp_units'],
- ['min' => 0, 'max' => 255]
+ array_combine(range(1, 255, 1), range(1, 255, 1))
));
$section->addPassword(new Form_Input(
OpenPOWER on IntegriCloud