From f8fee2cead58ea34dfc7d4b9d022f05ffd738980 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 23 Apr 2013 20:33:53 -0300 Subject: [PATCH] Fix whitespace and indent --- usr/local/www/firewall_rules_edit.php | 181 +++++++++++++------------- 1 file changed, 90 insertions(+), 91 deletions(-) diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 77808e4949..410534306b 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -3,7 +3,7 @@ /* firewall_rules_edit.php part of pfSense (http://www.pfsense.com) - Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com) + Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com) originally part of m0n0wall (http://m0n0.ch/wall) Copyright (C) 2003-2004 Manuel Kasper . @@ -91,18 +91,18 @@ if (isset($id) && $a_filter[$id]) { if (isset($a_filter[$id]['floating']) || $if == "FloatingRules") { $pconfig['floating'] = $a_filter[$id]['floating']; - if (isset($a_filter[$id]['interface']) && $a_filter[$id]['interface'] <> "") + if (isset($a_filter[$id]['interface']) && $a_filter[$id]['interface'] <> "") $pconfig['interface'] = $a_filter[$id]['interface']; } - - if (isset($a_filter['floating'])) + + if (isset($a_filter['floating'])) $pconfig['floating'] = "yes"; if (isset($a_filter[$id]['direction'])) - $pconfig['direction'] = $a_filter[$id]['direction']; + $pconfig['direction'] = $a_filter[$id]['direction']; if (isset($a_filter[$id]['ipprotocol'])) - $pconfig['ipprotocol'] = $a_filter[$id]['ipprotocol']; + $pconfig['ipprotocol'] = $a_filter[$id]['ipprotocol']; if (isset($a_filter[$id]['protocol'])) $pconfig['proto'] = $a_filter[$id]['protocol']; @@ -133,16 +133,16 @@ if (isset($id) && $a_filter[$id]) { if (isset($a_filter[$id]['tcpflags_any'])) $pconfig['tcpflags_any'] = true; else { - if (isset($a_filter[$id]['tcpflags1']) && $a_filter[$id]['tcpflags1'] <> "") + if (isset($a_filter[$id]['tcpflags1']) && $a_filter[$id]['tcpflags1'] <> "") $pconfig['tcpflags1'] = $a_filter[$id]['tcpflags1']; - if (isset($a_filter[$id]['tcpflags2']) && $a_filter[$id]['tcpflags2'] <> "") + if (isset($a_filter[$id]['tcpflags2']) && $a_filter[$id]['tcpflags2'] <> "") $pconfig['tcpflags2'] = $a_filter[$id]['tcpflags2']; } - if (isset($a_filter[$id]['tag']) && $a_filter[$id]['tag'] <> "") + if (isset($a_filter[$id]['tag']) && $a_filter[$id]['tag'] <> "") $pconfig['tag'] = $a_filter[$id]['tag']; if (isset($a_filter[$id]['tagged']) && $a_filter[$id]['tagged'] <> "") - $pconfig['tagged'] = $a_filter[$id]['tagged']; + $pconfig['tagged'] = $a_filter[$id]['tagged']; if (isset($a_filter[$id]['quick']) && $a_filter[$id]['quick']) $pconfig['quick'] = $a_filter[$id]['quick']; if (isset($a_filter[$id]['allowopts'])) @@ -167,7 +167,7 @@ if (isset($id) && $a_filter[$id]) { /* Multi-WAN next-hop support */ $pconfig['gateway'] = $a_filter[$id]['gateway']; - + /* Shaper support */ $pconfig['defaultqueue'] = (($a_filter[$id]['ackqueue'] == "none") ? '' : $a_filter[$id]['defaultqueue']); $pconfig['ackqueue'] = (($a_filter[$id]['ackqueue'] == "none") ? '' : $a_filter[$id]['ackqueue']); @@ -330,7 +330,7 @@ if ($_POST) { if(($_POST['statetype'] == "synproxy state") && ($_POST['gateway'] != "")) $input_errors[] = sprintf(gettext("%s is only valid if the gateway is set to 'default'."),$_POST['statetype']); } - + if ( isset($a_filter[$id]['associated-rule-id'])===false && (!(is_specialnet($_POST['srctype']) || ($_POST['srctype'] == "single"))) ) { $reqdfields[] = "srcmask"; @@ -354,7 +354,7 @@ if ($_POST) { } if ($_POST['srcbeginport'] && !is_portoralias($_POST['srcbeginport'])) - $input_errors[] = sprintf(gettext("%s is not a valid start source port. It must be a port alias or integer between 1 and 65535."),$_POST['srcbeginposrt']); + $input_errors[] = sprintf(gettext("%s is not a valid start source port. It must be a port alias or integer between 1 and 65535."),$_POST['srcbeginposrt']); if ($_POST['srcendport'] && !is_portoralias($_POST['srcendport'])) $input_errors[] = sprintf(gettext("%s is not a valid end source port. It must be a port alias or integer between 1 and 65535."),$_POST['srcendport']); if ($_POST['dstbeginport'] && !is_portoralias($_POST['dstbeginport'])) @@ -367,8 +367,8 @@ if ($_POST) { if ( $_POST['srcbeginport_cust'] && $_POST['srcendport_cust']){ if (is_alias($_POST['srcendport_cust']) && is_alias($_POST['srcendport_cust']) && $_POST['srcbeginport_cust'] != $_POST['srcendport_cust']) $input_errors[] = 'The same port alias must be used in Source port range from: and to: fields'; - if ((is_alias($_POST['srcbeginport_cust']) && (!is_alias($_POST['srcendport_cust']) && $_POST['srcendport_cust']!='')) || - ((!is_alias($_POST['srcbeginport_cust']) && $_POST['srcbeginport_cust']!='') && is_alias($_POST['srcendport_cust']))) + if ((is_alias($_POST['srcbeginport_cust']) && (!is_alias($_POST['srcendport_cust']) && $_POST['srcendport_cust']!='')) || + ((!is_alias($_POST['srcbeginport_cust']) && $_POST['srcbeginport_cust']!='') && is_alias($_POST['srcendport_cust']))) $input_errors[] = 'You cannot specify numbers and port aliases at the same time in Source port range from: and to: field'; } if ( !$_POST['dstbeginport_cust'] && $_POST['dstendport_cust']) @@ -377,8 +377,8 @@ if ($_POST) { if ( $_POST['dstbeginport_cust'] && $_POST['dstendport_cust']){ if (is_alias($_POST['dstendport_cust']) && is_alias($_POST['dstendport_cust']) && $_POST['dstbeginport_cust'] != $_POST['dstendport_cust']) $input_errors[] = 'The same port alias must be used in Destination port range from: and to: fields'; - if ((is_alias($_POST['dstbeginport_cust']) && (!is_alias($_POST['dstendport_cust']) && $_POST['dstendport_cust']!='')) || - ((!is_alias($_POST['dstbeginport_cust']) && $_POST['dstbeginport_cust']!='') && is_alias($_POST['dstendport_cust']))) + if ((is_alias($_POST['dstbeginport_cust']) && (!is_alias($_POST['dstendport_cust']) && $_POST['dstendport_cust']!='')) || + ((!is_alias($_POST['dstbeginport_cust']) && $_POST['dstbeginport_cust']!='') && is_alias($_POST['dstendport_cust']))) $input_errors[] = 'You cannot specify numbers and port aliases at the same time in Destination port range from: and to: field'; } @@ -445,7 +445,7 @@ if ($_POST) { if ($_POST['defaultqueue'] == "" ) $input_errors[] = gettext("You have to select a queue when you select an acknowledge queue too."); else if ($_POST['ackqueue'] == $_POST['defaultqueue']) - $input_errors[] = gettext("Acknowledge queue and Queue cannot be the same."); + $input_errors[] = gettext("Acknowledge queue and Queue cannot be the same."); } if (isset($_POST['floating']) && $_POST['pdnpipe'] != "" && (empty($_POST['direction']) || $_POST['direction'] == "any")) $input_errors[] = gettext("You can not use limiters in Floating rules without choosing a direction."); @@ -458,7 +458,7 @@ if ($_POST) { $input_errors[] = gettext("In and Out Queue cannot be the same."); else if ($dnqlist[$_POST['pdnpipe']][0] == "?" && $dnqlist[$_POST['dnpipe']][0] <> "?") $input_errors[] = gettext("You cannot select one queue and one virtual interface for IN and Out. both must be from the same type."); - else if ($dnqlist[$_POST['dnpipe']][0] == "?" && $dnqlist[$_POST['pdnpipe']][0] <> "?") + else if ($dnqlist[$_POST['dnpipe']][0] == "?" && $dnqlist[$_POST['pdnpipe']][0] <> "?") $input_errors[] = gettext("You cannot select one queue and one virtual interface for IN and Out. both must be from the same type."); if ($_POST['direction'] == "out" && empty($_POST['gateway'])) $input_errors[] = gettext("Please select a gateway, normaly the interface selected gateway, so the limiters work correctly"); @@ -485,7 +485,7 @@ if ($_POST) { $input_errors[] = gettext("If you specify TCP flags that should be set you should specify out of which flags as well."); } - // Allow extending of the firewall edit page and include custom input validation + // Allow extending of the firewall edit page and include custom input validation pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/input_validation"); if (!$input_errors) { @@ -597,7 +597,7 @@ if ($_POST) { if ($_POST['gateway'] != "") { $filterent['gateway'] = $_POST['gateway']; } - + if ($_POST['defaultqueue'] != "") { $filterent['defaultqueue'] = $_POST['defaultqueue']; if ($_POST['ackqueue'] != "") @@ -613,7 +613,7 @@ if ($_POST) { if ($_POST['l7container'] != "") { $filterent['l7container'] = $_POST['l7container']; } - + if ($_POST['sched'] != "") { $filterent['sched'] = $_POST['sched']; } @@ -647,7 +647,7 @@ if ($_POST) { $filterent['updated'] = make_config_revision_entry(); - // Allow extending of the firewall edit page and include custom input validation + // Allow extending of the firewall edit page and include custom input validation pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_write_config"); if (isset($id) && $a_filter[$id]) @@ -698,12 +698,12 @@ include("head.inc"); - + - + @@ -778,15 +778,14 @@ include("head.inc"); > - $ifdesc) if(have_ruleint_access($ifent)) @@ -795,14 +794,14 @@ include("head.inc"); if(have_ruleint_access("l2tp")) $interfaces['l2tp'] = "L2TP VPN"; if ($config['pptpd']['mode'] == "server") - if(have_ruleint_access("pptp")) + if(have_ruleint_access("pptp")) $interfaces['pptp'] = "PPTP VPN"; - + if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) $interfaces['pppoe'] = "PPPoE VPN"; /* add ipsec interfaces */ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) - if(have_ruleint_access("enc0")) + if(have_ruleint_access("enc0")) $interfaces["enc0"] = "IPsec"; /* add openvpn/tun interfaces */ if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) @@ -829,10 +828,10 @@ include("head.inc"); foreach ($directions as $direction): ?> - + @@ -846,10 +845,10 @@ include("head.inc"); foreach ($ipproto as $proto => $name): ?> - +
@@ -922,7 +921,7 @@ include("head.inc"); > @@ -931,10 +930,10 @@ include("head.inc"); - - - - + + + + $ifdesc): ?> @@ -1031,10 +1030,10 @@ include("head.inc"); - + - - + + $ifdesc): ?> @@ -1054,7 +1053,7 @@ include("head.inc"); / - + - + @@ -1405,7 +1404,7 @@ $i--): ?> continue; if(($pconfig['ipprotocol'] == "inet") && !(($gw['ipprotocol'] == "inet") || (is_ipaddrv4($gw['gateway'])))) continue; - if($gw == "") + if($gw == "") continue; if($gwname == $pconfig['gateway']) { $selected = " selected=\"selected\""; @@ -1462,10 +1461,10 @@ $i--): ?> $dnqselected = 1; echo " selected=\"selected\""; } - echo ">{$dnq}"; + echo ">{$dnq}"; } ?> - / + / @@ -1515,10 +1514,10 @@ $i--): ?> if (isset($ifdisp[$q])) echo ">{$ifdisp[$q]}"; else - echo ">{$q}"; + echo ">{$q}"; } ?> - / + / @@ -1552,31 +1551,31 @@ $i--): ?> " /> -
> - none"; - foreach ($l7clist as $l7ckey) { - echo ""; + foreach ($l7clist as $l7ckey) { + echo ""; } - echo ">{$l7ckey}"; - } ?> - -
- - - -
- - + +
+ + + + + + ; var oTextbox1 = new AutoSuggestControl(document.getElementById("src"), new StateSuggestions(addressarray)); - var oTextbox2 = new AutoSuggestControl(document.getElementById("srcbeginport_cust"), new StateSuggestions(customarray)); - var oTextbox3 = new AutoSuggestControl(document.getElementById("srcendport_cust"), new StateSuggestions(customarray)); - var oTextbox4 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray)); - var oTextbox5 = new AutoSuggestControl(document.getElementById("dstbeginport_cust"), new StateSuggestions(customarray)); - var oTextbox6 = new AutoSuggestControl(document.getElementById("dstendport_cust"), new StateSuggestions(customarray)); + var oTextbox2 = new AutoSuggestControl(document.getElementById("srcbeginport_cust"), new StateSuggestions(customarray)); + var oTextbox3 = new AutoSuggestControl(document.getElementById("srcendport_cust"), new StateSuggestions(customarray)); + var oTextbox4 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray)); + var oTextbox5 = new AutoSuggestControl(document.getElementById("dstbeginport_cust"), new StateSuggestions(customarray)); + var oTextbox6 = new AutoSuggestControl(document.getElementById("dstendport_cust"), new StateSuggestions(customarray)); //]]>
@@ -1150,7 +1149,7 @@ $i--): ?>
@@ -1226,19 +1225,19 @@ $i--): ?>

- +
> - " /> - -
-
> + " /> - +
+
>
- "; @@ -1264,7 +1263,7 @@ $i--): ?>
/>

- @@ -1288,7 +1287,7 @@ $i--): ?>
-
+