Project

General

Profile

Download (5.5 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	interfaces_wireless.php
5
*/
6
/* ====================================================================
7
 *	Copyright (c)  2004-2015  Electric Sheep Fencing, LLC. All rights reserved.
8
 *  Copyright (c)  2010 Erik Fonnesbeck
9
 *
10
 *	Redistribution and use in source and binary forms, with or without modification,
11
 *	are permitted provided that the following conditions are met:
12
 *
13
 *	1. Redistributions of source code must retain the above copyright notice,
14
 *		this list of conditions and the following disclaimer.
15
 *
16
 *	2. Redistributions in binary form must reproduce the above copyright
17
 *		notice, this list of conditions and the following disclaimer in
18
 *		the documentation and/or other materials provided with the
19
 *		distribution.
20
 *
21
 *	3. All advertising materials mentioning features or use of this software
22
 *		must display the following acknowledgment:
23
 *		"This product includes software developed by the pfSense Project
24
 *		 for use in the pfSense software distribution. (http://www.pfsense.org/).
25
 *
26
 *	4. The names "pfSense" and "pfSense Project" must not be used to
27
 *		 endorse or promote products derived from this software without
28
 *		 prior written permission. For written permission, please contact
29
 *		 coreteam@pfsense.org.
30
 *
31
 *	5. Products derived from this software may not be called "pfSense"
32
 *		nor may "pfSense" appear in their names without prior written
33
 *		permission of the Electric Sheep Fencing, LLC.
34
 *
35
 *	6. Redistributions of any form whatsoever must retain the following
36
 *		acknowledgment:
37
 *
38
 *	"This product includes software developed by the pfSense Project
39
 *	for use in the pfSense software distribution (http://www.pfsense.org/).
40
 *
41
 *	THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
42
 *	EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43
 *	IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
44
 *	PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
45
 *	ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
46
 *	SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
47
 *	NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
48
 *	LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49
 *	HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
50
 *	STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
51
 *	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52
 *	OF THE POSSIBILITY OF SUCH DAMAGE.
53
 *
54
 *	====================================================================
55
 *
56
 */
57
/*
58
	pfSense_MODULE: interfaces_assign
59
*/
60

    
61
##|+PRIV
62
##|*IDENT=page-interfaces-wireless
63
##|*NAME=Interfaces: Wireless page
64
##|*DESCR=Allow access to the 'Interfaces: Wireless' page.
65
##|*MATCH=interfaces_wireless.php*
66
##|-PRIV
67

    
68
require("guiconfig.inc");
69

    
70
if (!is_array($config['wireless'])) {
71
	$config['wireless'] = array();
72
}
73
if (!is_array($config['wireless']['clone'])) {
74
	$config['wireless']['clone'] = array();
75
}
76

    
77
$a_clones = &$config['wireless']['clone'];
78

    
79
function clone_inuse($num) {
80
	global $config, $a_clones;
81

    
82
	$iflist = get_configured_interface_list(false, true);
83

    
84
	foreach ($iflist as $if) {
85
		if ($config['interfaces'][$if]['if'] == $a_clones[$num]['cloneif']) {
86
			return true;
87
		}
88
	}
89

    
90
	return false;
91
}
92

    
93
if ($_GET['act'] == "del") {
94
	/* check if still in use */
95
	if (clone_inuse($_GET['id'])) {
96
		$input_errors[] = gettext("This wireless clone cannot be deleted because it is assigned as an interface.");
97
	} else {
98
		mwexec("/sbin/ifconfig " . $a_clones[$_GET['id']]['cloneif'] . " destroy");
99
		unset($a_clones[$_GET['id']]);
100

    
101
		write_config();
102

    
103
		header("Location: interfaces_wireless.php");
104
		exit;
105
	}
106
}
107

    
108

    
109
$pgtitle = array(gettext("Interfaces"), gettext("Wireless"));
110
$shortcut_section = "wireless";
111
include("head.inc");
112

    
113
if ($input_errors)
114
	print_input_errors($input_errors); ?>
115

    
116
<?php
117
$tab_array = array();
118
$tab_array[] = array(gettext("Interface assignments"), false, "interfaces_assign.php");
119
$tab_array[] = array(gettext("Interface Groups"), false, "interfaces_groups.php");
120
$tab_array[] = array(gettext("Wireless"), true, "interfaces_wireless.php");
121
$tab_array[] = array(gettext("VLANs"), false, "interfaces_vlan.php");
122
$tab_array[] = array(gettext("QinQs"), false, "interfaces_qinq.php");
123
$tab_array[] = array(gettext("PPPs"), false, "interfaces_ppps.php");
124
$tab_array[] = array(gettext("GRE"), false, "interfaces_gre.php");
125
$tab_array[] = array(gettext("GIF"), false, "interfaces_gif.php");
126
$tab_array[] = array(gettext("Bridges"), false, "interfaces_bridge.php");
127
$tab_array[] = array(gettext("LAGG"), false, "interfaces_lagg.php");
128
display_top_tabs($tab_array);
129
?>
130

    
131
<div class="table-responsive">
132
	<table class="table table-striped table-hover table-condensed">
133
		<thead>
134
			<tr>
135
			  <th><?=gettext("Interface"); ?></th>
136
			  <th><?=gettext("Mode"); ?></th>
137
			  <th><?=gettext("Description"); ?></th>
138
			  <th></th>
139
			</tr>
140
		</thead>
141
		<tbody>
142
<?php
143

    
144
$i = 0;
145

    
146
foreach ($a_clones as $clone) {
147
?>
148
			<tr>
149
				<td>
150
					<?=htmlspecialchars($clone['cloneif'])?>
151
				</td>
152
				<td>
153
					<?= $wlan_modes[$clone['mode']]; ?>
154
				</td>
155
				<td>
156
					<?=htmlspecialchars($clone['descr'])?>
157
				</td>
158
				<td>
159
					<a href="interfaces_wireless_edit.php?id=<?=$i?>" class="btn btn-default btn-xs"><?=gettext("Edit")?></a>
160
					<a href="interfaces_wireless.php?act=del&amp;id=<?=$i?>" class="btn btn-danger btn-xs"><?=gettext("Delete")?></a>
161
				</td>
162
			</tr>
163
<?php
164
	$i++;
165
}
166
?>
167
		</tbody>
168
	</table>
169

    
170
	<nav class="action-buttons">
171
		<a href="interfaces_wireless_edit.php" class="btn btn-success"><?=gettext("Add")?></a>
172
	</nav>
173
</div>
174
<?php
175
include("foot.inc");
(100-100/233)