Project

General

Profile

Download (4.1 KB) Statistics
| Branch: | Tag: | Revision:
1 ce9abebd Ermal Luci
<?php
2
/*
3 c5d81585 Renato Botelho
 * services_igmpproxy.php
4 b9043cdc Stephen Beaver
 *
5 c5d81585 Renato Botelho
 * part of pfSense (https://www.pfsense.org)
6 81299b5c Renato Botelho
 * Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
7 c5d81585 Renato Botelho
 * All rights reserved.
8 191cb31d Stephen Beaver
 *
9 c5d81585 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 b12ea3fb Renato Botelho
 * Licensed under the Apache License, Version 2.0 (the "License");
14
 * you may not use this file except in compliance with the License.
15
 * You may obtain a copy of the License at
16 b9043cdc Stephen Beaver
 *
17 b12ea3fb Renato Botelho
 * http://www.apache.org/licenses/LICENSE-2.0
18 b9043cdc Stephen Beaver
 *
19 b12ea3fb Renato Botelho
 * Unless required by applicable law or agreed to in writing, software
20
 * distributed under the License is distributed on an "AS IS" BASIS,
21
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
 * See the License for the specific language governing permissions and
23
 * limitations under the License.
24 b9043cdc Stephen Beaver
 */
25 ce9abebd Ermal Luci
26
##|+PRIV
27
##|*IDENT=page-services-igmpproxy
28 5230f468 jim-p
##|*NAME=Services: IGMP Proxy
29 0b8328c5 jim-p
##|*DESCR=Allow access to the 'Services: IGMP Proxy' page.
30 ce9abebd Ermal Luci
##|*MATCH=services_igmpproxy.php*
31
##|-PRIV
32
33 c81ef6e2 Phil Davis
require_once("guiconfig.inc");
34 ce9abebd Ermal Luci
35 c0bf7858 Phil Davis
if (!is_array($config['igmpproxy']['igmpentry'])) {
36 ce9abebd Ermal Luci
	$config['igmpproxy']['igmpentry'] = array();
37 c0bf7858 Phil Davis
}
38 ce9abebd Ermal Luci
39
//igmpproxy_sort();
40
$a_igmpproxy = &$config['igmpproxy']['igmpentry'];
41
42
if ($_POST) {
43
	$pconfig = $_POST;
44
45 44c42356 Phil Davis
	$changes_applied = true;
46 ce9abebd Ermal Luci
	$retval = 0;
47
	/* reload all components that use igmpproxy */
48 44c42356 Phil Davis
	$retval |= services_igmpproxy_configure();
49 6833c9cd Ermal Lu?i
50
	clear_subsystem_dirty('igmpproxy');
51 ce9abebd Ermal Luci
}
52
53
if ($_GET['act'] == "del") {
54
	if ($a_igmpproxy[$_GET['id']]) {
55
		unset($a_igmpproxy[$_GET['id']]);
56
		write_config();
57 4bbfe029 Ermal Lu?i
		mark_subsystem_dirty('igmpproxy');
58 ce9abebd Ermal Luci
		header("Location: services_igmpproxy.php");
59
		exit;
60
	}
61
}
62
63 c0bf7858 Phil Davis
$pgtitle = array(gettext("Services"), gettext("IGMP Proxy"));
64 ce9abebd Ermal Luci
include("head.inc");
65
66 44c42356 Phil Davis
if ($changes_applied) {
67
	print_apply_result_box($retval);
68 20db3e1a Phil Davis
}
69 3d0f579f sbeaver
70 20db3e1a Phil Davis
if (is_subsystem_dirty('igmpproxy')) {
71 06ca4e2d NOYB
	print_apply_box(gettext('The IGMP entry list has been changed.') . '<br />' . gettext('The changes must be applied for them to take effect.'));
72 20db3e1a Phil Davis
}
73 ce9abebd Ermal Luci
?>
74
75
<form action="services_igmpproxy.php" method="post">
76 060ed238 Stephen Beaver
	<div class="panel panel-default">
