Project

General

Profile

Download (39.9 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
$statusurl = "status_filter_reload.php";
45
$logurl = "diag_logs_filter.php";
46

    
47
require("guiconfig.inc");
48
require_once("functions.inc");
49
require_once("filter.inc");
50
require_once("shaper.inc");
51

    
52
$pgtitle = array(gettext("Firewall"),gettext("Rules"));
53

    
54
function delete_nat_association($id) {
55
	global $config;
56

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

    
60
	$a_nat = &$config['nat']['rule'];
61

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

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

    
73
$if = $_GET['if'];
74
if ($_POST['if'])
75
	$if = $_POST['if'];
76

    
77
$ifdescs = get_configured_interface_with_descr();
78

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

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

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

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

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

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

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

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

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

    
180
pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/interfaces_override");
181

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

    
193
if ($_POST) {
194

    
195
	$pconfig = $_POST;
196

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

    
201
		clear_subsystem_dirty('filter');
202

    
203
		pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/apply");
204

    
205
		$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>");
206
	}
207
}
208

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

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

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

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

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

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

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

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

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

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

    
306
<script type="text/javascript" language="javascript" src="/javascript/row_toggle.js">
307
</script>
308
<?php if ($savemsg) print_info_box($savemsg); ?>
309
<?php if (is_subsystem_dirty('filter')): ?><p>
310
<?php
311
if($_REQUEST['undodrag']) {
312
	foreach($_REQUEST['dragtable'] as $dt) 
313
		$dragtable .= "&dragtable[]={$dt}";
314
	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}");
315
} else {
316
	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."));
317
}
318
?>
319
<br>
320
<?php endif; ?>
321
<div id="loading" style="visibity:hidden">
322
	<img src="/themes/<?=$g['theme']?>/images/misc/loader.gif"> Loading, please wait...
323
	<p/>&nbsp;
324
</div>
325
<?php
326
	pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/before_table");
327
?>
328
<table width="100%" border="0" cellpadding="0" cellspacing="0">
329
  <tr><td class="tabnavtbl">
330
  <?php
331
	/* active tabs */
332
	$tab_array = array();
333
       if ("FloatingRules" == $if)
334
                        $active = true;
335
                else
336
                        $active = false;
337
        $tab_array[] = array(gettext("Floating"), $active, "firewall_rules.php?if=FloatingRules");
338
	$tabscounter = 0; $i = 0; foreach ($iflist as $ifent => $ifname) {
339
		if ($ifent == $if)
340
			$active = true;
341
		else
342
			$active = false;
343
		$tab_array[] = array($ifname, $active, "firewall_rules.php?if={$ifent}");
344
	}
345
	display_top_tabs($tab_array);
346
  ?>
347
  </td></tr>
348
  <tr>
349
    <td>
350
	<div id="mainarea">
351
		<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
352
<?php
353
		pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/before_first_tr");
354
?>
355
			<tr id="frheader">
356
			<td width="3%" class="list">&nbsp;</td>
357
			<td width="5%" class="list">&nbsp;</td>
358
			<td width="3%" class="listhdrr"><?=gettext("ID");?></td>
359
<?php
360
				pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_id_tablehead");
361
?>
362
			<td width="6%" class="listhdrr"><?=gettext("Proto");?></td>
363
			<td width="12%" class="listhdrr"><?=gettext("Source");?></td>
364
			<td width="6%" class="listhdrr"><?=gettext("Port");?></td>
365
			<td width="12%" class="listhdrr"><?=gettext("Destination");?></td>
366
			<td width="6%" class="listhdrr"><?=gettext("Port");?></td>
367
			<td width="5%" class="listhdrr"><?=gettext("Gateway");?></td>
368
			<td width="8%" class="listhdrr"><?=gettext("Queue");?></td>
369
			<td width="5%" class="listhdrr"><?=gettext("Schedule");?></td>
370
<?php
371
				pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_desc_tablehead");
372
?>
373
			<td width="19%" class="listhdr"><?=gettext("Description");?></td>
374
			<td width="10%" class="list">
375
			<table border="0" cellspacing="0" cellpadding="1">
376
			   <tr>
377
				<?php
378
					$nrules = 0;
379
					for ($i = 0; isset($a_filter[$i]); $i++) {
380
						$filterent = $a_filter[$i];
381
						if ($filterent['interface'] != $if && !isset($filterent['floating']))
382
							continue;
383
						if (isset($filterent['floating']) && "FloatingRules" != $if)
384
							continue;
385
						$nrules++;
386
					}
387
				?>
388
				<td>
389
				<?php if ($nrules == 0): ?>
390
				<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?gettext("delete selected rules"); ?>" border="0"><?php else: ?>
391
				<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; ?>
392
				</td>
393
				<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>
394
			   </tr>
395
			</table>
396
		  </td>
397
		</tr>
398
<?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.
399
	if (!isset($config['system']['webgui']['noantilockout']) &&
400
		(((count($config['interfaces']) > 1) && ($if == 'lan'))
401
		|| ((count($config['interfaces']) == 1) && ($if == 'wan')))):
402

    
403
		$alports = implode('<br/>', filter_get_antilockout_ports(true));
404
?>
405
		<tr valign="top" id="antilockout">
406
			<td class="list">&nbsp;</td>
407
			<td class="listt" align="center"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" width="11" height="11" border="0"></td>
408
			<td class="listlr" style="background-color: #E0E0E0">&nbsp;</td>
409
<?php
410
				pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_id_tr_antilockout");
411
?>
412
			<td class="listr" style="background-color: #E0E0E0">*</td>
413
			<td class="listr" style="background-color: #E0E0E0">*</td>
414
			<td class="listr" style="background-color: #E0E0E0">*</td>
415
			<td class="listr" style="background-color: #E0E0E0"><?=$iflist[$if];?> Address</td>
416
			<td class="listr" style="background-color: #E0E0E0"><?= $alports ?></td>
417
			<td class="listr" style="background-color: #E0E0E0">*</td>
418
			<td class="listr" style="background-color: #E0E0E0">*</td>
419
			<td class="listr" style="background-color: #E0E0E0">&nbsp;</td>
420
			<td class="listbg"><?=gettext("Anti-Lockout Rule");?></td>
421
			<td valign="middle" nowrap class="list">
422
			<table border="0" cellspacing="0" cellpadding="1">
423
				<tr>
424
					<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>
425
					<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>
426
				</tr>
427
				<tr>
428
					<td align="center" valign="middle"></td>
429
					<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>
430
				</tr>
431
				</table>
432
			</td>
433
			</tr>
434
<?php endif; ?>
435

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