Project

General

Profile

Download (3.11 KB) Statistics
| Branch: | Tag: | Revision:
1 c0b6fdde jim-p
<?php
2
/*
3
	easyrule.php
4
5 ce77a9c4 Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
6 998f77a8 jim-p
	Copyright (C) 2009-2010 Jim Pingle (jpingle@gmail.com)
7
	Originally Sponsored By Anathematic @ pfSense Forums
8 c0b6fdde jim-p
	All rights reserved.
9
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12
13
	1. Redistributions of source code must retain the above copyright notice,
14
	this list of conditions and the following disclaimer.
15
16
	2. Redistributions in binary form must reproduce the above copyright
17
	notice, this list of conditions and the following disclaimer in the
18
	documentation and/or other materials provided with the distribution.
19
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31 7ac5a4cb Scott Ullrich
/*
32
	pfSense_MODULE:	filter
33
*/
34 c0b6fdde jim-p
35 59c6e218 jim-p
##|+PRIV
36
##|*IDENT=page-firewall-easyrule
37
##|*NAME=Firewall: Easy Rule add/status page
38
##|*DESCR=Allow access to the 'Firewall: Easy Rule' add/status page.
39
##|*MATCH=easyrule.php*
40
##|-PRIV
41
42
$pgtitle = gettext("Firewall: EasyRule");
43 c0b6fdde jim-p
require_once("guiconfig.inc");
44
require_once("easyrule.inc");
45 4ec77db3 Scott Ullrich
require_once("filter.inc");
46 8f2c6b94 Scott Ullrich
require_once("shaper.inc");
47 4ec77db3 Scott Ullrich
48 c0b6fdde jim-p
$retval = 0;
49
$message = "";
50 429bf8de Ermal Lu?i
$specialsrcdst = explode(" ", "any pptp pppoe l2tp openvpn");
51 c0b6fdde jim-p
52
if ($_GET && isset($_GET['action'])) {
53
	switch ($_GET['action']) {
54
		case 'block':
55
			/* Check that we have a valid host */
56 bd40781a Seth Mos
			easyrule_parse_block($_GET['int'], $_GET['src'], $_GET['ipproto']);
57 c0b6fdde jim-p
			break;
58
		case 'pass':
59 bd40781a Seth Mos
			easyrule_parse_pass($_GET['int'], $_GET['proto'], $_GET['src'], $_GET['dst'], $_GET['dstport'], $_GET['ipproto']);
60 c0b6fdde jim-p
			break;
61
	}
62
}
63
64 45b4ffc6 Phil Davis
if (stristr($retval, "error") == true) {
65
	$message = $retval;
66
}
67 c0b6fdde jim-p
68
include("head.inc"); ?>
69 f6510207 xbipin
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
70 ee9933b6 Renato Botelho
<?php include("fbegin.inc"); ?>
71 c0b6fdde jim-p
<table width="100%" border="0" cellpadding="0" cellspacing="0">
72
	<tr>
73
		<td>
74
<?php if ($input_errors) print_input_errors($input_errors); ?>
75
76
<?php if ($message) { ?>
77 8cd558b6 ayvis
<br />
78 a9187208 Carlos Eduardo Ramos
<?=gettext("Message"); ?>: <?php echo $message; ?>
79 8cd558b6 ayvis
<br />
80 ee9933b6 Renato Botelho
<?php } else { ?>
81 a9187208 Carlos Eduardo Ramos
<?=gettext("This is the Easy Rule status page, mainly used to display errors when adding rules. " .
82
"If you are seeing this, there apparently was not an error, and you navigated to the " .
83 8cd558b6 ayvis
"page directly without telling it what to do"); ?>.<br /><br />
84 a9187208 Carlos Eduardo Ramos
<?=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, " .
85
"Firewall Tab"); ?></a>.
86 865ff9b4 jim-p
<br />
87 ee9933b6 Renato Botelho
<?php } ?>
88 c0b6fdde jim-p
</td></tr></table>
89
<?php include("fend.inc"); ?>