Project

General

Profile

Download (6.32 KB) Statistics
| Branch: | Tag: | Revision:
1 ce9abebd Ermal Luci
<?php
2
/* $Id$ */
3
/*
4
	services_igmpproxy.php
5 8ec0b9d0 Ermal Luci
	
6 dd447bde Jim Thompson
        Copyright (C) 2013-2014 Electric Sheep Fencing, LP
7 1d7ba683 ayvis
	Copyright (C) 2009 Ermal Luçi
8 ce9abebd Ermal Luci
	Copyright (C) 2004 Scott Ullrich
9
	All rights reserved.
10
11 8913533d Phil Davis
	originally part of m0n0wall (http://m0n0.ch/wall)
12 ce9abebd Ermal Luci
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
13
	All rights reserved.
14
15
	Redistribution and use in source and binary forms, with or without
16
	modification, are permitted provided that the following conditions are met:
17
18
	1. Redistributions of source code must retain the above copyright notice,
19
	   this list of conditions and the following disclaimer.
20
21
	2. Redistributions in binary form must reproduce the above copyright
22
	   notice, this list of conditions and the following disclaimer in the
23
	   documentation and/or other materials provided with the distribution.
24
25
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
26
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
27
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
29
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
	POSSIBILITY OF SUCH DAMAGE.
35
*/
36 1d333258 Scott Ullrich
/*
37
	pfSense_MODULE:	dyndns
38
*/
39 ce9abebd Ermal Luci
40
##|+PRIV
41
##|*IDENT=page-services-igmpproxy
42
##|*NAME=Services: Igmpproxy page
43
##|*DESCR=Allow access to the 'Services: Igmpproxy' page.
44
##|*MATCH=services_igmpproxy.php*
45
##|-PRIV
46
47
require("guiconfig.inc");
48
49
if (!is_array($config['igmpproxy']['igmpentry']))
50
	$config['igmpproxy']['igmpentry'] = array();
51
52
//igmpproxy_sort();
53
$a_igmpproxy = &$config['igmpproxy']['igmpentry'];
54
55
if ($_POST) {
56
57
	$pconfig = $_POST;
58
59
	$retval = 0;
60
	/* reload all components that use igmpproxy */
61
	$retval = services_igmpproxy_configure();
62
63
	if(stristr($retval, "error") <> true)
64
	    $savemsg = get_std_save_message($retval);
65
	else
66
	    $savemsg = $retval;
67 6833c9cd Ermal Lu?i
68
	clear_subsystem_dirty('igmpproxy');
69 ce9abebd Ermal Luci
}
70
71
if ($_GET['act'] == "del") {
72
	if ($a_igmpproxy[$_GET['id']]) {
73
		unset($a_igmpproxy[$_GET['id']]);
74
		write_config();
75 4bbfe029 Ermal Lu?i
		mark_subsystem_dirty('igmpproxy');
76 ce9abebd Ermal Luci
		header("Location: services_igmpproxy.php");
77
		exit;
78
	}
79
}
80
81 fca6dabc Rafael Lucas
$pgtitle = array(gettext("Services"),gettext("IGMP Proxy"));
82 ce9abebd Ermal Luci
include("head.inc");
83
84
?>
85
86
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
87
<?php include("fbegin.inc"); ?>
88
<form action="services_igmpproxy.php" method="post">
89
<?php if ($savemsg) print_info_box($savemsg); ?>
90 1fb1117c Colin Fleming
<?php if (is_subsystem_dirty('igmpproxy')): ?><br/>
91 1d7ba683 ayvis
<?php print_info_box_np(gettext("The IGMP entry list has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?>
92 ce9abebd Ermal Luci
<?php endif; ?>
93
94 1fb1117c Colin Fleming
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="igmp proxy">
95 ce9abebd Ermal Luci
<tr>
96 fca6dabc Rafael Lucas
  <td width="15%" class="listhdrr"><?=gettext("Name");?></td>
97
  <td width="10%" class="listhdrr"><?=gettext("Type");?></td>
98
  <td width="25%" class="listhdrr"><?=gettext("Values");?></td>
99
  <td width="25%" class="listhdr"><?=gettext("Description");?></td>
100 ce9abebd Ermal Luci
  <td width="5%" class="list">
101 1fb1117c Colin Fleming
    <table border="0" cellspacing="0" cellpadding="1" summary="add">
102 ce9abebd Ermal Luci
      <tr>
103
	<td valign="middle" width="17">&nbsp;</td>
104 1fb1117c Colin Fleming
        <td valign="middle"><a href="services_igmpproxy_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new igmpentry");?>" alt="add" /></a></td>
105 ce9abebd Ermal Luci
      </tr>
106
    </table>
107
  </td>
108
</tr>
109
	  <?php $i = 0; foreach ($a_igmpproxy as $igmpentry): ?>
110
<tr>
111
  <td class="listlr" ondblclick="document.location='services_igmpproxy_edit.php?id=<?=$i;?>';">
112 1e8635e8 Renato Botelho
    <?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($igmpentry['ifname']));?>
