Project

General

Profile

Download (5.66 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	services_igmpproxy.php
5
*/
6
/* ====================================================================
7
 *	Copyright (c)  2004-2015  Electric Sheep Fencing, LLC. All rights reserved.
8
 *
9
 *  Some or all of this file is based on the m0n0wall project which is
10
 *  Copyright (c)  2004 Manuel Kasper (BSD 2 clause)
11
 *
12
 *	Redistribution and use in source and binary forms, with or without modification,
13
 *	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
20
 *		the documentation and/or other materials provided with the
21
 *		distribution.
22
 *
23
 *	3. All advertising materials mentioning features or use of this software
24
 *		must display the following acknowledgment:
25
 *		"This product includes software developed by the pfSense Project
26
 *		 for use in the pfSense software distribution. (http://www.pfsense.org/).
27
 *
28
 *	4. The names "pfSense" and "pfSense Project" must not be used to
29
 *		 endorse or promote products derived from this software without
30
 *		 prior written permission. For written permission, please contact
31
 *		 coreteam@pfsense.org.
32
 *
33
 *	5. Products derived from this software may not be called "pfSense"
34
 *		nor may "pfSense" appear in their names without prior written
35
 *		permission of the Electric Sheep Fencing, LLC.
36
 *
37
 *	6. Redistributions of any form whatsoever must retain the following
38
 *		acknowledgment:
39
 *
40
 *	"This product includes software developed by the pfSense Project
41
 *	for use in the pfSense software distribution (http://www.pfsense.org/).
42
 *
43
 *	THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
44
 *	EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45
 *	IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
46
 *	PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
47
 *	ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48
 *	SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
49
 *	NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
50
 *	LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51
 *	HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
52
 *	STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
53
 *	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
54
 *	OF THE POSSIBILITY OF SUCH DAMAGE.
55
 *
56
 *	====================================================================
57
 *
58
 */
59
/*
60
	pfSense_MODULE:	igmpproxy
61
*/
62

    
63
##|+PRIV
64
##|*IDENT=page-services-igmpproxy
65
##|*NAME=Services: Igmpproxy page
66
##|*DESCR=Allow access to the 'Services: Igmpproxy' page.
67
##|*MATCH=services_igmpproxy.php*
68
##|-PRIV
69

    
70
require("guiconfig.inc");
71

    
72
if (!is_array($config['igmpproxy']['igmpentry'])) {
73
	$config['igmpproxy']['igmpentry'] = array();
74
}
75

    
76
//igmpproxy_sort();
77
$a_igmpproxy = &$config['igmpproxy']['igmpentry'];
78

    
79
if ($_POST) {
80
	$pconfig = $_POST;
81

    
82
	$retval = 0;
83
	/* reload all components that use igmpproxy */
84
	$retval = services_igmpproxy_configure();
85

    
86
	if (stristr($retval, "error") <> true) {
87
		$savemsg = get_std_save_message($retval);
88
	} else {
89
		$savemsg = $retval;
90
	}
91

    
92
	clear_subsystem_dirty('igmpproxy');
93
}
94

    
95
if ($_GET['act'] == "del") {
96
	if ($a_igmpproxy[$_GET['id']]) {
97
		unset($a_igmpproxy[$_GET['id']]);
98
		write_config();
99
		mark_subsystem_dirty('igmpproxy');
100
		header("Location: services_igmpproxy.php");
101
		exit;
102
	}
103
}
104

    
105
$pgtitle = array(gettext("Services"), gettext("IGMP Proxy"));
106
include("head.inc");
107

    
108
if ($savemsg)
109
	print_info_box($savemsg, 'success');
110

    
111
if (is_subsystem_dirty('igmpproxy'))
112
	print_info_box_np(gettext('The IGMP entry list has been changed.' . '<br />' . 'You must apply the changes in order for them to take effect.'));
113
?>
114

    
115
<form action="services_igmpproxy.php" method="post">
116
	<div class="table-responsive">
117
		<table class="table table-striped table-hover table-condensed">
118
			<thead>
119
				<tr>
120
					<th><?=gettext("Name")?></th>
121
					<th><?=gettext("Type")?></th>
122
					<th><?=gettext("Values")?></th>
123
					<th><?=gettext("Description")?></th>
124
					<th</th>
125
				</tr>
126
			</thead>
127
			<tbody>
128
<?php
129
$i = 0;
130
foreach ($a_igmpproxy as $igmpentry):
131
?>
132
				<tr>
133
					<td>
134
						<?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($igmpentry['ifname']))?>
135
					</td>
136
					<td>
137
						<?=htmlspecialchars($igmpentry['type'])?>
138
					</td>
139
					<td>
140
<?php
141
	$addresses = implode(", ", array_slice(explode(" ", $igmpentry['address']), 0, 10));
142
	print($addresses);
143

    
144
	if(count($addresses) < 10) {
145
		print(' ');
146
	} else {
147
		print('...');
148
	}
149
?>
150
					</td>
151
					<td>
152
						<?=htmlspecialchars($igmpentry['descr'])?>&nbsp;
153
					</td>
154
					<td>
155
						<a class="fa fa-pencil"	title="<?=gettext('Edit IGMP entry')?>" href="services_igmpproxy_edit.php?id=<?=$i?>"></a>
156
						<a class="fa fa-trash"	title="<?=gettext('Delete IGMP entry')?>" href="services_igmpproxy.php?act=del&amp;id=<?=$i?>"></a>
157
					</td>
158
				</tr>
159
<?php
160
	$i++;
161
endforeach;
162
?>
163
			</tbody>
164
		</table>
165
	</div>
166
</form>
167

    
168
<nav class="action-buttons">
169
	<button id="submit" name="submit" type="submit" class="btn btn-primary btn-sm" value="<?=gettext("Save")?>">
170
		<i class="fa fa-save icon-embed-btn"></i>
171
		<?=gettext("Save")?>
172
	</button>
173
	<a href="services_igmpproxy_edit.php" class="btn btn-success btn-sm">
174
		<i class="fa fa-plus icon-embed-btn"></i>
175
		<?=gettext('Add')?>
176
	</a>
177
</nav>
178

    
179
<div id="infoblock">
180
<?=print_info_box(gettext('Please add the interface for upstream, the allowed subnets, and the downstream interfaces you would like the proxy to allow. ' .
181
					   'Only one "upstream" interface can be configured.'), info)?>
182
</div>
183
<?php
184
include("foot.inc");
(143-143/234)