Project

General

Profile

Download (4.18 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
	$retval = 0;
46
	/* reload all components that use igmpproxy */
47
	$retval = services_igmpproxy_configure();
48
49 c0bf7858 Phil Davis
	if (stristr($retval, "error") <> true) {
50 3d0f579f sbeaver
		$savemsg = get_std_save_message($retval);
51 c0bf7858 Phil Davis
	} else {
52 3d0f579f sbeaver
		$savemsg = $retval;
53 c0bf7858 Phil Davis
	}
54 6833c9cd Ermal Lu?i
55
	clear_subsystem_dirty('igmpproxy');
56 ce9abebd Ermal Luci
}
57
58
if ($_GET['act'] == "del") {
59
	if ($a_igmpproxy[$_GET['id']]) {
60
		unset($a_igmpproxy[$_GET['id']]);
61
		write_config();
62 4bbfe029 Ermal Lu?i
		mark_subsystem_dirty('igmpproxy');
63 ce9abebd Ermal Luci
		header("Location: services_igmpproxy.php");
64
		exit;
65
	}
66
}
67
68 c0bf7858 Phil Davis
$pgtitle = array(gettext("Services"), gettext("IGMP Proxy"));
69 ce9abebd Ermal Luci
include("head.inc");
70
71 20db3e1a Phil Davis
if ($savemsg) {
72 3d0f579f sbeaver
	print_info_box($savemsg, 'success');
73 20db3e1a Phil Davis
}
74 3d0f579f sbeaver
75 20db3e1a Phil Davis
if (is_subsystem_dirty('igmpproxy')) {
76 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.'));
77 20db3e1a Phil Davis
}
78 ce9abebd Ermal Luci
?>
79
80
<form action="services_igmpproxy.php" method="post">
81 060ed238 Stephen Beaver
	<div class="panel panel-default">
82
		<div class="panel-heading"><h2 class="panel-title"><?=gettext('IGMP Proxy')?></h2></div>
83
		<div class="panel-body">
84
			<div class="table-responsive">
85 1c10ce97 PiBa-NL
				<table class="table table-striped table-hover table-condensed table-rowdblclickedit">
86 060ed238 Stephen Beaver
					<thead>
87
						<tr>
88
							<th><?=gettext("Name")?></th>
89
							<th><?=gettext("Type")?></th>
90
							<th><?=gettext("Values")?></th>
91
							<th><?=gettext("Description")?></th>
92 70dc5cd6 Phil Davis
							<th><?=gettext("Actions")?></th>
93 060ed238 Stephen Beaver
						</tr>
94
					</thead>
95
					<tbody>
96 3d0f579f sbeaver
<?php
97
$i = 0;
98
foreach ($a_igmpproxy as $igmpentry):
99
?>
100 060ed238 Stephen Beaver
						<tr>
101
							<td>
102
								<?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($igmpentry['ifname']))?>
103
							</td>
104
							<td>
105
								<?=htmlspecialchars($igmpentry['type'])?>
106
							</td>
107
							<td>
108 3d0f579f sbeaver
<?php
109 ce9abebd Ermal Luci
	$addresses = implode(", ", array_slice(explode(" ", $igmpentry['address']), 0, 10));
110 3d0f579f sbeaver
	print($addresses);
111
112 20db3e1a Phil Davis
	if (count($addresses) < 10) {
113 3d0f579f sbeaver
		print(' ');
114 ce9abebd Ermal Luci
	} else {
115 3d0f579f sbeaver
		print('...');
116 ce9abebd Ermal Luci
	}
117 3d0f579f sbeaver
?>
118 060ed238 Stephen Beaver
							</td>
119
							<td>
120
								<?=htmlspecialchars($igmpentry['descr'])?>&nbsp;
121
							</td>
122
							<td>
123
								<a class="fa fa-pencil"	title="<?=gettext('Edit IGMP entry')?>" href="services_igmpproxy_edit.php?id=<?=$i?>"></a>
124
								<a class="fa fa-trash"	title="<?=gettext('Delete IGMP entry')?>" href="services_igmpproxy.php?act=del&amp;id=<?=$i?>"></a>
125
							</td>
126
						</tr>
127 3d0f579f sbeaver
<?php
128
	$i++;
129
endforeach;
130
?>
131 060ed238 Stephen Beaver
					</tbody>
132
				</table>
133
			</div>
134
		</div>
135 ac950976 Colin Fleming
	</div>
136 ce9abebd Ermal Luci
</form>
137 3d0f579f sbeaver
138 c10cb196 Stephen Beaver
<nav class="action-buttons">
139 c9679d8c Stephen Beaver
	<button id="submit" name="submit" type="submit" class="btn btn-primary btn-sm" value="<?=gettext("Save")?>">
140 9d5a20cf heper
		<i class="fa fa-save icon-embed-btn"></i>
141 c9679d8c Stephen Beaver
		<?=gettext("Save")?>
142
	</button>
143
	<a href="services_igmpproxy_edit.php" class="btn btn-success btn-sm">
144 9d5a20cf heper
		<i class="fa fa-plus icon-embed-btn"></i>
145 c9679d8c Stephen Beaver
		<?=gettext('Add')?>
146
	</a>
147
</nav>
148
149 35681930 Stephen Beaver
<div class="infoblock">
150 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. ' .
151 f6aebbcc NewEraCracker
					   'Only one "upstream" interface can be configured.'), 'info', false); ?>
152 c9679d8c Stephen Beaver
</div>
153 3d0f579f sbeaver
<?php
154 5d3914a9 heper
include("foot.inc");