Project

General

Profile

Download (4.02 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-2013 BSD Perimeter
7
 * Copyright (c) 2013-2016 Electric Sheep Fencing
8
 * Copyright (c) 2014-2020 Rubicon Communications, LLC (Netgate)
9
 * Copyright (c) 2010 Erik Fonnesbeck
10
 * All rights reserved.
11
 *
12
 * Licensed under the Apache License, Version 2.0 (the "License");
13
 * you may not use this file except in compliance with the License.
14
 * You may obtain a copy of the License at
15
 *
16
 * http://www.apache.org/licenses/LICENSE-2.0
17
 *
18
 * Unless required by applicable law or agreed to in writing, software
19
 * distributed under the License is distributed on an "AS IS" BASIS,
20
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
 * See the License for the specific language governing permissions and
22
 * limitations under the License.
23
 */
24

    
25
##|+PRIV
26
##|*IDENT=page-interfaces-wireless
27
##|*NAME=Interfaces: Wireless
28
##|*DESCR=Allow access to the 'Interfaces: Wireless' page.
29
##|*MATCH=interfaces_wireless.php*
30
##|-PRIV
31

    
32
require_once("guiconfig.inc");
33

    
34
init_config_arr(array('wireless', 'clone'));
35
$a_clones = &$config['wireless']['clone'];
36

    
37
function clone_inuse($num) {
38
	global $config, $a_clones;
39

    
40
	$iflist = get_configured_interface_list(true);
41

    
42
	foreach ($iflist as $if) {
43
		if ($config['interfaces'][$if]['if'] == $a_clones[$num]['cloneif']) {
44
			return true;
45
		}
46
	}
47

    
48
	return false;
49
}
50

    
51
if ($_POST['act'] == "del") {
52
	/* check if still in use */
53
	if (clone_inuse($_POST['id'])) {
54
		$input_errors[] = gettext("This wireless clone cannot be deleted because it is assigned as an interface.");
55
	} else {
56
		pfSense_interface_destroy($a_clones[$_POST['id']]['cloneif']);
57
		unset($a_clones[$_POST['id']]);
58

    
59
		write_config();
60

    
61
		header("Location: interfaces_wireless.php");
62
		exit;
63
	}
64
}
65

    
66

    
67
$pgtitle = array(gettext("Interfaces"), gettext("Wireless"));
68
$shortcut_section = "wireless";
69
include("head.inc");
70

    
71
if ($input_errors) {
72
	print_input_errors($input_errors);
73
}
74

    
75
$tab_array = array();
76
$tab_array[] = array(gettext("Interface Assignments"), false, "interfaces_assign.php");
77
$tab_array[] = array(gettext("Interface Groups"), false, "interfaces_groups.php");
78
$tab_array[] = array(gettext("Wireless"), true, "interfaces_wireless.php");
79
$tab_array[] = array(gettext("VLANs"), false, "interfaces_vlan.php");
80
$tab_array[] = array(gettext("QinQs"), false, "interfaces_qinq.php");
81
$tab_array[] = array(gettext("PPPs"), false, "interfaces_ppps.php");
82
$tab_array[] = array(gettext("GREs"), false, "interfaces_gre.php");
83
$tab_array[] = array(gettext("GIFs"), false, "interfaces_gif.php");
84
$tab_array[] = array(gettext("Bridges"), false, "interfaces_bridge.php");
85
$tab_array[] = array(gettext("LAGGs"), false, "interfaces_lagg.php");
86
display_top_tabs($tab_array);
87
?>
88
<div class="panel panel-default">
89
	<div class="panel-heading"><h2 class="panel-title"><?=gettext('Wireless Interfaces')?></h2></div>
90
	<div class="panel-body">
91
		<div class="table-responsive">
92
			<table class="table table-striped table-hover table-condensed table-rowdblclickedit">
93
				<thead>
94
					<tr>
95
						<th><?=gettext("Interface"); ?></th>
96
						<th><?=gettext("Mode"); ?></th>
97
						<th><?=gettext("Description"); ?></th>
98
						<th><?=gettext("Actions"); ?></th>
99
					</tr>
100
				</thead>
101
				<tbody>
102
<?php
103

    
104
$i = 0;
105

    
106
foreach ($a_clones as $clone) {
107
?>
108
					<tr>
109
						<td>
110
							<?=htmlspecialchars($clone['cloneif'])?>
111
						</td>
112
						<td>
113
							<?= $wlan_modes[$clone['mode']]; ?>
114
						</td>
115
						<td>
116
							<?=htmlspecialchars($clone['descr'])?>
117
						</td>
118
						<td>
119
							<a class="fa fa-pencil"	title="<?=gettext('Edit WiFi interface')?>"	href="interfaces_wireless_edit.php?id=<?=$i?>"></a>
120
							<a class="fa fa-trash"	title="<?=gettext('Delete WiFi interface')?>"	href="interfaces_wireless.php?act=del&amp;id=<?=$i?>" usepost></a>
121
						</td>
122
					</tr>
123
<?php
124
	$i++;
125
}
126
?>
127
				</tbody>
128
			</table>
129
		</div>
130
	</div>
131
</div>
132

    
133
<nav class="action-buttons">
134
	<a href="interfaces_wireless_edit.php" class="btn btn-success btn-sm">
135
		<i class="fa fa-plus icon-embed-btn"></i>
136
		<?=gettext("Add")?></a>
137
</nav>
138
<?php
139
include("foot.inc");
(90-90/227)