Project

General

Profile

Download (5.85 KB) Statistics
| Branch: | Tag: | Revision:
1 ce9abebd Ermal Luci
<?php
2
/*
3 aaec5634 Renato Botelho
 * services_igmpproxy.php
4 b9043cdc Stephen Beaver
 *
5 aaec5634 Renato Botelho
 * part of pfSense (https://www.pfsense.org)
6 2a2396a6 Renato Botelho
 * Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
7 aaec5634 Renato Botelho
 * All rights reserved.
8 191cb31d Stephen Beaver
 *
9 aaec5634 Renato Botelho
 * originally based on m0n0wall (http://m0n0.ch/wall)
10
 * Copyright (c) 2003-2004 Manuel Kasper <mk@neon1.net>.
11
 * All rights reserved.
12 b9043cdc Stephen Beaver
 *
13 aaec5634 Renato Botelho
 * Redistribution and use in source and binary forms, with or without
14
 * modification, are permitted provided that the following conditions are met:
15 b9043cdc Stephen Beaver
 *
16 aaec5634 Renato Botelho
 * 1. Redistributions of source code must retain the above copyright notice,
17
 *    this list of conditions and the following disclaimer.
18 b9043cdc Stephen Beaver
 *
19 aaec5634 Renato Botelho
 * 2. Redistributions in binary form must reproduce the above copyright
20
 *    notice, this list of conditions and the following disclaimer in
21
 *    the documentation and/or other materials provided with the
22
 *    distribution.
23 b9043cdc Stephen Beaver
 *
24 aaec5634 Renato Botelho
 * 3. All advertising materials mentioning features or use of this software
25
 *    must display the following acknowledgment:
26
 *    "This product includes software developed by the pfSense Project
27
 *    for use in the pfSense® software distribution. (http://www.pfsense.org/).
28 b9043cdc Stephen Beaver
 *
29 aaec5634 Renato Botelho
 * 4. The names "pfSense" and "pfSense Project" must not be used to
30
 *    endorse or promote products derived from this software without
31
 *    prior written permission. For written permission, please contact
32
 *    coreteam@pfsense.org.
33 b9043cdc Stephen Beaver
 *
34 aaec5634 Renato Botelho
 * 5. Products derived from this software may not be called "pfSense"
35
 *    nor may "pfSense" appear in their names without prior written
36
 *    permission of the Electric Sheep Fencing, LLC.
37 b9043cdc Stephen Beaver
 *
38 aaec5634 Renato Botelho
 * 6. Redistributions of any form whatsoever must retain the following
39
 *    acknowledgment:
40 b9043cdc Stephen Beaver
 *
41 aaec5634 Renato Botelho
 * "This product includes software developed by the pfSense Project
42
 * for use in the pfSense software distribution (http://www.pfsense.org/).
43 b9043cdc Stephen Beaver
 *
44 aaec5634 Renato Botelho
 * THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
45
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
47
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
48
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
49
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
50
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
51
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
53
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
54
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
55
 * OF THE POSSIBILITY OF SUCH DAMAGE.
56 b9043cdc Stephen Beaver
 */
57 ce9abebd Ermal Luci
58
##|+PRIV
59
##|*IDENT=page-services-igmpproxy
60 5230f468 jim-p
##|*NAME=Services: IGMP Proxy
61 0b8328c5 jim-p
##|*DESCR=Allow access to the 'Services: IGMP Proxy' page.
62 ce9abebd Ermal Luci
##|*MATCH=services_igmpproxy.php*
63
##|-PRIV
64
65 aceaf18c Phil Davis
require_once("guiconfig.inc");
66 ce9abebd Ermal Luci
67 c0bf7858 Phil Davis
if (!is_array($config['igmpproxy']['igmpentry'])) {
68 ce9abebd Ermal Luci
	$config['igmpproxy']['igmpentry'] = array();
69 c0bf7858 Phil Davis
}
70 ce9abebd Ermal Luci
71
//igmpproxy_sort();
72
$a_igmpproxy = &$config['igmpproxy']['igmpentry'];
73
74
if ($_POST) {
75
	$pconfig = $_POST;
76
77
	$retval = 0;
78
	/* reload all components that use igmpproxy */
79
	$retval = services_igmpproxy_configure();
80
81 c0bf7858 Phil Davis
	if (stristr($retval, "error") <> true) {
82 3d0f579f sbeaver
		$savemsg = get_std_save_message($retval);
83 c0bf7858 Phil Davis
	} else {
84 3d0f579f sbeaver
		$savemsg = $retval;
85 c0bf7858 Phil Davis
	}
86 6833c9cd Ermal Lu?i
87
	clear_subsystem_dirty('igmpproxy');
88 ce9abebd Ermal Luci
}
89
90
if ($_GET['act'] == "del") {
91
	if ($a_igmpproxy[$_GET['id']]) {
92
		unset($a_igmpproxy[$_GET['id']]);
93
		write_config();
94 4bbfe029 Ermal Lu?i
		mark_subsystem_dirty('igmpproxy');
95 ce9abebd Ermal Luci
		header("Location: services_igmpproxy.php");
96
		exit;
97
	}
98
}
99
100 c0bf7858 Phil Davis
$pgtitle = array(gettext("Services"), gettext("IGMP Proxy"));
101 ce9abebd Ermal Luci
include("head.inc");
102
103 20db3e1a Phil Davis
if ($savemsg) {
104 3d0f579f sbeaver
	print_info_box($savemsg, 'success');
105 20db3e1a Phil Davis
}
106 3d0f579f sbeaver
107 20db3e1a Phil Davis
if (is_subsystem_dirty('igmpproxy')) {
108 152d81c2 Stephen Beaver
	print_apply_box(gettext('The IGMP entry list has been changed.') . '<br />' . gettext('The changes must be applied for them to take effect.'));
109 20db3e1a Phil Davis
}
110 ce9abebd Ermal Luci
?>
111
112
<form action="services_igmpproxy.php" method="post">
113 060ed238 Stephen Beaver
	<div class="panel panel-default">
