From f1926a412514eb55715bbd9a952005dab27dbdae Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 6 Jan 2016 14:25:18 -0200 Subject: Change number of PPPoE users range to 1-255 and add an extra POST validation --- src/usr/local/www/services_pppoe_edit.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/usr/local/www') diff --git a/src/usr/local/www/services_pppoe_edit.php b/src/usr/local/www/services_pppoe_edit.php index eca5618..de6b202 100644 --- a/src/usr/local/www/services_pppoe_edit.php +++ b/src/usr/local/www/services_pppoe_edit.php @@ -157,6 +157,9 @@ if ($_POST) { if (($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver']))) { $input_errors[] = gettext("A valid RADIUS server address must be specified."); } + if (!is_numericint($_POST['n_pppoe_units']) || $_POST['n_pppoe_units'] > 255) { + $input_errors[] = gettext("Number of PPPoE users must be between 1 and 255"); + } $_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['pppoe_subnet']); $subnet_start = ip2ulong($_POST['remoteip']); @@ -346,7 +349,7 @@ $section->addInput(new Form_Select( 'n_pppoe_units', 'No. of PPPoE Users', $pconfig['n_pppoe_units'], - array_combine(range(0, 255, 1), range(0, 255, 1)) + array_combine(range(1, 255, 1), range(1, 255, 1)) )); $section->addInput(new Form_IpAddress( -- cgit v1.1