113 ce9abebd Ermal Luci
  </td>
114
  <td class="listlr" ondblclick="document.location='services_igmpproxy_edit.php?id=<?=$i;?>';">
115
    <?=htmlspecialchars($igmpentry['type']);?>
116
  </td>
117
  <td class="listr" ondblclick="document.location='services_igmpproxy_edit.php?id=<?=$i;?>';">
118
      <?php
119
	$addresses = implode(", ", array_slice(explode(" ", $igmpentry['address']), 0, 10));
120
	echo $addresses;
121
	if(count($addresses) < 10) {
122
		echo " ";
123
	} else {
124
		echo "...";
125
	}
126
    ?>
127
  </td>
128
  <td class="listbg" ondblclick="document.location='services_igmpproxy_edit.php?id=<?=$i;?>';">
129
    <?=htmlspecialchars($igmpentry['descr']);?>&nbsp;
130
  </td>
131 0f8af922 Colin Fleming
  <td valign="middle" class="list nowrap">
132 1fb1117c Colin Fleming
    <table border="0" cellspacing="0" cellpadding="1" summary="icons">
133 ce9abebd Ermal Luci
      <tr>
134 1fb1117c Colin Fleming
        <td valign="middle"><a href="services_igmpproxy_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit igmpentry"); ?>" alt="edit" /></a></td>
135 8913533d Phil Davis
        <td><a href="services_igmpproxy.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this igmp entry? All elements that still use it will become invalid (e.g. filter rules)!");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete igmpentry");?>" alt="delete" /></a></td>
136 ce9abebd Ermal Luci
      </tr>
137
    </table>
138
  </td>
139
</tr>
140
	  <?php $i++; endforeach; ?>
141
<tr>
142
  <td class="list" colspan="4"></td>
143
  <td class="list">
144
    <table border="0" cellspacing="0" cellpadding="1">
145
      <tr>
146
	<td valign="middle" width="17">&nbsp;</td>
147 1fb1117c Colin Fleming
        <td valign="middle"><a href="services_igmpproxy_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new igmpentry");?>" alt="add" /></a></td>
148 ce9abebd Ermal Luci
      </tr>
149
    </table>
150
  </td>
151
</tr>
152
  <tr>
153
    <td colspan="2" width="78%">
154
	<br />
155 fca6dabc Rafael Lucas
      <input id="submit" name="submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
156 ce9abebd Ermal Luci
	<br />
157
    </td>
158
  </tr>
159
<tr>
160
  <td class="tabcont" colspan="4">
161 1d7ba683 ayvis
   <p><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br /></strong></span><?=gettext("Please add the interface for upstream, the allowed subnets, and the downstream interfaces you would like the proxy to allow. Only one 'upstream' interface can be configured.");?></span></p>
162 ce9abebd Ermal Luci
  </td>
163
</tr>
164
</table>
165
</form>
166
<?php include("fend.inc"); ?>
167
</body>
168
</html>