114
		<div class="panel-heading"><h2 class="panel-title"><?=gettext('IGMP Proxy')?></h2></div>
115
		<div class="panel-body">
116
			<div class="table-responsive">
117 91677170 PiBa-NL
				<table class="table table-striped table-hover table-condensed table-rowdblclickedit">
118 060ed238 Stephen Beaver
					<thead>
119
						<tr>
120
							<th><?=gettext("Name")?></th>
121
							<th><?=gettext("Type")?></th>
122
							<th><?=gettext("Values")?></th>
123
							<th><?=gettext("Description")?></th>
124 70dc5cd6 Phil Davis
							<th><?=gettext("Actions")?></th>
125 060ed238 Stephen Beaver
						</tr>
126
					</thead>
127
					<tbody>
128 3d0f579f sbeaver
<?php
129
$i = 0;
130
foreach ($a_igmpproxy as $igmpentry):
131
?>
132 060ed238 Stephen Beaver
						<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 3d0f579f sbeaver
<?php
141 ce9abebd Ermal Luci
	$addresses = implode(", ", array_slice(explode(" ", $igmpentry['address']), 0, 10));
142 3d0f579f sbeaver
	print($addresses);
143
144 20db3e1a Phil Davis
	if (count($addresses) < 10) {
145 3d0f579f sbeaver
		print(' ');
146 ce9abebd Ermal Luci
	} else {
147 3d0f579f sbeaver
		print('...');
148 ce9abebd Ermal Luci
	}
149 3d0f579f sbeaver
?>
150 060ed238 Stephen Beaver
							</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 3d0f579f sbeaver
<?php
160
	$i++;
161
endforeach;
162
?>
163 060ed238 Stephen Beaver
					</tbody>
164
				</table>
165
			</div>
166
		</div>
167 ac950976 Colin Fleming
	</div>
168 ce9abebd Ermal Luci
</form>
169 3d0f579f sbeaver
170 c10cb196 Stephen Beaver
<nav class="action-buttons">
171 c9679d8c Stephen Beaver
	<button id="submit" name="submit" type="submit" class="btn btn-primary btn-sm" value="<?=gettext("Save")?>">
172 9d5a20cf heper
		<i class="fa fa-save icon-embed-btn"></i>
173 c9679d8c Stephen Beaver
		<?=gettext("Save")?>
174
	</button>
175
	<a href="services_igmpproxy_edit.php" class="btn btn-success btn-sm">
176 9d5a20cf heper
		<i class="fa fa-plus icon-embed-btn"></i>
177 c9679d8c Stephen Beaver
		<?=gettext('Add')?>
178
	</a>
179
</nav>
180
181 35681930 Stephen Beaver
<div class="infoblock">
182 152d81c2 Stephen Beaver
<?php print_info_box(gettext('Please add the interface for upstream, the allowed subnets, and the downstream interfaces for the proxy to allow. ' .
183 f6aebbcc NewEraCracker
					   'Only one "upstream" interface can be configured.'), 'info', false); ?>
184 c9679d8c Stephen Beaver
</div>
185 3d0f579f sbeaver
<?php
186 5d3914a9 heper
include("foot.inc");