Project

General

Profile

Download (5.9 KB) Statistics
| Branch: | Tag: | Revision:
1 9f428275 Erik Fonnesbeck
<?php
2
/* $Id$ */
3
/*
4
	interfaces_wireless.php
5
6
	Copyright (C) 2010 Erik Fonnesbeck
7 ce77a9c4 Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
8 9f428275 Erik Fonnesbeck
	All rights reserved.
9
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31
/*
32
	pfSense_MODULE:	interfaces_assign
33
*/
34
35
##|+PRIV
36
##|*IDENT=page-interfaces-wireless
37
##|*NAME=Interfaces: Wireless page
38
##|*DESCR=Allow access to the 'Interfaces: Wireless' page.
39
##|*MATCH=interfaces_wireless.php*
40
##|-PRIV
41
42
require("guiconfig.inc");
43
44 6ef2297b Erik Fonnesbeck
if (!is_array($config['wireless']))
45
	$config['wireless'] = array();
46 9f428275 Erik Fonnesbeck
if (!is_array($config['wireless']['clone']))
47
	$config['wireless']['clone'] = array();
48
49 16120707 Erik Fonnesbeck
$a_clones = &$config['wireless']['clone'];
50 9f428275 Erik Fonnesbeck
51 16120707 Erik Fonnesbeck
function clone_inuse($num) {
52
	global $config, $a_clones;
53 9f428275 Erik Fonnesbeck
54 38b7d47d Erik Fonnesbeck
	$iflist = get_configured_interface_list(false, true);
55 9f428275 Erik Fonnesbeck
	foreach ($iflist as $if) {
56 16120707 Erik Fonnesbeck
		if ($config['interfaces'][$if]['if'] == $a_clones[$num]['cloneif'])
57 9f428275 Erik Fonnesbeck
			return true;
58
	}
59
60
	return false;
61
}
62
63
if ($_GET['act'] == "del") {
64
	/* check if still in use */
65 16120707 Erik Fonnesbeck
	if (clone_inuse($_GET['id'])) {
66 55344749 Rafael Lucas
		$input_errors[] = gettext("This wireless clone cannot be deleted because it is assigned as an interface.");
67 9f428275 Erik Fonnesbeck
	} else {
68
		mwexec("/sbin/ifconfig " . $a_clones[$_GET['id']]['cloneif'] . " destroy");
69
		unset($a_clones[$_GET['id']]);
70
71
		write_config();
72
73
		header("Location: interfaces_wireless.php");
74
		exit;
75
	}
76
}
77
78
79 95fcc82d Carlos Eduardo Ramos
$pgtitle = array(gettext("Interfaces"),gettext("Wireless"));
80 b32dd0a6 jim-p
$shortcut_section = "wireless";
81 9f428275 Erik Fonnesbeck
include("head.inc");
82
83
?>
84
85
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
86
<?php include("fbegin.inc"); ?>
87
<?php if ($input_errors) print_input_errors($input_errors); ?>
88 8cd56132 Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="interfaces wireless">
89 9f428275 Erik Fonnesbeck
  <tr><td>
90
<?php
91
	$tab_array = array();
92 55344749 Rafael Lucas
	$tab_array[0] = array(gettext("Interface assignments"), false, "interfaces_assign.php");
93
	$tab_array[1] = array(gettext("Interface Groups"), false, "interfaces_groups.php");
94
	$tab_array[2] = array(gettext("Wireless"), true, "interfaces_wireless.php");
95
	$tab_array[3] = array(gettext("VLANs"), false, "interfaces_vlan.php");
96
	$tab_array[4] = array(gettext("QinQs"), false, "interfaces_qinq.php");
97
	$tab_array[5] = array(gettext("PPPs"), false, "interfaces_ppps.php");
98
	$tab_array[6] = array(gettext("GRE"), false, "interfaces_gre.php");
99
	$tab_array[7] = array(gettext("GIF"), false, "interfaces_gif.php");
100
	$tab_array[8] = array(gettext("Bridges"), false, "interfaces_bridge.php");
101
	$tab_array[9] = array(gettext("LAGG"), false, "interfaces_lagg.php");
102 9f428275 Erik Fonnesbeck
	display_top_tabs($tab_array);
103
?>
104
  </td></tr>
105
  <tr>
106
    <td>
107
	<div id="mainarea">
108 8cd56132 Colin Fleming
	<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main table">
109 9f428275 Erik Fonnesbeck
                <tr>
110 55344749 Rafael Lucas
                  <td width="20%" class="listhdrr"><?=gettext("Interface");?></td>
111
                  <td width="20%" class="listhdrr"><?=gettext("Mode");?></td>
112
                  <td width="50%" class="listhdr"><?=gettext("Description");?></td>
113 9f428275 Erik Fonnesbeck
                  <td width="10%" class="list"></td>
114
				</tr>
115 306b8ff7 Erik Fonnesbeck
			  <?php $i = 0;
116 9f428275 Erik Fonnesbeck
					foreach ($a_clones as $clone): ?>
117 306b8ff7 Erik Fonnesbeck
                <tr ondblclick="document.location='interfaces_wireless_edit.php?id=<?=$i;?>'">
118 9f428275 Erik Fonnesbeck
                  <td class="listlr">
119
					<?=htmlspecialchars($clone['cloneif']);?>
120
                  </td>
121
                  <td class="listr">
122 651fff4f Erik Fonnesbeck
					<?= $wlan_modes[$clone['mode']]; ?>
123 9f428275 Erik Fonnesbeck
                  </td>
124
                  <td class="listbg">
125
                    <?=htmlspecialchars($clone['descr']);?>&nbsp;
126
                  </td>
127 8cd56132 Colin Fleming
                  <td valign="middle" class="list nowrap"> <a href="interfaces_wireless_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" ></a>
128
                     &nbsp;<a href="interfaces_wireless.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this wireless clone?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td>
129 9f428275 Erik Fonnesbeck
				</tr>
130
			  <?php $i++; endforeach; ?>
131
                <tr>
132
                  <td class="list" colspan="3">&nbsp;</td>
133 8cd56132 Colin Fleming
                  <td class="list"> <a href="interfaces_wireless_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="edit" /></a></td>
134
			</tr>
135 9f428275 Erik Fonnesbeck
				<tr>
136
				<td colspan="3" class="list"><p class="vexpl"><span class="red"><strong>
137 8cd558b6 ayvis
				  <?=gettext("Note");?>:<br />
138 9f428275 Erik Fonnesbeck
				  </strong></span>
139 8cd56132 Colin Fleming
				  <?=gettext("Here you can configure clones of wireless interfaces, which can be assigned as separate independent interfaces. Only available on wireless chipsets that support this, with limitations on the number that can be created in each mode.");?></p>
140 9f428275 Erik Fonnesbeck
				  </td>
141
				<td class="list">&nbsp;</td>
142
				</tr>
143
              </table>
144
	      </div>
145
	</td>
146
	</tr>
147
</table>
148
<?php include("fend.inc"); ?>
149
</body>
150
</html>