Project

General

Profile

Download (40.1 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	firewall_rules.php
5
	part of pfSense (http://www.pfsense.com)
6
        Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com)
7

    
8
	originally part of m0n0wall (http://m0n0.ch/wall)
9
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
	All rights reserved.
11

    
12
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14

    
15
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17

    
18
	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

    
22
	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
*/
33
/*
34
	pfSense_MODULE:	filter
35
*/
36

    
37
##|+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
require("guiconfig.inc");
45
require_once("functions.inc");
46
require_once("filter.inc");
47
require_once("shaper.inc");
48

    
49
$pgtitle = array(gettext("Firewall"),gettext("Rules"));
50
$shortcut_section = "firewall";
51

    
52
function delete_nat_association($id) {
53
	global $config;
54

    
55
	if (!$id || !is_array($config['nat']['rule']))
56
		return;
57

    
58
	$a_nat = &$config['nat']['rule'];
59

    
60
	foreach ($a_nat as &$natent)
61
		if ($natent['associated-rule-id'] == $id)
62
			$natent['associated-rule-id'] = '';
63
}
64

    
65
if (!is_array($config['filter']['rule'])) {
66
	$config['filter']['rule'] = array();
67
}
68
filter_rules_sort();
69
$a_filter = &$config['filter']['rule'];
70

    
71
$if = $_GET['if'];
72
if ($_POST['if'])
73
	$if = $_POST['if'];
74

    
75
$ifdescs = get_configured_interface_with_descr();
76

    
77
// Drag and drop reordering
78
if($_REQUEST['dragdroporder']) {
79
	// First create a new ruleset array and tmp arrays
80
	$a_filter_before = array();
81
	$a_filter_order = array();
82
	$a_filter_order_tmp = array();
83
	$a_filter_after = array();
84
	$found = false;
85
	$drag_order = $_REQUEST['dragtable'];
86
	// Next traverse through rules building a new order for interface
87
	for ($i = 0; isset($a_filter[$i]); $i++) {
88
		if(( $_REQUEST['if'] == "FloatingRules" && isset($a_filter[$i]['floating']) ) || ( $a_filter[$i]['interface'] == $_REQUEST['if'] && !isset($a_filter[$i]['floating']) )) {
89
			$a_filter_order_tmp[] = $a_filter[$i];
90
			$found = true;
91
		} else if (!$found)
92
			$a_filter_before[] = $a_filter[$i];
93
		else
94
			$a_filter_after[] = $a_filter[$i];
95
	}
96
	// Reorder rules with the posted order
97
	for ($i = 0; $i<count($drag_order); $i++)
98
		$a_filter_order[] = $a_filter_order_tmp[$drag_order[$i]];
99
	// In case $drag_order didn't account for some rules, make sure we don't lose them
100
	if(count($a_filter_order) < count($a_filter_order_tmp)) {
101
		for ($i = 0; $i<count($a_filter_order_tmp); $i++)
102
			if(!in_array($i, $drag_order))
103
				$a_filter_order[] = $a_filter_order_tmp[$i];
104
	}
105
	// Overwrite filter rules with newly created items
106
	$config['filter']['rule'] = array_merge($a_filter_before, $a_filter_order, $a_filter_after);
107
	// Write configuration
108
	$config = write_config("Drag and drop firewall rules ordering update.");
109
	// Redirect back to page
110
	mark_subsystem_dirty('filter');
111
	$undo = array();
112
	foreach($_REQUEST['dragtable'] as $dt) 
113
		$undo[] = "";
114
	$counter = 0;
115
	foreach($_REQUEST['dragtable'] as $dt) {
116
		$undo[$dt] = $counter;
117
		$counter++;
118
	}
119
	foreach($undo as $dt) 
120
		$undotxt .= "&dragtable[]={$dt}";
121
	Header("Location: firewall_rules.php?if=" . $_REQUEST['if'] . "&undodrag=true" . $undotxt);
122
	exit;
123
}
124

    
125
$icmptypes = array(
126
	"" => gettext("any"),
127
	"echoreq" => gettext("Echo request"),
128
	"echorep" => gettext("Echo reply"),
129
	"unreach" => gettext("Destination unreachable"),
130
	"squench" => gettext("Source quench"),
131
	"redir" => gettext("Redirect"),
132
	"althost" => gettext("Alternate Host"),
133
	"routeradv" => gettext("Router advertisement"),
134
	"routersol" => gettext("Router solicitation"),
135
	"timex" => gettext("Time exceeded"),
136
	"paramprob" => gettext("Invalid IP header"),
137
	"timereq" => gettext("Timestamp"),
138
	"timerep" => gettext("Timestamp reply"),
139
	"inforeq" => gettext("Information request"),
140
	"inforep" => gettext("Information reply"),
141
	"maskreq" => gettext("Address mask request"),
142
	"maskrep" => gettext("Address mask reply")
143
);
144

    
145
/* add group interfaces */
146
if (is_array($config['ifgroups']['ifgroupentry']))
147
	foreach($config['ifgroups']['ifgroupentry'] as $ifgen)
148
		if (have_ruleint_access($ifgen['ifname']))
149
			$iflist[$ifgen['ifname']] = $ifgen['ifname'];
150

    
151
foreach ($ifdescs as $ifent => $ifdesc)
152
	if(have_ruleint_access($ifent)) 
153
		$iflist[$ifent] = $ifdesc;
154

    
155
if ($config['l2tp']['mode'] == "server")
156
        if(have_ruleint_access("l2tp"))
157
                $iflist['l2tp'] = "L2TP VPN";
158

    
159
if ($config['pptpd']['mode'] == "server")
160
	if(have_ruleint_access("pptp")) 
161
		$iflist['pptp'] = "PPTP VPN";
162

    
163
if (is_array($config['pppoes']['pppoe'])) {
164
	foreach ($config['pppoes']['pppoe'] as $pppoes)
165
		if (($pppoes['mode'] == 'server') && have_ruleint_access("pppoe"))
166
			$iflist['pppoe'] = "PPPoE Server";
167
}
168

    
169
/* add ipsec interfaces */
170
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']))
171
	if(have_ruleint_access("enc0")) 
172
		$iflist["enc0"] = "IPsec";
173

    
174
/* add openvpn/tun interfaces */
175
if  ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"])
176
   	$iflist["openvpn"] = "OpenVPN";
177

    
178
pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/interfaces_override");
179

    
180
if (!$if || !isset($iflist[$if])) {
181
	if ("any" == $if)
182
                $if = "FloatingRules";
183
        else if ("FloatingRules" != $if) {
184
		if (isset($iflist['wan']))
185
			$if = "wan";
186
		else
187
			$if = "FloatingRules";
188
	}
189
}
190

    
191
if ($_POST) {
192

    
193
	$pconfig = $_POST;
194

    
195
	if ($_POST['apply']) {
196
		$retval = 0;
197
		$retval = filter_configure();
198

    
199
		clear_subsystem_dirty('filter');
200

    
201
		pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/apply");
202

    
203
		$savemsg = sprintf(gettext("The settings have been applied. The firewall rules are now reloading in the background.<br/>You can also %s monitor %s the reload progress"),"<a href='status_filter_reload.php'>","</a>");
204
	}
205
}
206

    
207
if ($_GET['act'] == "del") {
208
	if ($a_filter[$_GET['id']]) {
209
		if (!empty($a_filter[$_GET['id']]['associated-rule-id'])) {
210
			delete_nat_association($a_filter[$_GET['id']]['associated-rule-id']);
211
		}
212
		unset($a_filter[$_GET['id']]);
213
		if (write_config())
214
			mark_subsystem_dirty('filter');
215
		header("Location: firewall_rules.php?if=" . htmlspecialchars($if));
216
		exit;
217
	}
218
}
219

    
220
// Handle save msg if defined
221
if($_REQUEST['savemsg']) 
222
	$savemsg = htmlentities($_REQUEST['savemsg']);
223

    
224
if (isset($_POST['del_x'])) {
225
	/* delete selected rules */
226
	if (is_array($_POST['rule']) && count($_POST['rule'])) {
227
		foreach ($_POST['rule'] as $rulei) {
228
			delete_nat_association($a_filter[$rulei]['associated-rule-id']);
229
			unset($a_filter[$rulei]);
230
		}
231
		if (write_config())
232
			mark_subsystem_dirty('filter');
233
		header("Location: firewall_rules.php?if=" . htmlspecialchars($if));
234
		exit;
235
	}
236
} else if ($_GET['act'] == "toggle") {
237
	if ($a_filter[$_GET['id']]) {
238
                if(isset($a_filter[$_GET['id']]['disabled']))
239
                        unset($a_filter[$_GET['id']]['disabled']);
240
                else
241
                        $a_filter[$_GET['id']]['disabled'] = true;
242
		if (write_config())
243
			mark_subsystem_dirty('filter');
244
		header("Location: firewall_rules.php?if=" . htmlspecialchars($if));
245
		exit;
246
	}
247
} else {
248
	/* yuck - IE won't send value attributes for image buttons, while Mozilla does -
249
	   so we use .x/.y to fine move button clicks instead... */
250
	unset($movebtn);
251
	foreach ($_POST as $pn => $pd) {
252
		if (preg_match("/move_(\d+)_x/", $pn, $matches)) {
253
			$movebtn = $matches[1];
254
			break;
255
		}
256
	}
257
	/* move selected rules before this rule */
258
	if (isset($movebtn) && is_array($_POST['rule']) && count($_POST['rule'])) {
259
		$a_filter_new = array();
260

    
261
		/* copy all rules < $movebtn and not selected */
262
		for ($i = 0; $i < $movebtn; $i++) {
263
			if (!in_array($i, $_POST['rule']))
264
				$a_filter_new[] = $a_filter[$i];
265
		}
266

    
267
		/* copy all selected rules */
268
		for ($i = 0; $i < count($a_filter); $i++) {
269
			if ($i == $movebtn)
270
				continue;
271
			if (in_array($i, $_POST['rule']))
272
				$a_filter_new[] = $a_filter[$i];
273
		}
274

    
275
		/* copy $movebtn rule */
276
		if ($movebtn < count($a_filter))
277
			$a_filter_new[] = $a_filter[$movebtn];
278

    
279
		/* copy all rules > $movebtn and not selected */
280
		for ($i = $movebtn+1; $i < count($a_filter); $i++) {
281
			if (!in_array($i, $_POST['rule']))
282
				$a_filter_new[] = $a_filter[$i];
283
		}
284

    
285
		$a_filter = $a_filter_new;
286
		if (write_config())
287
			mark_subsystem_dirty('filter');
288
		header("Location: firewall_rules.php?if=" . htmlspecialchars($if));
289
		exit;
290
	}
291
}
292
$closehead = false;
293

    
294
include("head.inc");
295
?>
296
<link rel="stylesheet" href="/javascript/chosen/chosen.css" />
297
</head>
298

    
299
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
300
<script src="/javascript/chosen/chosen.jquery.js" type="text/javascript"></script>
301
<?php include("fbegin.inc"); ?>
302
<form action="firewall_rules.php" method="post">
303

    
304
<script type="text/javascript" language="javascript" src="/javascript/row_toggle.js">
305
</script>
306
<?php if ($savemsg) print_info_box($savemsg); ?>
307
<?php if (is_subsystem_dirty('filter')): ?><p>
308
<?php
309
if($_REQUEST['undodrag']) {
310
	foreach($_REQUEST['dragtable'] as $dt) 
311
		$dragtable .= "&dragtable[]={$dt}";
312
	print_info_box_np_undo(gettext("The firewall rule configuration has been changed.<br>You must apply the changes in order for them to take effect."), "apply" , gettext("Apply changes") , "firewall_rules.php?if={$_REQUEST['if']}&dragdroporder=true&{$dragtable}");
313
} else {
314
	print_info_box_np(gettext("The firewall rule configuration has been changed.<br>You must apply the changes in order for them to take effect."));
315
}
316
?>
317
<br>
318
<?php endif; ?>
319
<div id="loading" style="visibity:hidden">
320
	<img src="/themes/<?=$g['theme']?>/images/misc/loader.gif"> Loading, please wait...
321
	<p/>&nbsp;
322
</div>
323
<?php
324
	pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/before_table");
325
?>
326
<table width="100%" border="0" cellpadding="0" cellspacing="0">
327
  <tr><td class="tabnavtbl">
328
  <?php
329
	/* active tabs */
330
	$tab_array = array();
331
       if ("FloatingRules" == $if)
332
                        $active = true;
333
                else
334
                        $active = false;
335
        $tab_array[] = array(gettext("Floating"), $active, "firewall_rules.php?if=FloatingRules");
336
	$tabscounter = 0; $i = 0; foreach ($iflist as $ifent => $ifname) {
337
		if ($ifent == $if)
338
			$active = true;
339
		else
340
			$active = false;
341
		$tab_array[] = array($ifname, $active, "firewall_rules.php?if={$ifent}");
342
	}
343
	display_top_tabs($tab_array);
344
  ?>
345
  </td></tr>
346
  <tr>
347
    <td>
348
	<div id="mainarea">
349
		<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
350
<?php
351
		pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/before_first_tr");
352
?>
353
			<tr id="frheader">
354
			<td width="3%" class="list">&nbsp;</td>
355
			<td width="5%" class="list">&nbsp;</td>
356
			<td width="3%" class="listhdrr"><?=gettext("ID");?></td>
357
<?php
358
				pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_id_tablehead");
359
?>
360
			<td width="6%" class="listhdrr"><?=gettext("Proto");?></td>
361
			<td width="12%" class="listhdrr"><?=gettext("Source");?></td>
362
			<td width="6%" class="listhdrr"><?=gettext("Port");?></td>
363
			<td width="12%" class="listhdrr"><?=gettext("Destination");?></td>
364
			<td width="6%" class="listhdrr"><?=gettext("Port");?></td>
365
			<td width="5%" class="listhdrr"><?=gettext("Gateway");?></td>
366
			<td width="8%" class="listhdrr"><?=gettext("Queue");?></td>
367
			<td width="5%" class="listhdrr"><?=gettext("Schedule");?></td>
368
<?php
369
				pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_desc_tablehead");
370
?>
371
			<td width="19%" class="listhdr"><?=gettext("Description");?></td>
372
			<td width="10%" class="list">
373
			<table border="0" cellspacing="0" cellpadding="1">
374
			   <tr>
375
				<?php
376
					$nrules = 0;
377
					for ($i = 0; isset($a_filter[$i]); $i++) {
378
						$filterent = $a_filter[$i];
379
						if ($filterent['interface'] != $if && !isset($filterent['floating']))
380
							continue;
381
						if (isset($filterent['floating']) && "FloatingRules" != $if)
382
							continue;
383
						$nrules++;
384
					}
385
				?>
386
				<td>
387
				<?php if ($nrules == 0): ?>
388
				<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?gettext("delete selected rules"); ?>" border="0"><?php else: ?>
389
				<input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" onclick="return confirm('<?=gettext('Do you really want to delete the selected rules?');?>')"><?php endif; ?>
390
				</td>
391
				<td align="center" valign="middle"><a href="firewall_rules_edit.php?if=<?=htmlspecialchars($if);?>&after=-1"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add new rule");?>" width="17" height="17" border="0"></a></td>
392
			   </tr>
393
			</table>
394
		  </td>
395
		</tr>
396
<?php   // Show the anti-lockout rule if it's enabled, and we are on LAN with an if count > 1, or WAN with an if count of 1.
397
	if (!isset($config['system']['webgui']['noantilockout']) &&
398
		(((count($config['interfaces']) > 1) && ($if == 'lan'))
399
		|| ((count($config['interfaces']) == 1) && ($if == 'wan')))):
400

    
401
		$alports = implode('<br/>', filter_get_antilockout_ports(true));
402
?>
403
		<tr valign="top" id="antilockout">
404
			<td class="list">&nbsp;</td>
405
			<td class="listt" align="center"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" width="11" height="11" border="0"></td>
406
			<td class="listlr" style="background-color: #E0E0E0">&nbsp;</td>
407
<?php
408
				pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_id_tr_antilockout");
409
?>
410
			<td class="listr" style="background-color: #E0E0E0">*</td>
411
			<td class="listr" style="background-color: #E0E0E0">*</td>
412
			<td class="listr" style="background-color: #E0E0E0">*</td>
413
			<td class="listr" style="background-color: #E0E0E0"><?=$iflist[$if];?> Address</td>
414
			<td class="listr" style="background-color: #E0E0E0"><?= $alports ?></td>
415
			<td class="listr" style="background-color: #E0E0E0">*</td>
416
			<td class="listr" style="background-color: #E0E0E0">*</td>
417
			<td class="listr" style="background-color: #E0E0E0">&nbsp;</td>
418
			<td class="listbg"><?=gettext("Anti-Lockout Rule");?></td>
419
			<td valign="middle" nowrap class="list">
420
			<table border="0" cellspacing="0" cellpadding="1">
421
				<tr>
422
					<td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected rules before this rule");?>"></td>
423
					<td><a href="system_advanced_admin.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit rule");?>" width="17" height="17" border="0"></a></td>
424
				</tr>
425
				<tr>
426
					<td align="center" valign="middle"></td>
427
					<td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus_d.gif" title="<?=gettext("add a new rule based on this one");?>" width="17" height="17" border="0"></td>
428
				</tr>
429
				</table>
430
			</td>
431
			</tr>
432
<?php endif; ?>
433

    
434
<?php if (isset($config['interfaces'][$if]['blockpriv'])): ?>
435
                <tr valign="top" id="frrfc1918">
436
                  <td class="list">&nbsp;</td>
437
                  <td class="listt" align="center"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" width="11" height="11" border="0"></td>
438
                  <td class="listlr" style="background-color: #E0E0E0">&nbsp;</td>
439
                  <td class="listr" style="background-color: #E0E0E0">*</td>
440
                  <td class="listr" style="background-color: #E0E0E0"><?=gettext("RFC 1918 networks");?></td>
441
                  <td class="listr" style="background-color: #E0E0E0">*</td>
442
                  <td class="listr" style="background-color: #E0E0E0">*</td>
443
                  <td class="listr" style="background-color: #E0E0E0">*</td>
444
                  <td class="listr" style="background-color: #E0E0E0">*</td>
445
		<td class="listr" style="background-color: #E0E0E0">*</td>
446
	 		 <td class="listr" style="background-color: #E0E0E0">&nbsp;</td>
447
                  <td class="listbg"><?=gettext("Block private networks");?></td>
448
                  <td valign="middle" nowrap class="list">
449
				    <table border="0" cellspacing="0" cellpadding="1">
450
					<tr>
451
					  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected rules before this rule");?>"></td>
452
					  <td><a href="interfaces.php?if=<?=htmlspecialchars($if)?>#rfc1918"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit rule");?>" width="17" height="17" border="0"></a></td>
453
					</tr>
454
					<tr>
455
					  <td align="center" valign="middle"></td>
456
					  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus_d.gif" title="<?=gettext("add a new rule based on this one");?>" width="17" height="17" border="0"></td>
457
					</tr>
458
					</table>
459
				  </td>
460
				</tr>
461
<?php endif; ?>
462
<?php if (isset($config['interfaces'][$if]['blockbogons'])): ?>
463
                <tr valign="top" id="frrfc1918">
464
                  <td class="list">&nbsp;</td>
465
                  <td class="listt" align="center"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" width="11" height="11" border="0"></td>
466
                  <td class="listlr" style="background-color: #E0E0E0">&nbsp;</td>
467
                  <td class="listr" style="background-color: #E0E0E0">*</td>
468
                  <td class="listr" style="background-color: #E0E0E0"><?=gettext("Reserved/not assigned by IANA");?></td>
469
                  <td class="listr" style="background-color: #E0E0E0">*</td>
470
                  <td class="listr" style="background-color: #E0E0E0">*</td>
471
                  <td class="listr" style="background-color: #E0E0E0">*</td>
472
				  <td class="listr" style="background-color: #E0E0E0">*</td>
473
				   <td class="listr" style="background-color: #E0E0E0">*</td>
474
		  <td class="listr" style="background-color: #E0E0E0">*</td>
475
                  <td class="listbg"><?=gettext("Block bogon networks");?></td>
476
                  <td valign="middle" nowrap class="list">
477
				    <table border="0" cellspacing="0" cellpadding="1">
478
					<tr>
479
					  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected rules before this rule");?>"></td>
480
					  <td><a href="interfaces.php?if=<?=htmlspecialchars($if)?>#rfc1918"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit rule");?>" width="17" height="17" border="0"></a></td>
481
					</tr>
482
					<tr>
483
					  <td align="center" valign="middle"></td>
484
					  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus_d.gif" title="<?=gettext("add a new rule based on this one");?>" width="17" height="17" border="0"></td>
485
					</tr>
486
					</table>
487
				  </td>
488
				</tr>
489
<?php endif; ?>
490
				<tbody id="dragtable" width="100%">
491
				<?php $nrules = 0; for ($i = 0; isset($a_filter[$i]); $i++):
492
					pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/row_start");
493
					$filterent = $a_filter[$i];
494
					if ($filterent['interface'] != $if && !isset($filterent['floating']))
495
						continue;
496
					if (isset($filterent['floating']) && "FloatingRules" != $if)
497
						continue;
498
					$isadvset = firewall_check_for_advanced_options($filterent);
499
					if($isadvset)
500
						$advanced_set = "<img src=\"./themes/{$g['theme']}/images/icons/icon_advanced.gif\" title=\"" . gettext("advanced settings set") . ": {$isadvset}\" border=\"0\">";
501
					else 
502
						$advanced_set = "";
503
				?>
504
                <tr valign="top" id="fr<?=$nrules;?>">
505
                  <td class="listt">
506
					<input type="checkbox" id="frc<?=$nrules;?>" name="rule[]" value="<?=$i;?>" onClick="fr_bgcolor('<?=$nrules;?>')" style="margin: 0; padding: 0; width: 15px; height: 15px;">
507
					<?php echo $advanced_set; ?>
508
				  </td>
509
                  <td class="listt" align="center">
510
				  <?php if ($filterent['type'] == "block")
511
				  			$iconfn = "block";
512
						else if ($filterent['type'] == "reject") {
513
							$iconfn = "reject";
514
						} else
515
							$iconfn = "pass";
516
						if (isset($filterent['disabled'])) {
517
							$textss = "<span class=\"gray\">";
518
							$textse = "</span>";
519
							$iconfn .= "_d";
520
						} else {
521
							$textss = $textse = "";
522
						}
523
				  ?>
524
				  <a href="?if=<?=htmlspecialchars($if);?>&act=toggle&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$iconfn;?>.gif" width="11" height="11" border="0" title="<?=gettext("click to toggle enabled/disabled status");?>"></a>
525
				  <?php if (isset($filterent['log'])):
526
							$iconfnlog = "log_s";
527
						if (isset($filterent['disabled']))
528
							$iconfnlog .= "_d";
529
				  	?>
530
				  <br><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$iconfnlog;?>.gif" width="11" height="15" border="0">
531
				  <?php endif; ?>
532
				  </td>
533
				<?php
534
				
535
				//build Alias popup box
536
				$alias_src_span_begin = "";
537
				$alias_src_port_span_begin = "";
538
				$alias_dst_span_begin = "";
539
				$alias_dst_port_span_begin = "";
540
				
541
				$alias_popup = rule_popup($filterent['source']['address'],pprint_port($filterent['source']['port']),$filterent['destination']['address'],pprint_port($filterent['destination']['port']));
542
					
543
				$alias_src_span_begin = $alias_popup["src"];
544
				$alias_src_port_span_begin = $alias_popup["srcport"];
545
				$alias_dst_span_begin = $alias_popup["dst"];
546
				$alias_dst_port_span_begin = $alias_popup["dstport"];
547
					
548
				$alias_src_span_end = $alias_popup["src_end"];
549
				$alias_src_port_span_end = $alias_popup["srcport_end"];
550
				$alias_dst_span_end = $alias_popup["dst_end"];
551
				$alias_dst_port_span_end = $alias_popup["dstport_end"];
552
					
553
				//build Schedule popup box
554
				$a_schedules = &$config['schedules']['schedule'];
555
				$schedule_span_begin = "";
556
				$schedule_span_end = "";
557
				$sched_caption_escaped = "";
558
				$sched_content = "";
559
				$schedstatus = false;
560
				$dayArray = array (gettext('Mon'),gettext('Tues'),gettext('Wed'),gettext('Thur'),gettext('Fri'),gettext('Sat'),gettext('Sun'));
561
				$monthArray = array (gettext('January'),gettext('February'),gettext('March'),gettext('April'),gettext('May'),gettext('June'),gettext('July'),gettext('August'),gettext('September'),gettext('October'),gettext('November'),gettext('December'));
562
				if($config['schedules']['schedule'] <> "" and is_array($config['schedules']['schedule'])) {
563
					foreach ($a_schedules as $schedule)
564
					{
565
						if ($schedule['name'] == $filterent['sched'] ){
566
							$schedstatus = filter_get_time_based_rule_status($schedule);
567
							
568
							foreach($schedule['timerange'] as $timerange) {
569
								$tempFriendlyTime = "";
570
								$tempID = "";
571
								$firstprint = false;
572
								if ($timerange){
573
									$dayFriendly = "";
574
									$tempFriendlyTime = "";							
575
										
576
									//get hours
577
									$temptimerange = $timerange['hour'];
578
									$temptimeseparator = strrpos($temptimerange, "-");
579
									
580
									$starttime = substr ($temptimerange, 0, $temptimeseparator); 
581
									$stoptime = substr ($temptimerange, $temptimeseparator+1); 
582
										
583
									if ($timerange['month']){
584
										$tempmontharray = explode(",", $timerange['month']);
585
										$tempdayarray = explode(",",$timerange['day']);
586
										$arraycounter = 0;
587
										$firstDayFound = false;
588
										$firstPrint = false;
589
										foreach ($tempmontharray as $monthtmp){
590
											$month = $tempmontharray[$arraycounter];
591
											$day = $tempdayarray[$arraycounter];
592
											
593
											if (!$firstDayFound)
594
											{
595
												$firstDay = $day;
596
												$firstmonth = $month;
597
												$firstDayFound = true;
598
											}
599
												
600
											$currentDay = $day;
601
											$nextDay = $tempdayarray[$arraycounter+1];
602
											$currentDay++;
603
											if (($currentDay != $nextDay) || ($tempmontharray[$arraycounter] != $tempmontharray[$arraycounter+1])){
604
												if ($firstPrint)
605
													$dayFriendly .= ", ";
606
												$currentDay--;
607
												if ($currentDay != $firstDay)
608
													$dayFriendly .= $monthArray[$firstmonth-1] . " " . $firstDay . " - " . $currentDay ;
609
												else
610
													$dayFriendly .=  $monthArray[$month-1] . " " . $day;
611
												$firstDayFound = false;	
612
												$firstPrint = true;
613
											}													
614
											$arraycounter++;	
615
										}
616
									}
617
									else
618
									{
619
										$tempdayFriendly = $timerange['position'];
620
										$firstDayFound = false;
621
										$tempFriendlyDayArray = explode(",", $tempdayFriendly);								
622
										$currentDay = "";
623
										$firstDay = "";
624
										$nextDay = "";
625
										$counter = 0;													
626
										foreach ($tempFriendlyDayArray as $day){
627
											if ($day != ""){
628
												if (!$firstDayFound)
629
												{
630
													$firstDay = $tempFriendlyDayArray[$counter];
631
													$firstDayFound = true;
632
												}
633
												$currentDay =$tempFriendlyDayArray[$counter];
634
												//get next day
635
												$nextDay = $tempFriendlyDayArray[$counter+1];
636
												$currentDay++;					
637
												if ($currentDay != $nextDay){
638
													if ($firstprint)
639
														$dayFriendly .= ", ";
640
													$currentDay--;
641
													if ($currentDay != $firstDay)
642
														$dayFriendly .= $dayArray[$firstDay-1] . " - " . $dayArray[$currentDay-1];
643
													else
644
														$dayFriendly .= $dayArray[$firstDay-1];
645
													$firstDayFound = false;	
646
													$firstprint = true;			
647
												}
648
												$counter++;
649
											}
650
										}
651
									}		
652
									$timeFriendly = $starttime . " - " . $stoptime;
653
									$description = $timerange['rangedescr'];
654
									$sched_content .= $dayFriendly . "; " . $timeFriendly . "<br>";
655
								}
656
							}
657
							$sched_caption_escaped = str_replace("'", "\'", $schedule['descr']);
658
							$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>";
659
							$schedule_span_end = "</u></span>";
660
						}
661
					}
662
				}
663
				$printicon = false;
664
				$alttext = "";
665
				$image = "";
666
				if (!isset($filterent['disabled'])){
667
					 if ($schedstatus) 
668
					 { 
669
					 	if ($iconfn == "block" || $iconfn == "reject")
670
					 	{
671
					 		$image = "icon_block";
672
					 		$alttext = gettext("Traffic matching this rule is currently being denied");
673
					 	}
674
					 	else
675
					 	{
676
					 		$image = "icon_pass";
677
					 		$alttext = gettext("Traffic matching this rule is currently being allowed");
678
					 	}
679
					 	$printicon = true;
680
					  }
681
					  else if ($filterent['sched'])
682
					  { 
683
					 	if ($iconfn == "block" || $iconfn == "reject")
684
					 		$image = "icon_block_d";
685
					 	else
686
					 		$image = "icon_block";
687
					 	$alttext = gettext("This rule is not currently active because its period has expired");
688
					 	$printicon = true;				  	
689
					  }
690
				}
691
				?>
692
                  <td class="listlr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
693
                    <?=$textss;?><?php if (isset($filterent['id'])) echo $filterent['id']."&nbsp;"; else echo "&nbsp;"; ?><?=$textse;?>
694
                  </td>
695
<?php
696
				pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_id_tr");
697
?>
698
                  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
699
                    <?=$textss;?><?php
700
			if (isset($filterent['ipprotocol'])) {
701
				switch($filterent['ipprotocol']) {
702
					case "inet":
703
						echo "IPv4 ";
704
						break;
705
					case "inet6":
706
						echo "IPv6 ";
707
						break;
708
					case "inet46":
709
						echo "IPv4+6 ";
710
						break;
711
				}
712
			} else {
713
				echo "IPv4 ";
714
			}
715
			if (isset($filterent['protocol'])) {
716
				echo strtoupper($filterent['protocol']);
717
				if (strtoupper($filterent['protocol']) == "ICMP" && !empty($filterent['icmptype'])) {
718
					echo ' <span style="cursor: help;" title="ICMP type: ' . $icmptypes[$filterent['icmptype']] . '"><u>';
719
					echo $filterent['icmptype'];
720
					echo '</u></span>';
721
				}
722
			} else echo "*";
723
                    ?><?=$textse;?>
724
                  </td>
725
                  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
726
				    <?=$textss;?><?php echo $alias_src_span_begin;?><?php echo htmlspecialchars(pprint_address($filterent['source']));?><?php echo $alias_src_span_end;?><?=$textse;?>
727
                  </td>
728
                  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
729
                    <?=$textss;?><?php echo $alias_src_port_span_begin;?><?php echo htmlspecialchars(pprint_port($filterent['source']['port'])); ?><?php echo $alias_src_port_span_end;?><?=$textse;?>
730
                  </td>
731
                  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
732
				    <?=$textss;?><?php echo $alias_dst_span_begin;?><?php echo htmlspecialchars(pprint_address($filterent['destination'])); ?><?php echo $alias_dst_span_end;?><?=$textse;?>
733
                  </td>
734
	              <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
735
                    <?=$textss;?><?php echo $alias_dst_port_span_begin;?><?php echo htmlspecialchars(pprint_port($filterent['destination']['port'])); ?><?php echo $alias_dst_port_span_end;?><?=$textse;?>
736
                  </td>
737
                  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
738
                    <?=$textss;?><?php if (isset($config['interfaces'][$filterent['gateway']]['descr'])) echo htmlspecialchars($config['interfaces'][$filterent['gateway']]['descr']); else  echo htmlspecialchars(pprint_port($filterent['gateway'])); ?><?=$textse;?>
739
                  </td>
740
				  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';"><?=$textss;?>
741
                          <?php
742
							if (isset($filterent['ackqueue']) && isset($filterent['defaultqueue'])) {
743
								$desc = $filterent['ackqueue'] ;
744
							    echo "<a href=\"firewall_shaper_queues.php?queue={$filterent['ackqueue']}&action=show\">{$desc}</a>";
745
								$desc = $filterent['defaultqueue'];
746
							    echo "/<a href=\"firewall_shaper_queues.php?queue={$filterent['defaultqueue']}&action=show\">{$desc}</a>";
747
							} else if (isset($filterent['defaultqueue'])) {
748
								$desc = $filterent['defaultqueue'];
749
							    echo "<a href=\"firewall_shaper_queues.php?queue={$filterent['defaultqueue']}&action=show\">{$desc}</a>"; }
750
							else echo gettext("none");
751
						  ?><?=$textse;?>
752
                        </td>
753
                  <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';"><font color="black">
754
                    <?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;?>
755
                  </td>
756
<?php
757
				pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_descr_tr");
758
?>
759
                  <td class="listbg" onClick="fr_toggle(<?=$nrules;?>)" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';" class="descr">
760
                    <?=$textss;?><?=htmlspecialchars($filterent['descr']);?>&nbsp;<?=$textse;?>
761
                  </td>
762
                  <td valign="middle" nowrap class="list">
763
				    <table border="0" cellspacing="0" cellpadding="1">
764
					<tr>
765
					  <td><input name="move_<?=$i;?>" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title="<?=gettext("move selected rules before this rule"); ?>" onMouseOver="fr_insline(<?=$nrules;?>, true)" onMouseOut="fr_insline(<?=$nrules;?>, false)"></td>
766
					  <td><a href="firewall_rules_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit rule"); ?>" width="17" height="17" border="0"></a></td>
