Project

General

Profile

Download (33.9 KB) Statistics
| Branch: | Tag: | Revision:
1 b2ffe419 Scott Ullrich
<?php
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4 37e2071c Scott Ullrich
	firewall_rules.php
5 e4cabb75 Scott Ullrich
	part of pfSense (http://www.pfsense.com)
6
        Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com)
7 b2ffe419 Scott Ullrich
8 e4cabb75 Scott Ullrich
	originally part of m0n0wall (http://m0n0.ch/wall)
9
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10 37e2071c Scott Ullrich
	All rights reserved.
11 b2ffe419 Scott Ullrich
12 37e2071c Scott Ullrich
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14 b2ffe419 Scott Ullrich
15 37e2071c Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17 b2ffe419 Scott Ullrich
18 37e2071c Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
19
	   notice, this list of conditions and the following disclaimer in the
20
	   documentation and/or other materials provided with the distribution.
21 b2ffe419 Scott Ullrich
22 37e2071c Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
	POSSIBILITY OF SUCH DAMAGE.
32 5b237745 Scott Ullrich
*/
33 7ac5a4cb Scott Ullrich
/*
34
	pfSense_MODULE:	filter
35
*/
36 5b237745 Scott Ullrich
37 6b07c15a Matthew Grooms
##|+PRIV
38
##|*IDENT=page-firewall-rules
39
##|*NAME=Firewall: Rules page
40
##|*DESCR=Allow access to the 'Firewall: Rules' page.
41
##|*MATCH=firewall_rules.php*
42
##|-PRIV
43
44 37e2071c Scott Ullrich
$pgtitle = array("Firewall", "Rules");
45 3cceb5d5 jim-p
$statusurl = "status_filter_reload.php";
46
$logurl = "diag_logs_filter.php";
47
48 5b237745 Scott Ullrich
require("guiconfig.inc");
49 7a927e67 Scott Ullrich
require_once("functions.inc");
50
require_once("filter.inc");
51
require_once("shaper.inc");
52 5b237745 Scott Ullrich
53 f1c49ff4 Scott Ullrich
function check_for_advaned_options(&$item) {
54
	$item_set = "";
55 a56b2fa0 pierrepomes
	if($item['max'])
56
		$item_set .= "max {$item['max']} ";
57 f1c49ff4 Scott Ullrich
	if($item['max-src-nodes'])
58
		$item_set .= "max-src-nodes {$item['max-src-nodes']} ";
59 26dd6a54 pierrepomes
	if($item['max-src-conn'])
60
		$item_set .= "max-src-conn {$item['max-src-conn']} ";
61 f1c49ff4 Scott Ullrich
	if($item['max-src-states'])
62
		$item_set .= "max-src-states {$item['max-src-states']} ";
63
	if($item['statetype'] != "keep state" && $item['statetype'] != "")
64
		$item_set .= "statetype {$item['statetype']} {$item['statetype']}";
65
	if($item['statetimeout'])
66
		$item_set .= "statetimeout {$item['statetimeout']}";
67
	if($item['nosync'])
68
		$item_set .= "nosync ";
69
	if($item['max-src-conn-rate'])
70
		$item_set .= "max-src-conn-rate {$item['max-src-conn-rate']} ";
71
	if($item['max-src-conn-rates'])
72
		$item_set .= "max-src-conn-rates {$item['max-src-conn-rates']} ";
73
	return $item_set;
74
}
75
76 00c82782 Renato Botelho
function delete_nat_association($id) {
77
	global $config;
78
79
	if (!$id || !is_array($config['nat']['rule']))
80 673d29c0 Renato Botelho
		return;
81
82 00c82782 Renato Botelho
	$a_nat = &$config['nat']['rule'];
83
84
	foreach ($a_nat as &$natent)
85
		if ($natent['associated-rule-id'] == $id)
86
			$natent['associated-rule-id'] = '';
87 673d29c0 Renato Botelho
}
88
89 5b237745 Scott Ullrich
if (!is_array($config['filter']['rule'])) {
90
	$config['filter']['rule'] = array();
91
}
92
filter_rules_sort();
93
$a_filter = &$config['filter']['rule'];
94
95 07bd3f83 Scott Ullrich
$if = $_GET['if'];
96
if ($_POST['if'])
97
	$if = $_POST['if'];
98 b2ffe419 Scott Ullrich
99 cbe3ea96 Ermal Luçi
$ifdescs = get_configured_interface_with_descr();
100 07bd3f83 Scott Ullrich
101 32c58070 Scott Ullrich
// Drag and drop reordering
102
if($_REQUEST['dragdroporder']) {
103
	// First create a new ruleset array and tmp arrays
104
	$a_filter_unorder = array();
105
	$a_filter_order = array();
106
	$a_filter_order_tmp = array();
107
	// Pointer to id of item being reordered
108
	$found = 0;
109
	$drag_order = $_REQUEST['dragtable'];
110
	// Next traverse through rules building a new order for interface
111
	for ($i = 0; isset($a_filter[$i]); $i++) {
112
		if($a_filter[$i]['interface'] <> $_REQUEST['if']) 
113
			$a_filter_unorder[] = $a_filter[$i];
114
		else 
115
			$a_filter_order_tmp[] = $a_filter[$i];
116
	}
117
	// Reorder rules with the posted order
118
	for ($i = 0; $i<count($drag_order); $i++) 
119
		$a_filter_order[] = $a_filter_order_tmp[$drag_order[$i]];
120
	unset($config['filter']['rule']);
121
	// Overwrite filter rules with newly created items
122
	$config['filter']['rule'] = $a_filter_order;
123
	foreach($a_filter_unorder as $aa) 
124
		$config['filter']['rule'][] = $aa;
125
	// Write configuration
126
	$config = write_config("Drag and drop firewall rules ordering update.");
127
	// Redirect back to page
128
	Header("Location: firewall_rules.php?if=" . $_REQUEST['if'] . "&savemsg=" . urlencode("The filter rules order has been updated."));
129
	exit;
130
}
131
132 90ba56ad Scott Ullrich
/* add group interfaces */
133
if (is_array($config['ifgroups']['ifgroupentry']))
134
	foreach($config['ifgroups']['ifgroupentry'] as $ifgen)
135
		if (have_ruleint_access($ifgen['ifname']))
136
			$iflist[$ifgen['ifname']] = $ifgen['ifname'];
137
138 aef4dc74 Ermal Luçi
foreach ($ifdescs as $ifent => $ifdesc)
139
	if(have_ruleint_access($ifent)) 
140
		$iflist[$ifent] = $ifdesc;
141 88bcd1d2 Scott Dale
142 617f8d25 Ermal Lu?i
if ($config['l2tp']['mode'] == "server")
143
        if(have_ruleint_access("l2tp"))
144
                $iflist['l2tp'] = "L2TP VPN";
145
146 07bd3f83 Scott Ullrich
if ($config['pptpd']['mode'] == "server")
147 d81c2ad1 Scott Ullrich
	if(have_ruleint_access("pptp")) 
148
		$iflist['pptp'] = "PPTP VPN";
149 50e0d2a1 Scott Ullrich
150 0e1e0183 Scott Ullrich
if ($config['pppoe']['mode'] == "server")
151 d81c2ad1 Scott Ullrich
	if(have_ruleint_access("pppoe")) 
152
		$iflist['pppoe'] = "PPPoE VPN";
153 0c554ff6 Scott Ullrich
154 88bcd1d2 Scott Dale
/* add ipsec interfaces */
155 d81c2ad1 Scott Ullrich
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))
156
	if(have_ruleint_access("enc0")) 
