Project

General

Profile

Download (3.93 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-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
init_config_arr(array('wireless', 'clone'));
33
$a_clones = &$config['wireless']['clone'];
34

    
35
function clone_inuse($num) {
36
	global $config, $a_clones;
37

    
38
	$iflist = get_configured_interface_list(true);
39

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

    
46
	return false;
47
}
48

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

    
57
		write_config();
58

    
59
		header("Location: interfaces_wireless.php");
60
		exit;
61
	}
62
}
63

    
64

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

    
69
if ($input_errors) {
70
	print_input_errors($input_errors);
71
}
72

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

    
102
$i = 0;
103

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

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