From 0ceb8927c0123e0c1d464cdfce37313a9db43b4f Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Sun, 6 Mar 2005 20:07:16 +0000 Subject: Wheee...shaper rule movage :) --- usr/local/www/firewall_shaper.php | 75 ++++++++++++++++++++++++++++++++------- 1 file changed, 63 insertions(+), 12 deletions(-) (limited to 'usr/local/www/firewall_shaper.php') diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php index 762a40f..36ff865 100755 --- a/usr/local/www/firewall_shaper.php +++ b/usr/local/www/firewall_shaper.php @@ -110,6 +110,50 @@ if ($_GET['act'] == "del") { header("Location: firewall_shaper.php"); exit; } +} else { + /* yuck - IE won't send value attributes for image buttons, while Mozilla does - + so we use .x/.y to fine move button clicks instead... */ + unset($movebtn); + foreach ($_POST as $pn => $pd) { + if (preg_match("/move_(\d+)_x/", $pn, $matches)) { + $movebtn = $matches[1]; + break; + } + } + /* move selected rules before this rule */ + if (isset($movebtn) && is_array($_POST['rule']) && count($_POST['rule'])) { + $a_shaper_new = array(); + + /* copy all rules < $movebtn and not selected */ + for ($i = 0; $i < $movebtn; $i++) { + if (!in_array($i, $_POST['rule'])) + $a_shaper_new[] = $a_shaper[$i]; + } + + /* copy all selected rules */ + for ($i = 0; $i < count($a_shaper); $i++) { + if ($i == $movebtn) + continue; + if (in_array($i, $_POST['rule'])) + $a_shaper_new[] = $a_shaper[$i]; + } + + /* copy $movebtn rule */ + if ($movebtn < count($a_shaper)) + $a_shaper_new[] = $a_shaper[$movebtn]; + + /* copy all rules > $movebtn and not selected */ + for ($i = $movebtn+1; $i < count($a_shaper); $i++) { + if (!in_array($i, $_POST['rule'])) + $a_shaper_new[] = $a_shaper[$i]; + } + + $a_shaper = $a_shaper_new; + write_config(); + touch($d_filterconfdirty_path); + header("Location: firewall_shaper.php"); + exit; + } } ?> @@ -123,7 +167,9 @@ if ($_GET['act'] == "del") {

Firewall: Traffic shaper: Rules

-
+ +

You must apply the changes in order for them to take effect.");?>
@@ -153,7 +199,9 @@ if ($_GET['act'] == "del") {  
- + + + @@ -162,8 +210,10 @@ if ($_GET['act'] == "del") { - - + + + + - - - - - + - +
   If Proto SourceDescription
" . $textse;; ?> + +
Port:
+
Port:
+ "> -
- + +
+ @@ -226,9 +277,9 @@ if ($_GET['act'] == "del") {
-- cgit v1.1