767
					</tr>
768
					<tr>
769
					  <td align="center" valign="middle"><a href="firewall_rules.php?act=del&if=<?=htmlspecialchars($if);?>&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule"); ?>" onclick="return confirm('Do you really want to delete this rule?')"></a></td>
770
					  <td><a href="firewall_rules_edit.php?dup=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add a new rule based on this one"); ?>" width="17" height="17" border="0"></a></td>
771
					</tr>
772
					</table>
773
				  </td>
774
				</tr>
775
			  <?php $nrules++; endfor; ?>
776
			  </tbody>
777
			  <?php if ($nrules == 0): ?>
778
              <td class="listt"></td>
779
			  <td class="listt"></td>
780
			  <td class="listlr" colspan="10" align="center" valign="middle">
781
			  <span class="gray">
782
			<?php if ($_REQUEST['if'] == "FloatingRules"): ?>
783
			  <?=gettext("No floating rules are currently defined."); ?><br/><br/>
784
			<?php else: ?>
785
			  <?=gettext("No rules are currently defined for this interface"); ?><br/>
786
			  <?=gettext("All incoming connections on this interface will be blocked until you add pass rules."); ?><br/><br/>
787
			<?php endif; ?>
788
			  <?=gettext("Click the"); ?> <a href="firewall_rules_edit.php?if=<?=htmlspecialchars($if);?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add new rule");?>" border="0" width="17" height="17" align="absmiddle"></a><?=gettext(" button to add a new rule.");?></span>
