1
|
<?php
|
2
|
/*
|
3
|
easyrule.php
|
4
|
|
5
|
Copyright (C) 2009-2010 Jim Pingle (jpingle@gmail.com)
|
6
|
Originally Sponsored By Anathematic @ pfSense Forums
|
7
|
All rights reserved.
|
8
|
|
9
|
Redistribution and use in source and binary forms, with or without
|
10
|
modification, are permitted provided that the following conditions are met:
|
11
|
|
12
|
1. Redistributions of source code must retain the above copyright notice,
|
13
|
this list of conditions and the following disclaimer.
|
14
|
|
15
|
2. Redistributions in binary form must reproduce the above copyright
|
16
|
notice, this list of conditions and the following disclaimer in the
|
17
|
documentation and/or other materials provided with the distribution.
|
18
|
|
19
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
20
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
21
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
22
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
23
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
24
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
25
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
26
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
27
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28
|
POSSIBILITY OF SUCH DAMAGE.
|
29
|
*/
|
30
|
/*
|
31
|
pfSense_MODULE: filter
|
32
|
*/
|
33
|
|
34
|
$pgtitle = "Status : EasyRule";
|
35
|
require_once("guiconfig.inc");
|
36
|
require_once("easyrule.inc");
|
37
|
require_once("filter.inc");
|
38
|
require_once("shaper.inc");
|
39
|
|
40
|
$retval = 0;
|
41
|
$message = "";
|
42
|
$specialsrcdst = explode(" ", "any pptp pppoe l2tp openvpn");
|
43
|
|
44
|
if ($_GET && isset($_GET['action'])) {
|
45
|
switch ($_GET['action']) {
|
46
|
case 'block':
|
47
|
/* Check that we have a valid host */
|
48
|
easyrule_parse_block($_GET['int'], $_GET['src']);
|
49
|
break;
|
50
|
case 'pass':
|
51
|
easyrule_parse_pass($_GET['int'], $_GET['proto'], $_GET['src'], $_GET['dst'], $_GET['dstport']);
|
52
|
break;
|
53
|
}
|
54
|
}
|
55
|
|
56
|
if(stristr($retval, "error") == true)
|
57
|
$message = $retval;
|
58
|
|
59
|
include("head.inc"); ?>
|
60
|
<body link="#000000" vlink="#000000" alink="#000000">
|
61
|
<? include("fbegin.inc"); ?>
|
62
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
63
|
<tr>
|
64
|
<td>
|
65
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
66
|
|
67
|
<?php if ($message) { ?>
|
68
|
<br/>
|
69
|
Message: <?php echo $message; ?>
|
70
|
<br/>
|
71
|
<? } else { ?>
|
72
|
This is the Easy Rule status page, mainly used to display errors when adding rules.
|
73
|
If you are seeing this, there apparently was not an error, and you navigated to the
|
74
|
page directly without telling it what to do.<br/><br/>
|
75
|
This page is meant to be called from the block/pass buttons on the Firewall Logs page, <a href="diag_logs_filter.php">Status > System Logs,
|
76
|
Firewall Tab</a>.
|
77
|
<br />
|
78
|
<? } ?>
|
79
|
</td></tr></table>
|
80
|
<?php include("fend.inc"); ?>
|