Project

General

Profile

Download (6.26 KB) Statistics
| Branch: | Tag: | Revision:

univnautes / usr / local / www / services_igmpproxy.php @ a1b66bec

1
<?php
2
/* $Id$ */
3
/*
4
	services_igmpproxy.php
5
	
6
	Copyright (C) 2009 Ermal Luçi
7
	Copyright (C) 2004 Scott Ullrich
8
	All rights reserved.
9

    
10
	originally part of m0n0wall (http://m0n0.ch/wall)
11
	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
/*
36
	pfSense_MODULE:	dyndns
37
*/
38

    
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

    
67
	clear_subsystem_dirty('igmpproxy');
68
}
69

    
70
if ($_GET['act'] == "del") {
71
	if ($a_igmpproxy[$_GET['id']]) {
72
		unset($a_igmpproxy[$_GET['id']]);
73
		write_config();
74
		mark_subsystem_dirty('igmpproxy');
75
		header("Location: services_igmpproxy.php");
76
		exit;
77
	}
78
}
79

    
80
$pgtitle = array(gettext("Services"),gettext("IGMP Proxy"));
81
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
<?php if (is_subsystem_dirty('igmpproxy')): ?><br/>
90
<?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
<?php endif; ?>
92

    
93
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="igmp proxy">
94
<tr>
95
  <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
  <td width="5%" class="list">
100
    <table border="0" cellspacing="0" cellpadding="1" summary="add">
101
      <tr>
102
	<td valign="middle" width="17">&nbsp;</td>
103
        <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
      </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
    <?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($igmpentry['ifname']));?>
112
  </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
  <td valign="middle" class="list nowrap">
131
    <table border="0" cellspacing="0" cellpadding="1" summary="icons">
132
      <tr>
133
        <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
        <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
      </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
        <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
      </tr>
148
    </table>
149
  </td>
150
</tr>
151
  <tr>
152
    <td colspan="2" width="78%">
153
	<br />
154
      <input id="submit" name="submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
155
	<br />
156
    </td>
157
  </tr>
158
<tr>
159
  <td class="tabcont" colspan="4">
160
   <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
  </td>
162
</tr>
163
</table>
164
</form>
165
<?php include("fend.inc"); ?>
166
</body>
167
</html>
(161-161/256)