1
|
<?php
|
2
|
/*
|
3
|
$Id$
|
4
|
Copyright 2007 Scott Dale
|
5
|
Part of pfSense widgets (https://www.pfsense.org)
|
6
|
originally based on m0n0wall (http://m0n0.ch/wall)
|
7
|
|
8
|
Copyright (C) 2004-2005 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>
|
9
|
and Jonathan Watt <jwatt@jwatt.org>.
|
10
|
All rights reserved.
|
11
|
|
12
|
Redistribution and use in source and binary forms, with or without
|
13
|
modification, are permitted provided that the following conditions are met:
|
14
|
|
15
|
1. Redistributions of source code must retain the above copyright notice,
|
16
|
this list of conditions and the following disclaimer.
|
17
|
|
18
|
2. Redistributions in binary form must reproduce the above copyright
|
19
|
notice, this list of conditions and the following disclaimer in the
|
20
|
documentation and/or other materials provided with the distribution.
|
21
|
|
22
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
23
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
24
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
25
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
26
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
27
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
31
|
POSSIBILITY OF SUCH DAMAGE.
|
32
|
*/
|
33
|
|
34
|
$nocsrf = true;
|
35
|
|
36
|
require_once("guiconfig.inc");
|
37
|
require_once("pfsense-utils.inc");
|
38
|
require_once("functions.inc");
|
39
|
require_once("/usr/local/www/widgets/include/interfaces.inc");
|
40
|
|
41
|
$ifdescrs = get_configured_interface_with_descr();
|
42
|
?>
|
43
|
|
44
|
<table bgcolor="#990000" width="100%" border="0" cellspacing="0" cellpadding="0" summary="interfaces">
|
45
|
<?php
|
46
|
foreach ($ifdescrs as $ifdescr => $ifname):
|
47
|
$ifinfo = get_interface_info($ifdescr);
|
48
|
|
49
|
if ($ifinfo['ppplink']) {
|
50
|
$icon = '3g';
|
51
|
} else if (is_interface_wireless($ifdescr)) {
|
52
|
if($ifinfo['status'] == "associated")
|
53
|
$icon = 'wlan';
|
54
|
else
|
55
|
$icon = 'wlan_d';
|
56
|
} else
|
57
|
$icon = 'cablenic';
|
58
|
?>
|
59
|
<tr>
|
60
|
<td class="vncellt" rowspan="2">
|
61
|
<img src="./themes/<?=$g['theme'];?>/images/icons/icon_<?=$icon;?>.gif" alt="<?=$icon;?>" />
|
62
|
|
63
|
<strong><u>
|
64
|
<span onclick="location.href='/interfaces.php?if=<?=$ifdescr; ?>'" style="cursor:pointer">
|
65
|
<?=htmlspecialchars($ifname);?>
|
66
|
</span>
|
67
|
</u></strong>
|
68
|
<?php
|
69
|
if ($ifinfo['dhcplink'])
|
70
|
echo " (DHCP)";
|
71
|
?>
|
72
|
</td>
|
73
|
<?php
|
74
|
if($ifinfo['status'] == "up" || $ifinfo['status'] == "associated"):
|
75
|
?>
|
76
|
<td rowspan="2" class="listr" align="center">
|
77
|
<div id="<?php echo $ifname;?>-up" style="display:inline" >
|
78
|
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_interface_up.gif" title="<?=$ifname;?> is up" alt="up" />
|
79
|
</div>
|
80
|
</td>
|
81
|
<?php
|
82
|
elseif ($ifinfo['status'] == "no carrier"):
|
83
|
?>
|
84
|
<td rowspan="2" class="listr" align="center">
|
85
|
<div id="<?php echo $ifname;?>-down" style="display:inline" >
|
86
|
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_interface_down.gif" title="<?=$ifname;?> is down" alt="down" />
|
87
|
</div>
|
88
|
</td>
|
89
|
<?php
|
90
|
elseif ($ifinfo['status'] == "down"):
|
91
|
?>
|
92
|
<td rowspan="2" class="listr" align="center">
|
93
|
<div id="<?php echo $ifname;?>-block" style="display:inline" >
|
94
|
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" title="<?=$ifname;?> is disabled" alt="disabled" />
|
95
|
</div>
|
96
|
</td>
|
97
|
<?php
|
98
|
else:
|
99
|
echo htmlspecialchars($ifinfo['status']);
|
100
|
endif;
|
101
|
?>
|
102
|
<td class="listr">
|
103
|
<div id="<?php echo $ifname;?>-media" style="display:inline"><?=htmlspecialchars($ifinfo['media']);?></div>
|
104
|
</td>
|
105
|
</tr>
|
106
|
<tr>
|
107
|
<td class="vncellt" style="border-right:1px solid #999999;">
|
108
|
<?php
|
109
|
if($ifinfo['ipaddr'] != ""):
|
110
|
?>
|
111
|
<div id="<?php echo $ifname;?>-ip" style="display:inline"><?=htmlspecialchars($ifinfo['ipaddr']);?> </div>
|
112
|
<br />
|
113
|
<?php
|
114
|
endif;
|
115
|
if ($ifinfo['ipaddrv6'] != ""):
|
116
|
?>
|
117
|
<div id="<?php echo $ifname;?>-ipv6" style="display:inline"><?=htmlspecialchars($ifinfo['ipaddrv6']);?> </div>
|
118
|
<?php
|
119
|
endif;
|
120
|
?>
|
121
|
</td>
|
122
|
</tr>
|
123
|
<?php
|
124
|
endforeach;
|
125
|
?>
|
126
|
</table>
|