789
			  </td>
790
			  <?php endif; ?>
791
                <tr id="fr<?=$nrules;?>">
792
                  <td class="list"></td>
793
                  <td class="list"></td>
794
<?php
795
				pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_id_tr_belowtable");
796
?>
797
                  <td class="list">&nbsp;</td>
798
                  <td class="list">&nbsp;</td>
799
                  <td class="list">&nbsp;</td>
800
                  <td class="list">&nbsp;</td>
801
		  <td class="list">&nbsp;</td>
802
		  <td class="list">&nbsp;</td>
803
                  <td class="list">&nbsp;</td>
804
                  <td class="list">&nbsp;</td>
805
                  <td class="list">&nbsp;</td>
806
                  <td class="list">&nbsp;</td>
807
                  <td class="list">
808
				    <table border="0" cellspacing="0" cellpadding="1">
809
					<tr>
810
				      <td>
811
					  <?php if ($nrules == 0): ?><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("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="<?=gettext("move selected rules to end");?>" onMouseOver="fr_insline(<?=$nrules;?>, true)" onMouseOut="fr_insline(<?=$nrules;?>, false)"><?php endif; ?></td>
812
					  <td></td>
813
				    </tr>
814
					<tr>
815
					  <td>
816
					  <?php if ($nrules == 0): ?>
817
					  <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0"><?php else: ?>
818
					  <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" onclick="return confirm('<?=gettext('Do you really want to delete the selected rules?');?>')"><?php endif; ?>
819
					  </td>
820
			                  <td><a href="firewall_rules_edit.php?if=<?=htmlspecialchars($if);?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add new rule");?>" width="17" height="17" border="0"></a></td>