77
		<div class="panel-heading"><h2 class="panel-title"><?=gettext('IGMP Proxy')?></h2></div>
78
		<div class="panel-body">
79
			<div class="table-responsive">
80 1c10ce97 PiBa-NL
				<table class="table table-striped table-hover table-condensed table-rowdblclickedit">
81 060ed238 Stephen Beaver
					<thead>
82
						<tr>
83
							<th><?=gettext("Name")?></th>
84
							<th><?=gettext("Type")?></th>
85
							<th><?=gettext("Values")?></th>
86
							<th><?=gettext("Description")?></th>
87 70dc5cd6 Phil Davis
							<th><?=gettext("Actions")?></th>
88 060ed238 Stephen Beaver
						</tr>
89
					</thead>
90
					<tbody>
91 3d0f579f sbeaver
<?php
92
$i = 0;
93
foreach ($a_igmpproxy as $igmpentry):
94
?>
95 060ed238 Stephen Beaver
						<tr>
96
							<td>
97
								<?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($igmpentry['ifname']))?>
98
							</td>
99
							<td>
100
								<?=htmlspecialchars($igmpentry['type'])?>
101
							</td>
102
							<td>
103 3d0f579f sbeaver
<?php
104 ce9abebd Ermal Luci
	$addresses = implode(", ", array_slice(explode(" ", $igmpentry['address']), 0, 10));
105 3d0f579f sbeaver
	print($addresses);
106
107 20db3e1a Phil Davis
	if (count($addresses) < 10) {
108 3d0f579f sbeaver
		print(' ');
109 ce9abebd Ermal Luci
	} else {
110 3d0f579f sbeaver
		print('...');
111 ce9abebd Ermal Luci
	}
112 3d0f579f sbeaver
?>
113 060ed238 Stephen Beaver
							</td>
114
							<td>
115
								<?=htmlspecialchars($igmpentry['descr'])?>&nbsp;
116
							</td>
117
							<td>
118
								<a class="fa fa-pencil"	title="<?=gettext('Edit IGMP entry')?>" href="services_igmpproxy_edit.php?id=<?=$i?>"></a>
119
								<a class="fa fa-trash"	title="<?=gettext('Delete IGMP entry')?>" href="services_igmpproxy.php?act=del&amp;id=<?=$i?>"></a>
120
							</td>
121
						</tr>
122 3d0f579f sbeaver
<?php
123
	$i++;
124
endforeach;
125
?>
126 060ed238 Stephen Beaver
					</tbody>
127
				</table>
128
			</div>
129
		</div>
130 ac950976 Colin Fleming
	</div>
131 ce9abebd Ermal Luci
</form>
132 3d0f579f sbeaver
133 c10cb196 Stephen Beaver
<nav class="action-buttons">
134 c9679d8c Stephen Beaver
	<button id="submit" name="submit" type="submit" class="btn btn-primary btn-sm" value="<?=gettext("Save")?>">
135 9d5a20cf heper
		<i class="fa fa-save icon-embed-btn"></i>
136 c9679d8c Stephen Beaver
		<?=gettext("Save")?>
137
	</button>
138
	<a href="services_igmpproxy_edit.php" class="btn btn-success btn-sm">
139 9d5a20cf heper
		<i class="fa fa-plus icon-embed-btn"></i>
140 c9679d8c Stephen Beaver
		<?=gettext('Add')?>
141
	</a>
142
</nav>
143
144 35681930 Stephen Beaver
<div class="infoblock">
145 06ca4e2d NOYB
<?php print_info_box(gettext('Please add the interface for upstream, the allowed subnets, and the downstream interfaces for the proxy to allow. ' .
146 f6aebbcc NewEraCracker
					   'Only one "upstream" interface can be configured.'), 'info', false); ?>
147 c9679d8c Stephen Beaver
</div>
148 3d0f579f sbeaver
<?php
149 5d3914a9 heper
include("foot.inc");