Project

General

Profile

« Previous | Next » 

Revision 87489e5c

Added by Peter Schofield over 7 years ago

re-adding changes made to fix bug#6400, includes fixes for bug#8222 and bug#8223 that were introduced with the initial commit of this code.

original pull request was #3868

View differences:

src/usr/local/www/interfaces_vlan.php
3 3
 * interfaces_vlan.php
4 4
 *
5 5
 * part of pfSense (https://www.pfsense.org)
6
 * Copyright (c) 2004-2018 Rubicon Communications, LLC (Netgate)
6
 * Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
7 7
 * All rights reserved.
8 8
 *
9 9
 * originally based on m0n0wall (http://m0n0.ch/wall)
......
27 27
##|*IDENT=page-interfaces-vlan
28 28
##|*NAME=Interfaces: VLAN
29 29
##|*DESCR=Allow access to the 'Interfaces: VLAN' page.
30
##|*MATCH=interfaces_vlan.php*
30
##|*MATCH=interfaces_vlan_new_prof.php*
31 31
##|-PRIV
32 32

  
33 33
require_once("guiconfig.inc");
34
require_once("interfaces_fast.inc");
35

  
36
global $profile;
34 37

  
35 38
if (!is_array($config['vlans']['vlan'])) {
36 39
	$config['vlans']['vlan'] = array();
37 40
}
38 41

  
39
$a_vlans = &$config['vlans']['vlan'];
42
$a_vlans = &$config['vlans']['vlan'] ;
40 43

  
41 44
if ($_POST['act'] == "del") {
42 45
	if (!isset($_POST['id'])) {
......
101 104
					<tbody>
102 105
<?php
103 106
	$i = 0;
107
	$gettext_array = array('edit'=>gettext('Edit VLAN'),'del'=>gettext('Delete VLAN'));
108
	$ifaces = convert_real_interface_to_friendly_interface_name_fast(array());
104 109
	foreach ($a_vlans as $vlan) {
105 110
?>
106 111
						<tr>
107 112
							<td>
108 113
<?php
109 114
	printf("%s", htmlspecialchars($vlan['if']));
110
	$iface = convert_real_interface_to_friendly_interface_name($vlan['if']);
111
	if (isset($iface) && strlen($iface) > 0)
112
		printf(" (%s)", htmlspecialchars($iface));
115
	if (isset($ifaces[$vlan['if']]) && strlen($ifaces[$vlan['if']]) > 0)
116
		printf(" (%s)", htmlspecialchars($ifaces[$vlan['if']]));
113 117
?>
114 118
							</td>
115 119
							<td><?=htmlspecialchars($vlan['tag']);?></td>
116 120
							<td><?=htmlspecialchars($vlan['pcp']);?></td>
117 121
							<td><?=htmlspecialchars($vlan['descr']);?></td>
118 122
							<td>
119
								<a class="fa fa-pencil"	title="<?=gettext('Edit VLAN')?>"	role="button" href="interfaces_vlan_edit.php?id=<?=$i?>" ></a>
120
								<a class="fa fa-trash no-confirm"	title="<?=gettext('Delete VLAN')?>"	role="button" id="del-<?=$i?>"></a>
123
								<a class="fa fa-pencil"	title="<?=$gettext_array['edit']?>"	role="button" href="interfaces_vlan_edit.php?id=<?=$i?>" ></a>
124
								<a class="fa fa-trash no-confirm"	title="<?=$gettext_array['del']?>"	role="button" id="del-<?=$i?>"></a>
121 125
							</td>
122 126
						</tr>
123 127
<?php

Also available in: Unified diff