Project

General

Profile

Download (4.11 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-2024 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
function clone_inuse($num) {
35
	$a_clones = config_get_path('wireless/clone', []);
36
	$iflist = get_configured_interface_list(true);
37
	$if_config = config_get_path('interfaces', []);
38
	foreach ($iflist as $if) {
39
		if ($if_config[$if]['if'] == $a_clones[$num]['cloneif']) {
40
			return true;
41
		}
42
	}
43

    
44
	return false;
45
}
46

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

    
55
		write_config("Wireless interface deleted");
56

    
57
		header("Location: interfaces_wireless.php");
58
		exit;
59
	}
60
}
61

    
62

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

    
67
if ($input_errors) {
68
	print_input_errors($input_errors);
69
}
70

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

    
100
$i = 0;
101

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

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