From 21963d51008518f4c982c2334600a2605dfd30a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=C3=A7i?= Date: Thu, 27 Mar 2008 17:29:15 +0000 Subject: Fixup wizards --- .../wizards/traffic_shaper_wizard_dedicated.xml | 2 +- .../wizards/traffic_shaper_wizard_multi_all.xml | 20 +++--- .../wizards/traffic_shaper_wizard_multi_lan.inc | 79 +++++++++++----------- .../wizards/traffic_shaper_wizard_multi_lan.xml | 43 ++++++------ 4 files changed, 71 insertions(+), 73 deletions(-) (limited to 'usr/local/www/wizards') diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml index 3620a32..4cf81b6 100755 --- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml +++ b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml @@ -2,7 +2,7 @@ /* $Id$ */ - traffic_shaper_wizard.xml + traffic_shaper_wizard_dedicated.xml part of pfSense (http://www.pfsense.org/) Copyright (C) 2005 Bill Marquette - bill.marquette@gmail.com. diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml index 071c544..95ec434 100755 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml @@ -2,7 +2,7 @@ /* $Id$ */ - traffic_shaper_wizard.xml + traffic_shaper_wizard_multi_all.xml part of pfSense (http://www.pfsense.org/) Copyright (C) 2005 Bill Marquette - bill.marquette@gmail.com. @@ -62,7 +62,7 @@ step1_submitphpaction(); - /usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc 2 @@ -71,7 +71,7 @@ step2_stepbeforeformdisplay(); step2_stepsubmitphpaction(); - /usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc Next @@ -144,7 +144,7 @@ step3_stepbeforeformdisplay(); step3_stepsubmitphpaction(); - /usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc 4 @@ -222,7 +222,7 @@ step4_stepsubmitphpaction(); - /usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc 5 @@ -429,7 +429,7 @@ step5_stepsubmitphpaction(); - /usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc 6 @@ -591,7 +591,7 @@ submit - /usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc 7 @@ -1185,7 +1185,7 @@ submit - /usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc 8 @@ -1202,7 +1202,7 @@ step8_stepsubmitphpaction(); - /usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc 9 @@ -1213,7 +1213,7 @@ submit - /usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc step9_stepsubmitphpaction(); diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc index 87d2590..b0061bc 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc @@ -35,12 +35,12 @@ function step1_submitphpaction() { if (!isset($_POST['numberofconnections'])) { $message=gettext("You need to specify the number of local interfaces connected."); - header("Location:wizard.php?xml=traffic_shaper_wizard.xml&stepid=0&message={$message}"); + header("Location:wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=0&message={$message}"); exit; } if (intval($_POST['numberofconnections']) > 100 || intval($_POST['numberofconnections']) < 1) { $message=gettext("The number of local interfaces supported is between 1 and 100."); - header("Location:wizard.php?xml=traffic_shaper_wizard.xml&stepid=0&message={$message}"); + header("Location:wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=0&message={$message}"); exit; } } @@ -55,7 +55,7 @@ function step2_stepbeforeformdisplay() { continue; if (!isset($ifdesc['enable']) && $if != "lan" && $if != "wan") continue; - if ($if == "lan") + if ($if == "wan") continue; $numberofinterfaces++; $iflist[] = $if; @@ -63,7 +63,7 @@ function step2_stepbeforeformdisplay() { $numberofconnections = intval($config['ezshaper']['step1']['numberofconnections']); if ($numberofconnections > $numberofinterfaces) { $message=gettext("You do not have {$numberofconnections} of local interfaces!"); - header("Location:wizard.php?xml=traffic_shaper_wizard.xml&stepid=0&message={$message}"); + header("Location:wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=0&message={$message}"); exit; } @@ -81,7 +81,7 @@ function step2_stepbeforeformdisplay() { $field['type'] = "listtopic"; $fields[] = $field; $field = array(); - $field['name'] = "uploaddscheduler"; + $field['name'] = "Upload Scheduler"; $field['type'] = "select"; $field['typehint'] = "Queueing discipline to apply on the upload of this connection."; $field['options']['option'] = array(); @@ -221,40 +221,40 @@ function step2_stepsubmitphpaction() { for ($j = $j; $j < $steps; $j++) { if ($_POST["conn{$i}interface"] == $_POST["conn{$j}interface"]) { $message=gettext("You cannot select the same interface for connections {$i} and {$j}."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=1&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=1&message={$message}"); exit; } - if (!is_numeric($_POST["conn{$i}upload"])) { - $message = gettext("Upload bandwidth of connection {$i} is not valid."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=1&message={$message}"); + } + } + if (!is_numeric($_POST["connupload"])) { + $message = gettext("Upload bandwidth of connection is not valid."); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=1&message={$message}"); exit; } - if (!is_numeric($_POST["conn{$i}download"])) { - $message = gettext("Download bandwidth of connection {$i} is not valid."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=1&message={$message}"); + if (!is_numeric($_POST["conndownload"])) { + $message = gettext("Download bandwidth of connection is not valid."); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=1&message={$message}"); exit; } - $upbw = floatval($_POST["conn{$i}upload"]); - $downbw = floatval($_POST["conn{$i}download"]); + $upbw = floatval($_POST["connupload"]); + $downbw = floatval($_POST["conndownload"]); if ($upbw == 0 || $downbw = 0) { $message = gettext("You cannot specify 0 bandwidth!") ; - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=1&message + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=1&message ={$message}"); exit; } - if (intval($upbw) < 128 && $_POST["conn{$i}uploadspeed"] == "Kb" && trim($_POST["conn{$i}scheduler"]) == "CBQ") { + if (intval($upbw) < 128 && $_POST["connuploadspeed"] == "Kb" && trim($_POST["connscheduler"]) == "CBQ") { $message=gettext("We do not support Bandwidths smaller than 128Kbit/s for CBQ scheduler."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=1&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=1&message={$message}"); exit; } - if ($downbw < 128 && $_POST["conn{$i}downloadspeed"] == "Kb" && trim($_POST["downloadscheduler"]) == "CBQ") { + if ($downbw < 128 && $_POST["conndownloadspeed"] == "Kb" && trim($_POST["downloadscheduler"]) == "CBQ") { $message=gettext("We do not support Bandwidths smaller than 128Kbit/s for CBQ scheduler."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=1&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=1&message={$message}"); exit; } - } - } /* This is necessary since the wizard expects predefined fields. */ unset($config['ezshaper']['step2']); @@ -283,7 +283,7 @@ function step3_stepsubmitphpaction() { if(!is_alias($_POST['address'])) { /* item is not an ip or alias. error out */ $message=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=2&message={$message}"); exit; } } @@ -294,7 +294,7 @@ function step3_stepsubmitphpaction() { if ($_POST["connupload"]) { if (!is_numeric($_POST["connupload"])) { $message = gettext("Upload bandwidth of connection {$i} is not valid."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=2&message={$message}"); exit; } $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}uploadspeed"]); @@ -303,7 +303,7 @@ function step3_stepsubmitphpaction() { $input_bw = $factor * floatval($_POST["conn{$i}upload"]); if ((0.8 * $ifbw) < $input_bw) { $message=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=2&message={$message}"); exit; } } @@ -317,24 +317,24 @@ function step4_stepsubmitphpaction() { if ( $_POST['enable'] ) { if(!$_POST['bandwidth']) { $message="You need to specify a value for bandwidth!"; - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=3&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=3&message={$message}"); exit; } if(!is_numeric($_POST['bandwidth'])) { $message="The posted value is not a valid bandwidth."; - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=3&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=3&message={$message}"); exit; } /* if (wizard_get_bwunit($_POST['bandwidth']) <> "%") { $message = gettext("Only percentage bandwidth specification is allowed."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=3&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=3&message={$message}"); exit; } $bw = wizard_get_bw($_POST['bandwidth']); if($bw > 15 && $bw < 2) { $message="Values should be between 2% and 15%!"; - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=3&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=3&message={$message}"); exit; } */ @@ -343,7 +343,7 @@ function step4_stepsubmitphpaction() { if(!is_alias($_POST['address'])) { /* item is not an ip or alias. error out */ $message=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=3&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=3&message={$message}"); } } } @@ -356,19 +356,19 @@ function step5_stepsubmitphpaction() { if (isset($_POST['bandwidth']) && $_POST['bandwidth'] <> "") { if(!is_numeric($_POST['bandwidth'])) { $message="Posted value is not a valid bandwidth."; - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=4&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=4&message={$message}"); } /* if (wizard_get_bwunit($_POST['bandwidth']) <> "%") { $message = gettext("Only percentage bandwidth specification is allowed."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=4&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=4&message={$message}"); exit; } $bw = wizard_get_bw($_POST['bandwidth']); if($bw > 15 && $bw < 2) { $message="Values should be between 2% and 15%!"; - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=3&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=3&message={$message}"); exit; } */ @@ -752,8 +752,8 @@ $othersplist = array(); $altq->SetInterface($config['ezshaper']['step2']["conn{$i}interface"]); $altq->SetScheduler($config['ezshaper']['step2']["conn{$i}downloadscheduler"]); - $altq->SetBandwidth(floatval($config['ezshaper']['step2']["conndownload"])); - $altq->SetBwscale($config['ezshaper']['step2']["conndownloadspeed"]); + //$altq->SetBandwidth(floatval($config['ezshaper']['step2']["conndownload"])); + //$altq->SetBwscale($config['ezshaper']['step2']["conndownloadspeed"]); $altq->SetEnabled("on"); $altq_list_queues[$altq->GetQname()] =& $altq; array_push($tmppath, $config['ezshaper']['step2']["conn{$i}interface"]); @@ -838,7 +838,7 @@ $othersplist = array(); /* if ($remainbw > 0 && $remainbw > 30) { $message=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=2&message={$message}"); exit; } else { */ @@ -1143,7 +1143,9 @@ $othersplist = array(); $games = false; $otherpriority = false; $remainbw = 0; - + $upfactor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["connuploadspeed"]); + $lanbw = floatval($config['ezshaper']['step2']["connupload"]) * $upfactor; + if ($config['ezshaper']['step3']['enable']) { $voip = true; @@ -1206,7 +1208,7 @@ $othersplist = array(); /* if ($remainbw > 0 && $remainbw > 30) { $message=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$message}"); + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=2&message={$message}"); exit; } else { */ @@ -1241,8 +1243,9 @@ $othersplist = array(); array_push($tmppath, "qACK"); $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); array_pop($tmppath); - //echo "qACK
"; + //echo "$lkbw $remainbw qACK
"; //var_dump($input_errors); + //var_dump($qtmp); $qtmp->wconfig(); if ($sched == "PRIQ") diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml index 347b00b..96408d3 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml @@ -2,7 +2,7 @@ /* $Id$ */ - traffic_shaper_wizard.xml + traffic_shaper_wizard_multi_lan.xml part of pfSense (http://www.pfsense.org/) Copyright (C) 2005 Bill Marquette - bill.marquette@gmail.com. @@ -51,7 +51,7 @@ step1_submitphpaction(); - /usr/local/www/wizards/traffic_shaper_wizard.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc 2 @@ -60,7 +60,7 @@ step2_stepbeforeformdisplay(); step2_stepsubmitphpaction(); - /usr/local/www/wizards/traffic_shaper_wizard.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc Next @@ -120,10 +120,8 @@ IP Address field is non-blank and doesn't look like an IP address. - Bandwidth + Download Speed input - ^[0-9]*$ - Total bandwidth in percentage(%)(should be between 5 and 40) guarantee for VOIP traffic. ezshaper->step3->connupload true @@ -132,14 +130,14 @@ true true true - Download Speed + Download Speed Unit The limit you want to apply. select + % + % + - ezshaper->step4->connuploadspeed + ezshaper->step3->connuploadspeed - Download Speed + Upload Speed input - ^[0-9]*$ - Total bandwidth in percentage(%)(should be between 5 and 40) guarantee for VOIP traffic. ezshaper->step3->conndownload true @@ -168,7 +164,7 @@ true true true - Download Speed + Upload Speed Unit The limit you want to apply. select @@ -189,16 +185,15 @@ Gb - ezshaper->step4->conndownloadspeed + ezshaper->step3->conndownloadspeed Next submit - step3_stepbeforeformdisplay(); step3_stepsubmitphpaction(); - /usr/local/www/wizards/traffic_shaper_wizard.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc 4 @@ -276,7 +271,7 @@ step4_stepsubmitphpaction(); - /usr/local/www/wizards/traffic_shaper_wizard.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc 5 @@ -483,7 +478,7 @@ step5_stepsubmitphpaction(); - /usr/local/www/wizards/traffic_shaper_wizard.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc 6 @@ -645,7 +640,7 @@ submit - /usr/local/www/wizards/traffic_shaper_wizard.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc 7 @@ -1239,7 +1234,7 @@ submit - /usr/local/www/wizards/traffic_shaper_wizard.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc 8 @@ -1256,7 +1251,7 @@ step8_stepsubmitphpaction(); - /usr/local/www/wizards/traffic_shaper_wizard.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc 9 @@ -1267,7 +1262,7 @@ submit - /usr/local/www/wizards/traffic_shaper_wizard.inc + /usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc step9_stepsubmitphpaction(); -- cgit v1.1