1
|
<?php
|
2
|
/*
|
3
|
* interfaces_wireless.php
|
4
|
*
|
5
|
* part of pfSense (https://www.pfsense.org)
|
6
|
* Copyright (c) 2004-2018 Rubicon Communications, LLC (Netgate)
|
7
|
* Copyright (c) 2010 Erik Fonnesbeck
|
8
|
* All rights reserved.
|
9
|
*
|
10
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
* you may not use this file except in compliance with the License.
|
12
|
* You may obtain a copy of the License at
|
13
|
*
|
14
|
* http://www.apache.org/licenses/LICENSE-2.0
|
15
|
*
|
16
|
* Unless required by applicable law or agreed to in writing, software
|
17
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
* See the License for the specific language governing permissions and
|
20
|
* limitations under the License.
|
21
|
*/
|
22
|
|
23
|
##|+PRIV
|
24
|
##|*IDENT=page-interfaces-wireless
|
25
|
##|*NAME=Interfaces: Wireless
|
26
|
##|*DESCR=Allow access to the 'Interfaces: Wireless' page.
|
27
|
##|*MATCH=interfaces_wireless.php*
|
28
|
##|-PRIV
|
29
|
|
30
|
require_once("guiconfig.inc");
|
31
|
|
32
|
if (!is_array($config['wireless'])) {
|
33
|
$config['wireless'] = array();
|
34
|
}
|
35
|
if (!is_array($config['wireless']['clone'])) {
|
36
|
$config['wireless']['clone'] = array();
|
37
|
}
|
38
|
|
39
|
$a_clones = &$config['wireless']['clone'];
|
40
|
|
41
|
function clone_inuse($num) {
|
42
|
global $config, $a_clones;
|
43
|
|
44
|
$iflist = get_configured_interface_list(true);
|
45
|
|
46
|
foreach ($iflist as $if) {
|
47
|
if ($config['interfaces'][$if]['if'] == $a_clones[$num]['cloneif']) {
|
48
|
return true;
|
49
|
}
|
50
|
}
|
51
|
|
52
|
return false;
|
53
|
}
|
54
|
|
55
|
if ($_POST['act'] == "del") {
|
56
|
/* check if still in use */
|
57
|
if (clone_inuse($_POST['id'])) {
|
58
|
$input_errors[] = gettext("This wireless clone cannot be deleted because it is assigned as an interface.");
|
59
|
} else {
|
60
|
pfSense_interface_destroy($a_clones[$_POST['id']]['cloneif']);
|
61
|
unset($a_clones[$_POST['id']]);
|
62
|
|
63
|
write_config();
|
64
|
|
65
|
header("Location: interfaces_wireless.php");
|
66
|
exit;
|
67
|
}
|
68
|
}
|
69
|
|
70
|
|
71
|
$pgtitle = array(gettext("Interfaces"), gettext("Wireless"));
|
72
|
$shortcut_section = "wireless";
|
73
|
include("head.inc");
|
74
|
|
75
|
if ($input_errors) {
|
76
|
print_input_errors($input_errors);
|
77
|
}
|
78
|
|
79
|
$tab_array = array();
|
80
|
$tab_array[] = array(gettext("Interface Assignments"), false, "interfaces_assign.php");
|
81
|
$tab_array[] = array(gettext("Interface Groups"), false, "interfaces_groups.php");
|
82
|
$tab_array[] = array(gettext("Wireless"), true, "interfaces_wireless.php");
|
83
|
$tab_array[] = array(gettext("VLANs"), false, "interfaces_vlan.php");
|
84
|
$tab_array[] = array(gettext("QinQs"), false, "interfaces_qinq.php");
|
85
|
$tab_array[] = array(gettext("PPPs"), false, "interfaces_ppps.php");
|
86
|
$tab_array[] = array(gettext("GREs"), false, "interfaces_gre.php");
|
87
|
$tab_array[] = array(gettext("GIFs"), false, "interfaces_gif.php");
|
88
|
$tab_array[] = array(gettext("Bridges"), false, "interfaces_bridge.php");
|
89
|
$tab_array[] = array(gettext("LAGGs"), false, "interfaces_lagg.php");
|
90
|
display_top_tabs($tab_array);
|
91
|
?>
|
92
|
<div class="panel panel-default">
|
93
|
<div class="panel-heading"><h2 class="panel-title"><?=gettext('Wireless Interfaces')?></h2></div>
|
94
|
<div class="panel-body">
|
95
|
<div class="table-responsive">
|
96
|
<table class="table table-striped table-hover table-condensed table-rowdblclickedit">
|
97
|
<thead>
|
98
|
<tr>
|
99
|
<th><?=gettext("Interface"); ?></th>
|
100
|
<th><?=gettext("Mode"); ?></th>
|
101
|
<th><?=gettext("Description"); ?></th>
|
102
|
<th><?=gettext("Actions"); ?></th>
|
103
|
</tr>
|
104
|
</thead>
|
105
|
<tbody>
|
106
|
<?php
|
107
|
|
108
|
$i = 0;
|
109
|
|
110
|
foreach ($a_clones as $clone) {
|
111
|
?>
|
112
|
<tr>
|
113
|
<td>
|
114
|
<?=htmlspecialchars($clone['cloneif'])?>
|
115
|
</td>
|
116
|
<td>
|
117
|
<?= $wlan_modes[$clone['mode']]; ?>
|
118
|
</td>
|
119
|
<td>
|
120
|
<?=htmlspecialchars($clone['descr'])?>
|
121
|
</td>
|
122
|
<td>
|
123
|
<a class="fa fa-pencil" title="<?=gettext('Edit WiFi interface')?>" href="interfaces_wireless_edit.php?id=<?=$i?>"></a>
|
124
|
<a class="fa fa-trash" title="<?=gettext('Delete WiFi interface')?>" href="interfaces_wireless.php?act=del&id=<?=$i?>" usepost></a>
|
125
|
</td>
|
126
|
</tr>
|
127
|
<?php
|
128
|
$i++;
|
129
|
}
|
130
|
?>
|
131
|
</tbody>
|
132
|
</table>
|
133
|
</div>
|
134
|
</div>
|
135
|
</div>
|
136
|
|
137
|
<nav class="action-buttons">
|
138
|
<a href="interfaces_wireless_edit.php" class="btn btn-success btn-sm">
|
139
|
<i class="fa fa-plus icon-embed-btn"></i>
|
140
|
<?=gettext("Add")?></a>
|
141
|
</nav>
|
142
|
<?php
|
143
|
include("foot.inc");
|