157 0f266b2e Chris Buechler
		$iflist["enc0"] = "IPsec";
158 07bd3f83 Scott Ullrich
159 bfb60ac8 Ermal Luçi
/* add openvpn/tun interfaces */
160 d799787e Matthew Grooms
if  ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"])
161
   	$iflist["openvpn"] = "OpenVPN";
162 bfb60ac8 Ermal Luçi
163 92125c97 Ermal Luçi
if (!$if || !isset($iflist[$if])) {
164
	if ("any" == $if)
165 15160475 Ermal Luçi
                $if = "FloatingRules";
166 92125c97 Ermal Luçi
        else if ("FloatingRules" != $if)
167
                $if = "wan";
168
}
169 07bd3f83 Scott Ullrich
170 5b237745 Scott Ullrich
if ($_POST) {
171
172
	$pconfig = $_POST;
173
174
	if ($_POST['apply']) {
175 37e2071c Scott Ullrich
		$retval = 0;
176 9a7e416c Scott Ullrich
		$retval = filter_configure();
177
178 a368a026 Ermal Lu?i
		clear_subsystem_dirty('filter');
179 a985eac2 Scott Ullrich
180 4739bd06 Scott Ullrich
		$savemsg = "The settings have been applied.  The firewall rules are now reloading in the background.  You can also <a href='status_filter_reload.php'>monitor</a> the reload progress.";
181 5b237745 Scott Ullrich
	}
182
}
183
184 d97c50cd Bill Marquette
if ($_GET['act'] == "del") {
185 673d29c0 Renato Botelho
	if ($a_filter[$_GET['id']]) {
186
		if (!empty($a_filter[$_GET['id']]['associated-rule-id'])) {
187 00c82782 Renato Botelho
			delete_nat_association($a_filter[$_GET['id']]['associated-rule-id']);
188 673d29c0 Renato Botelho
		}
189
		unset($a_filter[$_GET['id']]);
190
		write_config();
191 a368a026 Ermal Lu?i
		mark_subsystem_dirty('filter');
192 673d29c0 Renato Botelho
		header("Location: firewall_rules.php?if={$if}");
193
		exit;
194
	}
195 d97c50cd Bill Marquette
}
196
197 32c58070 Scott Ullrich
// Handle save msg if defined
198
if($_REQUEST['savemsg']) 
199
	$savemsg = htmlentities($_REQUEST['savemsg']);
