From 8c84fe438ecaaa5acc40da2fdae6709fc228fc5d Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 4 Jul 2006 23:35:59 +0000 Subject: [PATCH] MFC Require the user to have a brain to see the Source port range for a firewall rule by adding a link in the source box that says Advanced - Show source port range. --- usr/local/www/firewall_rules_edit.php | 30 ++++++++++--------- .../firewall_rules_edit.js | 4 +++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index b9cee16766..b1dd3869e1 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -85,14 +85,14 @@ if (isset($id) && $a_filter[$id]) { $pconfig['disabled'] = isset($a_filter[$id]['disabled']); $pconfig['log'] = isset($a_filter[$id]['log']); $pconfig['descr'] = $a_filter[$id]['descr']; - + /* advanced */ $pconfig['max-src-nodes'] = $a_filter[$id]['max-src-nodes']; $pconfig['max-src-states'] = $a_filter[$id]['max-src-states']; $pconfig['statetype'] = $a_filter[$id]['statetype']; $pconfig['statetimeout'] = $a_filter[$id]['statetimeout']; - - $pconfig['nosync'] = isset($a_filter[$id]['nosync']); + + $pconfig['nosync'] = isset($a_filter[$id]['nosync']); /* advanced - new connection per second banning*/ $pconfig['max-src-conn-rate'] = $a_filter[$id]['max-src-conn-rate']; @@ -261,7 +261,7 @@ if ($_POST) { $filterent['os'] = $_POST['os']; /* Nosync directive - do not xmlrpc sync this item */ - if($_POST['nosync'] <> "") + if($_POST['nosync'] <> "") $filterent['nosync'] = true; else unset($filterent['nosync']); @@ -350,7 +350,7 @@ include("head.inc"); - +
Choose what to do with packets that match the criteria specified below.
@@ -378,7 +378,7 @@ include("head.inc"); foreach ($interfaces as $iface => $ifacename): ?> - +
Choose on which interface packets must come in to match this rule. @@ -453,7 +453,7 @@ include("head.inc"); - + @@ -473,6 +473,8 @@ include("head.inc"); +

+ Advanced - Show source port range @@ -488,7 +490,7 @@ include("head.inc"); $wkportdesc): ?> - + @@ -501,7 +503,7 @@ include("head.inc"); $wkportdesc): ?> - + @@ -510,7 +512,7 @@ include("head.inc"); Specify the port or port range for the source of the packet for this rule. This is usually not equal to the destination port range (and is often "any").
Hint: you can leave the 'to' field empty if you only want to filter a single port

NOTE: You will not need to enter anything here in 99.99999% of the circumstances. If you're unsure, do not enter anything here! - + Source OS OS Type:  @@ -610,7 +612,7 @@ include("head.inc"); $wkportdesc): ?> - + @@ -690,7 +692,7 @@ include("head.inc"); >
HINT: This prevents the rule from automatically syncing to other carp members. - + {$gw}\n"; + echo "\n"; } else { echo "\n"; } @@ -722,7 +724,7 @@ include("head.inc"); echo "\n"; } else { echo "\n"; - } + } } for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) { if($config['interfaces']['opt' . $i]['ipaddr'] == "dhcp") { diff --git a/usr/local/www/javascript/firewall_rules_edit/firewall_rules_edit.js b/usr/local/www/javascript/firewall_rules_edit/firewall_rules_edit.js index aa38bde2b0..c9b9ca9f35 100644 --- a/usr/local/www/javascript/firewall_rules_edit/firewall_rules_edit.js +++ b/usr/local/www/javascript/firewall_rules_edit/firewall_rules_edit.js @@ -40,6 +40,10 @@ function ext_change() { } } +function show_source_port_range() { + document.getElementById("sourceportrangetable").style.display = "table-row"; +} + function typesel_change() { switch (document.iform.srctype.selectedIndex) { case 1: /* single */