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
|
$i = 0;
|
42
|
$ifdescrs = get_configured_interface_with_descr();
|
43
|
?>
|
44
|
|
45
|
<table bgcolor="#990000" width="100%" border="0" cellspacing="0" cellpadding="0" summary="interfaces">
|
46
|
<?php
|
47
|
foreach ($ifdescrs as $ifdescr => $ifname) {
|
48
|
$ifinfo = get_interface_info($ifdescr);
|
49
|
$iswireless = is_interface_wireless($ifdescr);
|
50
|
?>
|
51
|
<tr>
|
52
|
<td class="vncellt" rowspan="2">
|
53
|
<?php
|
54
|
if($ifinfo['ppplink']) {
|
55
|
echo "<img src='./themes/{$g['theme']}/images/icons/icon_3g.gif' alt='3g' />";
|
56
|
} else if($iswireless) {
|
57
|
if($ifinfo['status'] == "associated") { ?>
|
58
|
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_wlan.gif" alt="wlan" />
|
59
|
<?php } else { ?>
|
60
|
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_wlan_d.gif" alt="wlan_d" />
|
61
|
<?php } ?>
|
62
|
<?php } else { ?>
|
63
|
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_cablenic.gif" alt="cablenic" />
|
64
|
<?php } ?>
|
65
|
<strong><u>
|
66
|
<span onclick="location.href='/interfaces.php?if=<?=$ifdescr; ?>'" style="cursor:pointer">
|
67
|
<?=htmlspecialchars($ifname);?></span></u></strong>
|
68
|
<?php
|
69
|
if ($ifinfo['dhcplink'])
|
70
|
echo " (DHCP)";
|
71
|
?>
|
72
|
</td>
|
73
|
<?php if($ifinfo['status'] == "up" || $ifinfo['status'] == "associated") { ?>
|
74
|
<td rowspan="2" class="listr" align="center">
|
75
|
<div id="<?php echo $ifname;?>-up" style="display:inline" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_interface_up.gif" title="<?=$ifname;?> is up" alt="up" /></div>
|
76
|
</td>
|
77
|
<?php } else if ($ifinfo['status'] == "no carrier") { ?>
|
78
|
<td rowspan="2" class="listr" align="center">
|
79
|
<div id="<?php echo $ifname;?>-down" style="display:inline" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_interface_down.gif" title="<?=$ifname;?> is down" alt="down" /></div>
|
80
|
</td>
|
81
|
<?php } else if ($ifinfo['status'] == "down") { ?>
|
82
|
<td rowspan="2" class="listr" align="center">
|
83
|
<div id="<?php echo $ifname;?>-block" style="display:inline" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" title="<?=$ifname;?> is disabled" alt="disabled" /></div>
|
84
|
</td>
|
85
|
<?php } else { ?><?=htmlspecialchars($ifinfo['status']); }?>
|
86
|
<td class="listr">
|
87
|
<div id="<?php echo $ifname;?>-media" style="display:inline"><?=htmlspecialchars($ifinfo['media']);?></div>
|
88
|
</td>
|
89
|
</tr>
|
90
|
<tr>
|
91
|
<td class="listr"><b>
|
92
|
<?php if($ifinfo['ipaddr'] != "") { ?>
|
93
|
<div id="<?php echo $ifname;?>-ip" style="display:inline"><?=htmlspecialchars($ifinfo['ipaddr']);?> </div>
|
94
|
<br />
|
95
|
<?php }
|
96
|
if ($ifinfo['ipaddrv6'] != "") { ?>
|
97
|
<div id="<?php echo $ifname;?>-ipv6" style="display:inline"><?=htmlspecialchars($ifinfo['ipaddrv6']);?> </div>
|
98
|
<?php } ?>
|
99
|
</b></td>
|
100
|
</tr>
|
101
|
</tr>
|
102
|
<?php }//end for each ?>
|
103
|
</table>
|