200
201 07bd3f83 Scott Ullrich
if (isset($_POST['del_x'])) {
202
	/* delete selected rules */
203
	if (is_array($_POST['rule']) && count($_POST['rule'])) {
204
		foreach ($_POST['rule'] as $rulei) {
205 00c82782 Renato Botelho
			delete_nat_association($a_filter[$rulei]['associated-rule-id']);
206 07bd3f83 Scott Ullrich
			unset($a_filter[$rulei]);
207
		}
208 5b237745 Scott Ullrich
		write_config();
209 a368a026 Ermal Lu?i
		mark_subsystem_dirty('filter');
210 07bd3f83 Scott Ullrich
		header("Location: firewall_rules.php?if={$if}");
211 5b237745 Scott Ullrich
		exit;
212
	}
213 07bd3f83 Scott Ullrich
} else if ($_GET['act'] == "toggle") {
214
	if ($a_filter[$_GET['id']]) {
215 f53b85a3 Scott Ullrich
                if(isset($a_filter[$_GET['id']]['disabled']))
216 734edbdf Bill Marquette
                        unset($a_filter[$_GET['id']]['disabled']);
217
                else
218
                        $a_filter[$_GET['id']]['disabled'] = true;
219 5b237745 Scott Ullrich
		write_config();
220 a368a026 Ermal Lu?i
		mark_subsystem_dirty('filter');
221 07bd3f83 Scott Ullrich
		header("Location: firewall_rules.php?if={$if}");
222 5b237745 Scott Ullrich
		exit;
223
	}
224 07bd3f83 Scott Ullrich
} else {
225 b2ffe419 Scott Ullrich
	/* yuck - IE won't send value attributes for image buttons, while Mozilla does -
226 37e2071c Scott Ullrich
	   so we use .x/.y to fine move button clicks instead... */
227 07bd3f83 Scott Ullrich
	unset($movebtn);
228
	foreach ($_POST as $pn => $pd) {
229
		if (preg_match("/move_(\d+)_x/", $pn, $matches)) {
230
			$movebtn = $matches[1];
231
			break;
232
		}
233 5b237745 Scott Ullrich
	}
234 07bd3f83 Scott Ullrich
	/* move selected rules before this rule */
235
	if (isset($movebtn) && is_array($_POST['rule']) && count($_POST['rule'])) {
236
		$a_filter_new = array();
237 b2ffe419 Scott Ullrich
238 07bd3f83 Scott Ullrich
		/* copy all rules < $movebtn and not selected */
239
		for ($i = 0; $i < $movebtn; $i++) {
240
			if (!in_array($i, $_POST['rule']))
241
				$a_filter_new[] = $a_filter[$i];
242
		}
243 b2ffe419 Scott Ullrich
244 07bd3f83 Scott Ullrich
		/* copy all selected rules */
245
		for ($i = 0; $i < count($a_filter); $i++) {
246
			if ($i == $movebtn)
247
				continue;
248
			if (in_array($i, $_POST['rule']))
249
				$a_filter_new[] = $a_filter[$i];
250
		}
251 b2ffe419 Scott Ullrich
252 07bd3f83 Scott Ullrich
		/* copy $movebtn rule */
253
		if ($movebtn < count($a_filter))
254
			$a_filter_new[] = $a_filter[$movebtn];
255 b2ffe419 Scott Ullrich
256 07bd3f83 Scott Ullrich
		/* copy all rules > $movebtn and not selected */
257
		for ($i = $movebtn+1; $i < count($a_filter); $i++) {
258
			if (!in_array($i, $_POST['rule']))
259
				$a_filter_new[] = $a_filter[$i];
260
		}
261 b2ffe419 Scott Ullrich
262 07bd3f83 Scott Ullrich
		$a_filter = $a_filter_new;
263 5b237745 Scott Ullrich
		write_config();
264 a368a026 Ermal Lu?i
		mark_subsystem_dirty('filter');
265 07bd3f83 Scott Ullrich
		header("Location: firewall_rules.php?if={$if}");
266 5b237745 Scott Ullrich
		exit;
267
	}
268
}
269 3a54b6ca Scott Dale
$closehead = false;
270 5b237745 Scott Ullrich
271 9a25487b Scott Ullrich
include("head.inc");
272
273 3a54b6ca Scott Dale
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/domLib.js\"></script>";
274
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/domTT.js\"></script>";
275
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/behaviour.js\"></script>";
276
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/fadomatic.js\"></script>";
277 5b237745 Scott Ullrich
?>
278 3a54b6ca Scott Dale
</head>
279
280 5b237745 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
281
<?php include("fbegin.inc"); ?>
282
<form action="firewall_rules.php" method="post">
283 6dc83d52 Scott Ullrich
284 625dcc40 Bill Marquette
<script type="text/javascript" language="javascript" src="/javascript/row_toggle.js">
285 fa65a62b Scott Ullrich
</script>
286 5b237745 Scott Ullrich
<?php if ($savemsg) print_info_box($savemsg); ?>
287 a368a026 Ermal Lu?i
<?php if (is_subsystem_dirty('filter')): ?><p>
288 5b237745 Scott Ullrich
<?php print_info_box_np("The firewall rule configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
289
<?php endif; ?>
290 6dc83d52 Scott Ullrich
<div id="loading">
291
	<img src="/themes/<?=$g['theme']?>/images/misc/loader.gif"> Loading, please wait...
292
	<p/>&nbsp;
293
</div>
294 07bd3f83 Scott Ullrich
<table width="100%" border="0" cellpadding="0" cellspacing="0">
295 37e2071c Scott Ullrich
  <tr><td class="tabnavtbl">
296 0366b748 Scott Ullrich
  <?php
297
	/* active tabs */
298
	$tab_array = array();
299 92125c97 Ermal Luçi
       if ("FloatingRules" == $if)
300
                        $active = true;
301
                else
302
                        $active = false;
303 661aed33 Ermal Luçi
        $tab_array[] = array("Floating", $active, "firewall_rules.php?if=FloatingRules");
304 0366b748 Scott Ullrich
	$tabscounter = 0; $i = 0; foreach ($iflist as $ifent => $ifname) {
305
		if ($ifent == $if)
306
			$active = true;
307
		else
308
			$active = false;
309
		$tab_array[] = array($ifname, $active, "firewall_rules.php?if={$ifent}");
310
	}
311
	display_top_tabs($tab_array);
312
  ?>
313 07bd3f83 Scott Ullrich
  </td></tr>
314 b2ffe419 Scott Ullrich
  <tr>
315 d732f186 Bill Marquette
    <td>
316
	<div id="mainarea">
317
              <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
318 fa65a62b Scott Ullrich
                <tr id="frheader">
319 37e2071c Scott Ullrich
                  <td width="3%" class="list">&nbsp;</td>
320 5b237745 Scott Ullrich
                  <td width="5%" class="list">&nbsp;</td>
321 b9e28d57 unknown
                  <td width="3%" class="listhdrr">ID</td>
322 197bfe96 Ermal Luçi
                  <td width="6%" class="listhdrr">Proto</td>
323 664742f7 Renato Botelho
                  <td width="12%" class="listhdrr">Source</td>
324
                  <td width="6%" class="listhdrr">Port</td>
325
                  <td width="12%" class="listhdrr">Destination</td>
326
                  <td width="6%" class="listhdrr">Port</td>
327 197bfe96 Ermal Luçi
		  <td width="5%" class="listhdrr">Gateway</td>
328 664742f7 Renato Botelho
		  <td width="8%" class="listhdrr">Queue</td>
329 197bfe96 Ermal Luçi
		  <td width="5%" class="listhdrr">Schedule</td>
330 664742f7 Renato Botelho
                  <td width="19%" class="listhdr">Description</td>
331 d415d821 Seth Mos
                  <td width="10%" class="list">
332
			<table border="0" cellspacing="0" cellpadding="1">
333
			   <tr>
334
				<?php
335
					$nrules = 0;
336
					for ($i = 0; isset($a_filter[$i]); $i++) {
337
						$filterent = $a_filter[$i];
338 92125c97 Ermal Luçi
						if ($filterent['interface'] != $if && !isset($filterent['floating']))
339 f1c49ff4 Scott Ullrich
							continue;
340
						if (isset($filterent['floating']) && "FloatingRules" != $if)
341 d415d821 Seth Mos
							continue;
342
						$nrules++;
343
					}
344
				?>
345
				<td>
346
				<?php if ($nrules == 0): ?>
347
				<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="delete selected rules" border="0"><?php else: ?>
348
				<input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected rules" onclick="return confirm('Do you really want to delete the selected rules?')"><?php endif; ?>
349
				</td>
350
				<td align="center" valign="middle"><a href="firewall_rules_edit.php?if=<?=$if;?>&after=-1"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add new rule" width="17" height="17" border="0"></a></td>
351
			   </tr>
352
			</table>
353
		  </td>
354
		</tr>
355 f1f60c92 Ermal Luçi
<?php if (isset($config['interfaces'][$if]['blockpriv'])): ?>
356 d9eeccbd Scott Ullrich
                <tr valign="top" id="frrfc1918">
357 664742f7 Renato Botelho
                  <td class="list">&nbsp;</td>
358 f77830b3 Scott Ullrich
                  <td class="listt" align="center"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" width="11" height="11" border="0"></td>
359 b9e28d57 unknown
                  <td class="listlr" style="background-color: #e0e0e0"></td>
360
                  <td class="listr" style="background-color: #e0e0e0">*</td>
361 d9eeccbd Scott Ullrich
                  <td class="listr" style="background-color: #e0e0e0">RFC 1918 networks</td>
362
                  <td class="listr" style="background-color: #e0e0e0">*</td>
363
                  <td class="listr" style="background-color: #e0e0e0">*</td>
364
                  <td class="listr" style="background-color: #e0e0e0">*</td>
365 40ad834c Scott Dale
                  <td class="listr" style="background-color: #e0e0e0">*</td>
366 b45dcff4 Scott Ullrich
		<td class="listr" style="background-color: #e0e0e0">*</td>
367 8ff2395b Scott Ullrich
	 		 <td class="listr" style="background-color: #e0e0e0"></td>
368 c3fdc1fd Scott Ullrich
                  <td class="listbg">Block private networks</td>
369 d9eeccbd Scott Ullrich
                  <td valign="middle" nowrap class="list">
370
				    <table border="0" cellspacing="0" cellpadding="1">
371
					<tr>
372
					  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected rules before this rule"></td>
373 67d5b508 Chris Buechler
					  <td><a href="interfaces.php?if=<?=$if?>#rfc1918"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit rule" width="17" height="17" border="0"></a></td>
374 d9eeccbd Scott Ullrich
					</tr>
375
					<tr>
376
					  <td align="center" valign="middle"></td>
377 83b81db7 Scott Ullrich
					  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus_d.gif" title="add a new rule based on this one" width="17" height="17" border="0"></td>
378 d9eeccbd Scott Ullrich
					</tr>
379
					</table>
380
				  </td>
381
				</tr>
382 c20c0f5a Scott Ullrich
<?php endif; ?>
383 f1f60c92 Ermal Luçi
<?php if (isset($config['interfaces'][$if]['blockbogons'])): ?>
384 c20c0f5a Scott Ullrich
                <tr valign="top" id="frrfc1918">
385 664742f7 Renato Botelho
                  <td class="list">&nbsp;</td>
386 c20c0f5a Scott Ullrich
                  <td class="listt" align="center"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" width="11" height="11" border="0"></td>
387 b9e28d57 unknown
                  <td class="listlr" style="background-color: #e0e0e0"></td>
388
                  <td class="listr" style="background-color: #e0e0e0">*</td>
389 40ad834c Scott Dale
                  <td class="listr" style="background-color: #e0e0e0">Reserved/not assigned by IANA</td>
390 c20c0f5a Scott Ullrich
                  <td class="listr" style="background-color: #e0e0e0">*</td>
391
                  <td class="listr" style="background-color: #e0e0e0">*</td>
392
                  <td class="listr" style="background-color: #e0e0e0">*</td>
393 40ad834c Scott Dale
				  <td class="listr" style="background-color: #e0e0e0">*</td>
394
				   <td class="listr" style="background-color: #e0e0e0">*</td>
395 f1f60c92 Ermal Luçi
		  <td class="listr" style="background-color: #e0e0e0">*</td>
396 e34ecb20 Chris Buechler
                  <td class="listbg">Block bogon networks</td>
397 c20c0f5a Scott Ullrich
                  <td valign="middle" nowrap class="list">
398
				    <table border="0" cellspacing="0" cellpadding="1">
399
					<tr>
400
					  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected rules before this rule"></td>
401 67d5b508 Chris Buechler
					  <td><a href="interfaces.php?if=<?=$if?>#rfc1918"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit rule" width="17" height="17" border="0"></a></td>
402 c20c0f5a Scott Ullrich
					</tr>
403
					<tr>
404
					  <td align="center" valign="middle"></td>
405
					  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus_d.gif" title="add a new rule based on this one" width="17" height="17" border="0"></td>
406
					</tr>
407
					</table>
408
				  </td>
409
				</tr>
410
<?php endif; ?>
411 32c58070 Scott Ullrich
				<tbody id="dragtable" width="100%">
412 07bd3f83 Scott Ullrich
				<?php $nrules = 0; for ($i = 0; isset($a_filter[$i]); $i++):
413
					$filterent = $a_filter[$i];
414 92125c97 Ermal Luçi
					if ($filterent['interface'] != $if && !isset($filterent['floating']))
415 f1c49ff4 Scott Ullrich
						continue;
416
					if (isset($filterent['floating']) && "FloatingRules" != $if)
417
						continue;
418
					$isadvset = check_for_advaned_options($filterent);
419
					if($isadvset)
420 9c347273 Scott Ullrich
						$advanced_set = "<img src=\"./themes/{$g['theme']}/images/icons/icon_advanced.gif\" title=\"advanced settings set: $isadvset\" border=\"0\">";
421 f1c49ff4 Scott Ullrich
					else 
422
						$advanced_set = ""
423 07bd3f83 Scott Ullrich
				?>
424 37e2071c Scott Ullrich
                <tr valign="top" id="fr<?=$nrules;?>">
425 f1c49ff4 Scott Ullrich
                  <td class="listt">
426
					<input type="checkbox" id="frc<?=$nrules;?>" name="rule[]" value="<?=$i;?>" onClick="fr_bgcolor('<?=$nrules;?>')" style="margin: 0; padding: 0; width: 15px; height: 15px;">
427
					<?php echo $advanced_set; ?>
428
				  </td>
429 37e2071c Scott Ullrich
                  <td class="listt" align="center">
430 5b237745 Scott Ullrich
				  <?php if ($filterent['type'] == "block")
431
				  			$iconfn = "block";
432
						else if ($filterent['type'] == "reject") {
433 e91baab8 Chris Buechler
							$iconfn = "reject";
434 5b237745 Scott Ullrich
						} else
435
							$iconfn = "pass";
436
						if (isset($filterent['disabled'])) {
437
							$textss = "<span class=\"gray\">";
438
							$textse = "</span>";
439
							$iconfn .= "_d";
440
						} else {
441
							$textss = $textse = "";
442
						}
443
				  ?>
444 677c0869 Erik Kristensen
				  <a href="?if=<?=$if;?>&act=toggle&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$iconfn;?>.gif" width="11" height="11" border="0" title="click to toggle enabled/disabled status"></a>
445 5b237745 Scott Ullrich
				  <?php if (isset($filterent['log'])):
446 6fecc73b Scott Dale
							$iconfnlog = "log_s";
447 5b237745 Scott Ullrich
						if (isset($filterent['disabled']))
448 6fecc73b Scott Dale
							$iconfnlog .= "_d";
449 5b237745 Scott Ullrich
				  	?>
450 6fecc73b Scott Dale
				  <br><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$iconfnlog;?>.gif" width="11" height="15" border="0">
451 5b237745 Scott Ullrich
				  <?php endif; ?>
452
				  </td>
453 3a54b6ca Scott Dale
				<?php
454 2a9db752 Scott Dale
				
455 2a113ca9 Scott Dale
				//build Alias popup box
456 3a54b6ca Scott Dale
				$span_end = "";
457
				$alias_src_span_begin = "";
458
				$alias_src_port_span_begin = "";
459
				$alias_dst_span_begin = "";
460
				$alias_dst_port_span_begin = "";
461
				
462 2a9db752 Scott Dale
				$alias_popup = rule_popup($filterent['source']['address'],pprint_port($filterent['source']['port']),$filterent['destination']['address'],pprint_port($filterent['destination']['port']));
463
				$span_end = "</U></span>";
464 3a54b6ca Scott Dale
					
465 2a9db752 Scott Dale
				$alias_src_span_begin = $alias_popup["src"];
466
				 									
467
				$alias_src_port_span_begin = $alias_popup["srcport"];
468
													
469
				$alias_dst_span_begin = $alias_popup["dst"];
470
														
471
				$alias_dst_port_span_begin = $alias_popup["dstport"];
472 3a54b6ca Scott Dale
					
473 2a113ca9 Scott Dale
				//build Schedule popup box
474
				$a_schedules = &$config['schedules']['schedule'];
475
				$schedule_span_begin = "";
476
				$schedule_span_end = "";
477 d2aa8cd6 sullrich
				$sched_caption_escaped = "";
478 eace1363 Scott Dale
				$sched_content = "";
479 3b907eb1 Scott Dale
				$schedstatus = false;
480 2a113ca9 Scott Dale
				$dayArray = array ('Mon','Tues','Wed','Thur','Fri','Sat','Sun');
481
				$monthArray = array ('January','February','March','April','May','June','July','August','September','October','November','December');
482 8ce97a08 Scott Dale
				if($config['schedules']['schedule'] <> "" and is_array($config['schedules']['schedule'])){
483
					foreach ($a_schedules as $schedule)
484
					{
485
						if ($schedule['name'] == $filterent['sched'] ){
486 60120e37 Ermal Lu?i
							$schedstatus = filter_get_time_based_rule_status($schedule);
487 8ce97a08 Scott Dale
							
488
							foreach($schedule['timerange'] as $timerange) {
489
								$tempFriendlyTime = "";
490
								$tempID = "";
491
								$firstprint = false;
492
								if ($timerange){
493
									$dayFriendly = "";
494
									$tempFriendlyTime = "";							
495
										
496
									//get hours
497
									$temptimerange = $timerange['hour'];
498
									$temptimeseparator = strrpos($temptimerange, "-");
499 2a113ca9 Scott Dale
									
500 8ce97a08 Scott Dale
									$starttime = substr ($temptimerange, 0, $temptimeseparator); 
501
									$stoptime = substr ($temptimerange, $temptimeseparator+1); 
502 2a113ca9 Scott Dale
										
503 8ce97a08 Scott Dale
									if ($timerange['month']){
504
										$tempmontharray = explode(",", $timerange['month']);
505
										$tempdayarray = explode(",",$timerange['day']);
506
										$arraycounter = 0;
507
										$firstDayFound = false;
508
										$firstPrint = false;
509
										foreach ($tempmontharray as $monthtmp){
510
											$month = $tempmontharray[$arraycounter];
511
											$day = $tempdayarray[$arraycounter];
512 2a113ca9 Scott Dale
											
513
											if (!$firstDayFound)
514
											{
515 8ce97a08 Scott Dale
												$firstDay = $day;
516
												$firstmonth = $month;
517 2a113ca9 Scott Dale
												$firstDayFound = true;
518
											}
519 8ce97a08 Scott Dale
												
520
											$currentDay = $day;
521
											$nextDay = $tempdayarray[$arraycounter+1];
522
											$currentDay++;
523
											if (($currentDay != $nextDay) || ($tempmontharray[$arraycounter] != $tempmontharray[$arraycounter+1])){
524
												if ($firstPrint)
525 2a113ca9 Scott Dale
													$dayFriendly .= ", ";
526
												$currentDay--;
527
												if ($currentDay != $firstDay)
528 8ce97a08 Scott Dale
													$dayFriendly .= $monthArray[$firstmonth-1] . " " . $firstDay . " - " . $currentDay ;
529 2a113ca9 Scott Dale
												else
530 8ce97a08 Scott Dale
													$dayFriendly .=  $monthArray[$month-1] . " " . $day;
531 2a113ca9 Scott Dale
												$firstDayFound = false;	
532 8ce97a08 Scott Dale
												$firstPrint = true;
533
											}													
534
											$arraycounter++;	
535 2a113ca9 Scott Dale
										}
536
									}
537 8ce97a08 Scott Dale
									else
538
									{
539
										$tempdayFriendly = $timerange['position'];
540
										$firstDayFound = false;
541
										$tempFriendlyDayArray = explode(",", $tempdayFriendly);								
542
										$currentDay = "";
543
										$firstDay = "";
544
										$nextDay = "";
545
										$counter = 0;													
546
										foreach ($tempFriendlyDayArray as $day){
547
											if ($day != ""){
548
												if (!$firstDayFound)
549
												{
550
													$firstDay = $tempFriendlyDayArray[$counter];
551
													$firstDayFound = true;
552
												}
553
												$currentDay =$tempFriendlyDayArray[$counter];
554
												//get next day
555
												$nextDay = $tempFriendlyDayArray[$counter+1];
556
												$currentDay++;					
557
												if ($currentDay != $nextDay){
558
													if ($firstprint)
559
														$dayFriendly .= ", ";
560
													$currentDay--;
561
													if ($currentDay != $firstDay)
562
														$dayFriendly .= $dayArray[$firstDay-1] . " - " . $dayArray[$currentDay-1];
563
													else
564
														$dayFriendly .= $dayArray[$firstDay-1];
565
													$firstDayFound = false;	
566
													$firstprint = true;			
567
												}
568
												$counter++;
569
											}
570
										}
571
									}		
572
									$timeFriendly = $starttime . " - " . $stoptime;
573
									$description = $timerange['rangedescr'];
574
									$sched_content .= $dayFriendly . "; " . $timeFriendly . "<br>";
575
								}
576 2a113ca9 Scott Dale
							}
577 d2aa8cd6 sullrich
							$sched_caption_escaped = str_replace("'", "\'", $schedule['descr']);
578
							$schedule_span_begin = "<span style=\"cursor: help;\" onmouseover=\"domTT_activate(this, event, 'content', '<h1>{$sched_caption_escaped}</h1><p>{$sched_content}</p>', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\" onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\"><U>";
579 8ce97a08 Scott Dale
							$schedule_span_end = "</U></span>";
580 2a113ca9 Scott Dale
						}
581
					}
582
				}
583 6fecc73b Scott Dale
				$printicon = false;
584 616dd997 Scott Dale
				$alttext = "";
585
				$image = "";
586
				if (!isset($filterent['disabled'])){
587
					 if ($schedstatus) 
588
					 { 
589
					 	if ($iconfn == "block" || $iconfn == "reject")
590
					 	{
591 5b552ac7 Scott Dale
					 		$image = "icon_block";
592 616dd997 Scott Dale
					 		$alttext = "Traffic matching this rule is currently being denied";
593
					 	}
594
					 	else
595
					 	{
596 5b552ac7 Scott Dale
					 		$image = "icon_pass";
597 616dd997 Scott Dale
					 		$alttext = "Traffic matching this rule is currently being allowed";
598
					 	}
599
					 	$printicon = true;
600
					  }
601
					  else if ($filterent['sched'])
602
					  { 
603
					 	if ($iconfn == "block" || $iconfn == "reject")
604 5b552ac7 Scott Dale
					 		$image = "icon_block_d";
605 616dd997 Scott Dale
					 	else
606 5b552ac7 Scott Dale
					 		$image = "icon_block";
607 eb01fcec Ermal
					 	$alttext = "This rule is not currently active because its period has expired";
608 616dd997 Scott Dale
					 	$printicon = true;				  	
609
					  }
610
				}
611 3a54b6ca Scott Dale
				?>
612 98e29097 Bill Marquette
                  <td class="listlr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
613 b9e28d57 unknown
                    <?=$textss;?><?php if (isset($filterent['id'])) echo $filterent['id']; else echo ""; ?><?=$textse;?>
614
                  </td>
615
                  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
616 5b237745 Scott Ullrich
                    <?=$textss;?><?php if (isset($filterent['protocol'])) echo strtoupper($filterent['protocol']); else echo "*"; ?><?=$textse;?>
617
                  </td>
618 98e29097 Bill Marquette
                  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
619 3a54b6ca Scott Dale
				    <?=$textss;?><?php echo $alias_src_span_begin;?><?php echo htmlspecialchars(pprint_address($filterent['source']));?><?php echo $alias_src_span_end;?><?=$textse;?>
620 5b237745 Scott Ullrich
                  </td>
621 98e29097 Bill Marquette
                  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
622 3a54b6ca Scott Dale
                    <?=$textss;?><?php echo $alias_src_port_span_begin;?><?php echo htmlspecialchars(pprint_port($filterent['source']['port'])); ?><?php echo $alias_src_port_span_end;?><?=$textse;?>
623 5b237745 Scott Ullrich
                  </td>
624 98e29097 Bill Marquette
                  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
625 3a54b6ca Scott Dale
				    <?=$textss;?><?php echo $alias_dst_span_begin;?><?php echo htmlspecialchars(pprint_address($filterent['destination'])); ?><?php echo $alias_dst_span_end;?><?=$textse;?>
626 5b237745 Scott Ullrich
                  </td>
627 3a54b6ca Scott Dale
	              <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
628
                    <?=$textss;?><?php echo $alias_dst_port_span_begin;?><?php echo htmlspecialchars(pprint_port($filterent['destination']['port'])); ?><?php echo $alias_dst_port_span_end;?><?=$textse;?>
629 5b237745 Scott Ullrich
                  </td>
630 b504c2f8 Scott Ullrich
                  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
631 e9832b41 Bill Marquette
                    <?=$textss;?><?php if (isset($config['interfaces'][$filterent['gateway']]['descr'])) echo htmlspecialchars($config['interfaces'][$filterent['gateway']]['descr']); else  echo htmlspecialchars(pprint_port($filterent['gateway'])); ?><?=$textse;?>
632 b504c2f8 Scott Ullrich
                  </td>
633 32c58070 Scott Ullrich
				  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';"><?=$textss;?>
634 197bfe96 Ermal Luçi
                          <?php
635
							if (isset($filterent['ackqueue']) && isset($filterent['defaultqueue'])) {
636
								$desc = $filterent['ackqueue'] ;
637
							    echo "<a href=\"firewall_shaper_queues.php?queue={$filterent['ackqueue']}&action=show\">{$desc}</a>";
638
								$desc = $filterent['defaultqueue'];
639
							    echo "/<a href=\"firewall_shaper_queues.php?queue={$filterent['defaultqueue']}&action=show\">{$desc}</a>";
640
							} else if (isset($filterent['defaultqueue'])) {
641
								$desc = $filterent['defaultqueue'];
642
							    echo "<a href=\"firewall_shaper_queues.php?queue={$filterent['defaultqueue']}&action=show\">{$desc}</a>"; }
643
							else echo "none";
644
						  ?><?=$textse;?>
645
                        </td>
646 3595b631 Scott Dale
                  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';"><font color="black">
647 d3bcf522 Scott Dale
                    <?php if ($printicon) { ?><img src="./themes/<?= $g['theme']; ?>/images/icons/<?php echo $image; ?>.gif" title="<?php echo $alttext;?>" border="0"><?php } ?>&nbsp;<?=$textss;?><?php echo $schedule_span_begin;?><?=htmlspecialchars($filterent['sched']);?><?php echo $schedule_span_end; ?><?=$textse;?>
648 7738faa8 Scott Ullrich
                  </td>
649 c2a6f323 Scott Ullrich
                  <td class="listbg" onClick="fr_toggle(<?=$nrules;?>)" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';" class="descr">
650 07bd3f83 Scott Ullrich
                    <?=$textss;?><?=htmlspecialchars($filterent['descr']);?>&nbsp;<?=$textse;?>
651 5b237745 Scott Ullrich
                  </td>
652
                  <td valign="middle" nowrap class="list">
653 07bd3f83 Scott Ullrich
				    <table border="0" cellspacing="0" cellpadding="1">
654
					<tr>
655 677c0869 Erik Kristensen
					  <td><input name="move_<?=$i;?>" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title="move selected rules before this rule" onMouseOver="fr_insline(<?=$nrules;?>, true)" onMouseOut="fr_insline(<?=$nrules;?>, false)"></td>
656
					  <td><a href="firewall_rules_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit rule" width="17" height="17" border="0"></a></td>
657 07bd3f83 Scott Ullrich
					</tr>
658
					<tr>
659 1cfed9db Scott Ullrich
					  <td align="center" valign="middle"><a href="firewall_rules.php?act=del&if=<?=$if;?>&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="delete rule" onclick="return confirm('Do you really want to delete this rule?')"></a></td>
660 677c0869 Erik Kristensen
					  <td><a href="firewall_rules_edit.php?dup=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add a new rule based on this one" width="17" height="17" border="0"></a></td>
661 07bd3f83 Scott Ullrich
					</tr>
662
					</table>
663 5b237745 Scott Ullrich
				  </td>
664
				</tr>
665 07bd3f83 Scott Ullrich
			  <?php $nrules++; endfor; ?>
666 32c58070 Scott Ullrich
			  </tbody>
667 07bd3f83 Scott Ullrich
			  <?php if ($nrules == 0): ?>
668 37e2071c Scott Ullrich
              <td class="listt"></td>
669 07bd3f83 Scott Ullrich
			  <td class="listt"></td>
670 d5a1008d Scott Ullrich
			  <td class="listlr" colspan="10" align="center" valign="middle">
671 07bd3f83 Scott Ullrich
			  <span class="gray">
672
			  No rules are currently defined for this interface.<br>
673
			  All incoming connections on this interface will be blocked until you add pass rules.<br><br>
674 677c0869 Erik Kristensen
			  Click the <a href="firewall_rules_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add new rule" border="0" width="17" height="17" align="absmiddle"></a> button to add a new rule.</span>
675 07bd3f83 Scott Ullrich
			  </td>
676
			  <?php endif; ?>
677 37e2071c Scott Ullrich
                <tr id="fr<?=$nrules;?>">
678
                  <td class="list"></td>
679
                  <td class="list"></td>
680
                  <td class="list">&nbsp;</td>
681
                  <td class="list">&nbsp;</td>
682
                  <td class="list">&nbsp;</td>
683 b9e28d57 unknown
                  <td class="list">&nbsp;</td>
684 1c7e3ec6 Bill Marquette
		  <td class="list">&nbsp;</td>
685
		  <td class="list">&nbsp;</td>
686
                  <td class="list">&nbsp;</td>
687 37e2071c Scott Ullrich
                  <td class="list">&nbsp;</td>
688
                  <td class="list">&nbsp;</td>
689
                  <td class="list">&nbsp;</td>
690 07bd3f83 Scott Ullrich
                  <td class="list">
691
				    <table border="0" cellspacing="0" cellpadding="1">
692
					<tr>
693
				      <td>
694 32c58070 Scott Ullrich
					  <?php if ($nrules == 0): ?><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected rules to end" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title="move selected rules to end" onMouseOver="fr_insline(<?=$nrules;?>, true)" onMouseOut="
695
						(<?=$nrules;?>, false)"><?php endif; ?></td>
696 37e2071c Scott Ullrich
					  <td></td>
697 07bd3f83 Scott Ullrich
				    </tr>
698
					<tr>
699 3086d0f8 Scott Ullrich
					  <td>
700
					  <?php if ($nrules == 0): ?>
701
					  <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="delete selected rules" border="0"><?php else: ?>
702
					  <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected rules" onclick="return confirm('Do you really want to delete the selected rules?')"><?php endif; ?>
703
					  </td>
704 d415d821 Seth Mos
			                  <td><a href="firewall_rules_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add new rule" width="17" height="17" border="0"></a></td>
705 07bd3f83 Scott Ullrich
					</tr>
706
				    </table>
707
				  </td>
708 5b237745 Scott Ullrich
				</tr>
709
              </table>
710 d732f186 Bill Marquette
	      <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
711 b2ffe419 Scott Ullrich
                <tr>
712 677c0869 Erik Kristensen
                  <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" width="11" height="11"></td>
713 5b237745 Scott Ullrich
                  <td>pass</td>
714
                  <td width="14"></td>
715 677c0869 Erik Kristensen
                  <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" width="11" height="11"></td>
716 5b237745 Scott Ullrich
                  <td>block</td>
717
                  <td width="14"></td>
718 677c0869 Erik Kristensen
                  <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_reject.gif" width="11" height="11"></td>
719 5b237745 Scott Ullrich
                  <td>reject</td>
720
                  <td width="14"></td>
721 677c0869 Erik Kristensen
                  <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" width="11" height="11"></td>
722 5b237745 Scott Ullrich
                  <td>log</td>
723
                </tr>
724 b2ffe419 Scott Ullrich
                <tr>
725 677c0869 Erik Kristensen
                  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass_d.gif" width="11" height="11"></td>
726 d732f186 Bill Marquette
                  <td nowrap>pass (disabled)</td>
727
                  <td>&nbsp;</td>
728 677c0869 Erik Kristensen
                  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block_d.gif" width="11" height="11"></td>
729 d732f186 Bill Marquette
                  <td nowrap>block (disabled)</td>
730
                  <td>&nbsp;</td>
731 677c0869 Erik Kristensen
                  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_reject_d.gif" width="11" height="11"></td>
732 d732f186 Bill Marquette
                  <td nowrap>reject (disabled)</td>
733
                  <td>&nbsp;</td>
734 677c0869 Erik Kristensen
                  <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_log_d.gif" width="11" height="11"></td>
735 d732f186 Bill Marquette
                  <td nowrap>log (disabled)</td>
736 5b237745 Scott Ullrich
                </tr>
737 d732f186 Bill Marquette
		<tr>
738 05860c07 Scott Ullrich
		  <td colspan="10">
739 07bd3f83 Scott Ullrich
  <p>
740
  <strong><span class="red">Hint:<br>
741 37e2071c Scott Ullrich
  </span></strong>Rules are evaluated on a first-match basis (i.e.
742 b2ffe419 Scott Ullrich
  the action of the first rule to match a packet will be executed).
743
  This means that if you use block rules, you'll have to pay attention
744
  to the rule order. Everything that isn't explicitly passed is blocked
745 07bd3f83 Scott Ullrich
  by default.</p>
746 d732f186 Bill Marquette
		 </td>
747
	        </tr>
748
              </table>
749
	</div>
750
    </td>
751
  </tr>
752
</table>
753 37e2071c Scott Ullrich
  <input type="hidden" name="if" value="<?=$if;?>">
754 32c58070 Scott Ullrich
  <script type="text/javascript">
755 7abaeb1f Scott Ullrich
	var number_of_rules = <?=$nrules?>;
756 32c58070 Scott Ullrich
<?php $nrules = 0; for ($i = 0; isset($a_filter[$i]); $i++): ?>
757
	Sortable.create("dragtable", { 
758
		tag:"tr", 
759
		format:"fr([0-9999999])",
760
		containment:["dragtable"], 
761 7abaeb1f Scott Ullrich
		onChange:function(affected) {
762
			document.body.style.cursor = 'move';
763 32c58070 Scott Ullrich
		},
764 7abaeb1f Scott Ullrich
		onUpdate:function(container) { 
765
			document.body.style.cursor = 'move';
766 32c58070 Scott Ullrich
			updateOrder(Sortable.serialize('dragtable', 'tr'));
767
		} 
768
	});
769
<?php endfor; ?>
770
	function updateOrder(order) {
771 6dc83d52 Scott Ullrich
		if(document.getElementById("redboxtable"))
772
			$('redboxtable').hide();
773
		$('loading').show();
774 32c58070 Scott Ullrich
		document.body.style.cursor = 'wait';
775
		document.location = 'firewall_rules.php?if=<?=$if?>&dragdroporder=true&' + Sortable.serialize('dragtable', 'tr');
776
		return;
777
	}
778 6dc83d52 Scott Ullrich
	$('loading').hide();
779 32c58070 Scott Ullrich
  </script>
780 07bd3f83 Scott Ullrich
</form>
781 5b237745 Scott Ullrich
<?php include("fend.inc"); ?>
782 af4aa061 Scott Ullrich
</body>
783
</html>