821
					</tr>
822
				    </table>
823
				  </td>
824
				</tr>
825
              </table>
826
	      <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
827
                <tr>
828
                  <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" width="11" height="11"></td>
829
                  <td><?=gettext("pass");?></td>
830
                  <td width="14"></td>
831
                  <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" width="11" height="11"></td>
832
                  <td><?=gettext("block");?></td>
833
                  <td width="14"></td>
834
                  <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_reject.gif" width="11" height="11"></td>
835
                  <td><?=gettext("reject");?></td>
836
                  <td width="14"></td>
837
                  <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" width="11" height="11"></td>
838
                  <td><?=gettext("log");?></td>
839
                </tr>
840
                <tr>
841
                  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass_d.gif" width="11" height="11"></td>
842
                  <td nowrap><?=gettext("pass (disabled)");?></td>
843
                  <td>&nbsp;</td>
844
                  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block_d.gif" width="11" height="11"></td>
845
                  <td nowrap><?=gettext("block (disabled)");?></td>
846
                  <td>&nbsp;</td>
847
                  <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_reject_d.gif" width="11" height="11"></td>
848
                  <td nowrap><?=gettext("reject (disabled)");?></td>
849
                  <td>&nbsp;</td>
850
                  <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_log_d.gif" width="11" height="11"></td>
