Project

General

Profile

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