diff --git a/usr/local/www/firewall_shaper_queues_edit.php b/usr/local/www/firewall_shaper_queues_edit.php index dfe9cb0421..b5fca15f54 100755 --- a/usr/local/www/firewall_shaper_queues_edit.php +++ b/usr/local/www/firewall_shaper_queues_edit.php @@ -114,12 +114,30 @@ if ($_POST) { $input_errors[] = "upperlimit service curve defined but missing burst (d) value"; if ($_POST['upperlimit2'] <> "" && $_POST['upperlimit1'] == "") $input_errors[] = "upperlimit service curve defined but missing initial bandwidth (m1) value"; + if ($_POST['upperlimit1'] <> "" && !is_valid_shaperbw($_POST['upperlimit1'])) + $input_errors[] = gettext("upperlimit m1 value needs to be Kb, Mb, Gb, or %"); + if ($_POST['upperlimit2'] <> "" && !is_numeric($_POST['upperlimit2'])) + $input_errors[] = gettext("upperlimit d value needs to be numeric"); + if ($_POST['upperlimit3'] <> "" && !is_valid_shaperbw($_POST['upperlimit3'])) + $input_errors[] = gettext("upperlimit m2 value needs to be Kb, Mb, Gb, or %"); if ($_POST['linkshare1'] <> "" && $_POST['linkshare2'] == "") $input_errors[] = "linkshare service curve defined but missing burst (d) value"; + if ($_POST['linkshare1'] <> "" && !is_valid_shaperbw($_POST['linkshare1'])) + $input_errors[] = gettext("linkshare m1 value needs to be Kb, Mb, Gb, or %"); + if ($_POST['linkshare2'] <> "" && !is_numeric($_POST['linkshare2'])) + $input_errors[] = gettext("linkshare d value needs to be numeric"); + if ($_POST['linkshare3'] <> "" && !is_valid_shaperbw($_POST['linkshare3'])) + $input_errors[] = gettext("linkshare m2 value needs to be Kb, Mb, Gb, or %"); if ($_POST['linkshare2'] <> "" && $_POST['linkshare1'] == "") $input_errors[] = "linkshare service curve defined but missing initial bandwidth (m1) value"; if ($_POST['realtime1'] <> "" && $_POST['realtime2'] == "") $input_errors[] = "realtime service curve defined but missing burst (d) value"; + if ($_POST['realtime1'] <> "" && !is_valid_shaperbw($_POST['realtime1'])) + $input_errors[] = gettext("realtime m1 value needs to be Kb, Mb, Gb, or %"); + if ($_POST['realtime2'] <> "" && !is_numeric($_POST['realtime2'])) + $input_errors[] = gettext("realtime d value needs to be numeric"); + if ($_POST['realtime3'] <> "" && !is_valid_shaperbw($_POST['realtime3'])) + $input_errors[] = gettext("realtime m2 value needs to be Kb, Mb, Gb, or %"); if ($_POST['realtime2'] <> "" && $_POST['realtime1'] == "") $input_errors[] = "realtime service curve defined but missing initial bandwidth (m1) value"; break; @@ -128,13 +146,13 @@ if ($_POST) { case 'priq': break; } - + if (!$input_errors) { $queue = array(); $queue['schedulertype'] = $_POST['schedulertype']; $queue['bandwidth'] = $_POST['bandwidth']; $queue['bandwidthtype'] = $_POST['bandwidthtype']; - if($_POST['bandwidth'] == "") + if($_POST['bandwidth'] == "") unset($queue['bandwidthtype']); if($_POST['bandwidthtype'] == "") unset($queue['bandwidth']); @@ -323,23 +341,23 @@ function enable_attachtoqueue(enable_over) {
| onChange="enable_upperlimit()"> Upperlimit: | The maximum allowed bandwidth for the queue. | |||
| onChange="enable_realtime()"> Real time: | The minimum required bandwidth for the queue. | |||
| onChange="enable_linkshare()"> Link share: | The bandwidth share of a backlogged queue - this overrides priority. |