851
                  <td nowrap><?=gettext("log (disabled)");?></td>
852
                </tr>
853
		<tr>
854
		  <td colspan="10">
855
  &nbsp;<p/>
856
  <strong>
857
	<span class="red"><?=gettext("Hint:");?></span>
858
  </strong><br>
859
	<ul>
860
<? if ("FloatingRules" != $if): ?>
861
	<li><?=gettext("Rules are evaluated on a first-match basis (i.e. " .
862
	"the action of the first rule to match a packet will be executed). " .
863
	"This means that if you use block rules, you'll have to pay attention " .
864
	"to the rule order. Everything that isn't explicitly passed is blocked " .
865
	"by default. ");?>
866
	</li>
867
<? else: ?>
868
	<li><?=gettext("Floating rules are evaluated on a first-match basis (i.e. " .
869
	"the action of the first rule to match a packet will be executed) only " .
870
	"if the 'quick' option is checked on a rule. Otherwise they will only apply if no " .
871
	"other rules match. Pay close attention to the rule order and options " .
872
	"chosen. If no rule here matches, the per-interface or default rules are used. ");?>
873
	</li>
874
<? endif; ?>
875
</ul>
876
		 </td>
877
	        </tr>
878
              </table>
879
	</div>
880
    </td>
881
  </tr>
