Project

General

Profile

Download (5.72 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
 * interfaces_wireless.php
4
 *
5
 * part of pfSense (https://www.pfsense.org)
6
 * Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
7
 * Copyright (c) 2010 Erik Fonnesbeck
8
 * All rights reserved.
9
 *
10
 * Redistribution and use in source and binary forms, with or without
11
 * modification, 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
##|+PRIV
56
##|*IDENT=page-interfaces-wireless
57
##|*NAME=Interfaces: Wireless
58
##|*DESCR=Allow access to the 'Interfaces: Wireless' page.
59
##|*MATCH=interfaces_wireless.php*
60
##|-PRIV
61

    
62
require_once("guiconfig.inc");
63

    
64
if (!is_array($config['wireless'])) {
65
	$config['wireless'] = array();
66
}
67
if (!is_array($config['wireless']['clone'])) {
68
	$config['wireless']['clone'] = array();
69
}
70

    
71
$a_clones = &$config['wireless']['clone'];
72

    
73
function clone_inuse($num) {
74
	global $config, $a_clones;
75

    
76
	$iflist = get_configured_interface_list(false, true);
77

    
78
	foreach ($iflist as $if) {
79
		if ($config['interfaces'][$if]['if'] == $a_clones[$num]['cloneif']) {
80
			return true;
81
		}
82
	}
83

    
84
	return false;
85
}
86

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

    
95
		write_config();
96

    
97
		header("Location: interfaces_wireless.php");
98
		exit;
99
	}
100
}
101

    
102

    
103
$pgtitle = array(gettext("Interfaces"), gettext("Wireless"));
104
$shortcut_section = "wireless";
105
include("head.inc");
106

    
107
if ($input_errors) {
108
	print_input_errors($input_errors);
109
}
110

    
111
$tab_array = array();
112
$tab_array[] = array(gettext("Interface Assignments"), false, "interfaces_assign.php");
113
$tab_array[] = array(gettext("Interface Groups"), false, "interfaces_groups.php");
114
$tab_array[] = array(gettext("Wireless"), true, "interfaces_wireless.php");
115
$tab_array[] = array(gettext("VLANs"), false, "interfaces_vlan.php");
116
$tab_array[] = array(gettext("QinQs"), false, "interfaces_qinq.php");
117
$tab_array[] = array(gettext("PPPs"), false, "interfaces_ppps.php");
118
$tab_array[] = array(gettext("GREs"), false, "interfaces_gre.php");
119
$tab_array[] = array(gettext("GIFs"), false, "interfaces_gif.php");
120
$tab_array[] = array(gettext("Bridges"), false, "interfaces_bridge.php");
121
$tab_array[] = array(gettext("LAGGs"), false, "interfaces_lagg.php");
122
display_top_tabs($tab_array);
123
?>
124
<div class="panel panel-default">
125
	<div class="panel-heading"><h2 class="panel-title"><?=gettext('Wireless Interfaces')?></h2></div>
126
	<div class="panel-body">
127
		<div class="table-responsive">
128
			<table class="table table-striped table-hover table-condensed table-rowdblclickedit">
129
				<thead>
130
					<tr>
131
						<th><?=gettext("Interface"); ?></th>
132
						<th><?=gettext("Mode"); ?></th>
133
						<th><?=gettext("Description"); ?></th>
134
						<th><?=gettext("Actions"); ?></th>
135
					</tr>
136
				</thead>
137
				<tbody>
138
<?php
139

    
140
$i = 0;
141

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

    
169
<nav class="action-buttons">
170
	<a href="interfaces_wireless_edit.php" class="btn btn-success btn-sm">
171
		<i class="fa fa-plus icon-embed-btn"></i>
172
		<?=gettext("Add")?></a>
173
</nav>
174
<?php
175
include("foot.inc");
(86-86/227)