Project

General

Profile

Download (4.12 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-2021 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("Wireless interface deleted");
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("VXLANs"), false, "interfaces_vxlan.php");
85
$tab_array[] = array(gettext("Bridges"), false, "interfaces_bridge.php");
86
$tab_array[] = array(gettext("LAGGs"), false, "interfaces_lagg.php");
87
display_top_tabs($tab_array);
88
?>
89
<div class="panel panel-default">
90
	<div class="panel-heading"><h2 class="panel-title"><?=gettext('Wireless Interfaces')?></h2></div>
91
	<div class="panel-body">
92
		<div class="table-responsive">
93
			<table class="table table-striped table-hover table-condensed table-rowdblclickedit">
94
				<thead>
95
					<tr>
96
						<th><?=gettext("Interface"); ?></th>
97
						<th><?=gettext("Mode"); ?></th>
98
						<th><?=gettext("Description"); ?></th>
99
						<th><?=gettext("Actions"); ?></th>
100
					</tr>
101
				</thead>
102
				<tbody>
103
<?php
104

    
105
$i = 0;
106

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

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