882
</table>
883
  <input type="hidden" name="if" value="<?=htmlspecialchars($if);?>">
884
  <script type="text/javascript">
885
	var number_of_rules = <?=$nrules?>;
886
<?php $nrules = 0; for ($i = 0; isset($a_filter[$i]); $i++): ?>
887
/*
888
	Sortable.create("dragtable", { 
889
		tag:"tr", 
890
		format:"fr([0-9999999])",
891
		containment:["dragtable"], 
892
		onChange:function(affected) {
893
			document.body.style.cursor = 'move';
894
		},
895
		onUpdate:function(container) { 
896
			document.body.style.cursor = 'move';
897
			updateOrder(Sortable.serialize('dragtable', 'tr'));
898
		} 
899
	});
900
*/
901
<?php endfor; ?>
902
	function updateOrder(order) {
903
		if(document.getElementById("redboxtable"))
904
			jQuery('#redboxtable').hide();
905
		jQuery('#loading').show();
906
		document.body.style.cursor = 'wait';
907
		document.location = 'firewall_rules.php?if=<?=htmlspecialchars($if);?>&dragdroporder=true&' + Sortable.serialize('dragtable', 'tr');
908
		return;
909
	}
910
	jQuery('#loading').hide();
911
  </script>
912
</form>
913
<?php include("fend.inc"); ?>
914
</body>
915
</html>
(68-68/249)