Project

General

Profile

Download (2.87 KB) Statistics
| Branch: | Tag: | Revision:
1 c0b6fdde jim-p
<?php
2
/*
3
	easyrule.php
4
5 998f77a8 jim-p
	Copyright (C) 2009-2010 Jim Pingle (jpingle@gmail.com)
6
	Originally Sponsored By Anathematic @ pfSense Forums
7 c0b6fdde jim-p
	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 7ac5a4cb Scott Ullrich
/*
31
	pfSense_MODULE:	filter
32
*/
33 c0b6fdde jim-p
34 a9187208 Carlos Eduardo Ramos
$pgtitle = gettext("Status : EasyRule");
35 c0b6fdde jim-p
require_once("guiconfig.inc");
36
require_once("easyrule.inc");
37 4ec77db3 Scott Ullrich
require_once("filter.inc");
38 8f2c6b94 Scott Ullrich
require_once("shaper.inc");
39 4ec77db3 Scott Ullrich
40 c0b6fdde jim-p
$retval = 0;
41
$message = "";
42 429bf8de Ermal Lu?i
$specialsrcdst = explode(" ", "any pptp pppoe l2tp openvpn");
43 c0b6fdde jim-p
44
if ($_GET && isset($_GET['action'])) {
45
	switch ($_GET['action']) {
46
		case 'block':
47
			/* Check that we have a valid host */
48 bd40781a Seth Mos
			easyrule_parse_block($_GET['int'], $_GET['src'], $_GET['ipproto']);
49 c0b6fdde jim-p
			break;
50
		case 'pass':
51 bd40781a Seth Mos
			easyrule_parse_pass($_GET['int'], $_GET['proto'], $_GET['src'], $_GET['dst'], $_GET['dstport'], $_GET['ipproto']);
52 c0b6fdde jim-p
			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 ee9933b6 Renato Botelho
<?php include("fbegin.inc"); ?>
62 c0b6fdde jim-p
<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 a9187208 Carlos Eduardo Ramos
<?=gettext("Message"); ?>: <?php echo $message; ?>
70 c0b6fdde jim-p
<br/>
71 ee9933b6 Renato Botelho
<?php } else { ?>
72 a9187208 Carlos Eduardo Ramos
<?=gettext("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
<?=gettext("This page is meant to be called from the block/pass buttons on the Firewall Logs page"); ?>, <a href="diag_logs_filter.php"><?=gettext("Status"); ?> &gt; <?=gettext("System Logs, " .
76
"Firewall Tab"); ?></a>.
77 865ff9b4 jim-p
<br />
78 ee9933b6 Renato Botelho
<?php } ?>
79 c0b6fdde jim-p
</td></tr></table>
80
<?php include("fend.inc"); ?>