Project

General

Profile

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

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

1
<?php
2
/* $Id$ */
3
/*
4
	interfaces_wireless.php
5

    
6
	Copyright (C) 2010 Erik Fonnesbeck
7
	All rights reserved.
8

    
9
	Redistribution and use in source and binary forms, with or without
10
	modification, are permitted provided that the following conditions are met:
11

    
12
	1. Redistributions of source code must retain the above copyright notice,
13
	   this list of conditions and the following disclaimer.
14

    
15
	2. Redistributions in binary form must reproduce the above copyright
16
	   notice, this list of conditions and the following disclaimer in the
17
	   documentation and/or other materials provided with the distribution.
18

    
19
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
	POSSIBILITY OF SUCH DAMAGE.
29
*/
30
/*
31
	pfSense_MODULE:	interfaces_assign
32
*/
33

    
34
##|+PRIV
35
##|*IDENT=page-interfaces-wireless
36
##|*NAME=Interfaces: Wireless page
37
##|*DESCR=Allow access to the 'Interfaces: Wireless' page.
38
##|*MATCH=interfaces_wireless.php*
39
##|-PRIV
40

    
41
require("guiconfig.inc");
42

    
43
if (!is_array($config['wireless']))
44
	$config['wireless'] = array();
45
if (!is_array($config['wireless']['clone']))
46
	$config['wireless']['clone'] = array();
47

    
48
$a_clones = &$config['wireless']['clone'];
49

    
50
function clone_inuse($num) {
51
	global $config, $a_clones;
52

    
53
	$iflist = get_configured_interface_list(false, true);
54
	foreach ($iflist as $if) {
55
		if ($config['interfaces'][$if]['if'] == $a_clones[$num]['cloneif'])
56
			return true;
57
	}
58

    
59
	return false;
60
}
61

    
62
if ($_GET['act'] == "del") {
63
	/* check if still in use */
64
	if (clone_inuse($_GET['id'])) {
65
		$input_errors[] = gettext("This wireless clone cannot be deleted because it is assigned as an interface.");
66
	} else {
67
		mwexec("/sbin/ifconfig " . $a_clones[$_GET['id']]['cloneif'] . " destroy");
68
		unset($a_clones[$_GET['id']]);
69

    
70
		write_config();
71

    
72
		header("Location: interfaces_wireless.php");
73
		exit;
74
	}
75
}
76

    
77

    
78
$pgtitle = array(gettext("Interfaces"),gettext("Wireless"));
79
$shortcut_section = "wireless";
80
include("head.inc");
81

    
82
?>
83

    
84
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
85
<?php include("fbegin.inc"); ?>
86
<?php if ($input_errors) print_input_errors($input_errors); ?>
87
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="interfaces wireless">
88
  <tr><td>
89
<?php
90
	$tab_array = array();
91
	$tab_array[0] = array(gettext("Interface assignments"), false, "interfaces_assign.php");
92
	$tab_array[1] = array(gettext("Interface Groups"), false, "interfaces_groups.php");
93
	$tab_array[2] = array(gettext("Wireless"), true, "interfaces_wireless.php");
94
	$tab_array[3] = array(gettext("VLANs"), false, "interfaces_vlan.php");
95
	$tab_array[4] = array(gettext("QinQs"), false, "interfaces_qinq.php");
96
	$tab_array[5] = array(gettext("PPPs"), false, "interfaces_ppps.php");
97
	$tab_array[6] = array(gettext("GRE"), false, "interfaces_gre.php");
98
	$tab_array[7] = array(gettext("GIF"), false, "interfaces_gif.php");
99
	$tab_array[8] = array(gettext("Bridges"), false, "interfaces_bridge.php");
100
	$tab_array[9] = array(gettext("LAGG"), false, "interfaces_lagg.php");
101
	display_top_tabs($tab_array);
102
?>
103
  </td></tr>
104
  <tr>
105
    <td>
106
	<div id="mainarea">
107
	<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main table">
108
                <tr>
109
                  <td width="20%" class="listhdrr"><?=gettext("Interface");?></td>
110
                  <td width="20%" class="listhdrr"><?=gettext("Mode");?></td>
111
                  <td width="50%" class="listhdr"><?=gettext("Description");?></td>
112
                  <td width="10%" class="list"></td>
113
				</tr>
114
			  <?php $i = 0;
115
					foreach ($a_clones as $clone): ?>
116
                <tr ondblclick="document.location='interfaces_wireless_edit.php?id=<?=$i;?>'">
117
                  <td class="listlr">
118
					<?=htmlspecialchars($clone['cloneif']);?>
119
                  </td>
120
                  <td class="listr">
121
					<?= $wlan_modes[$clone['mode']]; ?>
122
                  </td>
123
                  <td class="listbg">
124
                    <?=htmlspecialchars($clone['descr']);?>&nbsp;
125
                  </td>
126
                  <td valign="middle" class="list nowrap"> <a href="interfaces_wireless_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" ></a>
127
                     &nbsp;<a href="interfaces_wireless.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this wireless clone?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td>
128
				</tr>
129
			  <?php $i++; endforeach; ?>
130
                <tr>
131
                  <td class="list" colspan="3">&nbsp;</td>
132
                  <td class="list"> <a href="interfaces_wireless_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="edit" /></a></td>
133
			</tr>
134
				<tr>
135
				<td colspan="3" class="list"><p class="vexpl"><span class="red"><strong>
136
				  <?=gettext("Note");?>:<br />
137
				  </strong></span>
138
				  <?=gettext("Here you can configure clones of wireless interfaces, which can be assigned as separate independent interfaces. Only available on wireless chipsets that support this, with limitations on the number that can be created in each mode.");?></p>
139
				  </td>
140
				<td class="list">&nbsp;</td>
141
				</tr>
142
              </table>
143
	      </div>
144
	</td>
145
	</tr>
146
</table>
147
<?php include("fend.inc"); ?>
148
</body>
149
</html>
(113-113/256)