1
|
<?php
|
2
|
function return_ext_menu($section) {
|
3
|
global $g;
|
4
|
$htmltext = "";
|
5
|
$dh = @opendir($g['www_path'] . "/ext/" . $section);
|
6
|
if ($dh) {
|
7
|
while (($extd = readdir($dh)) !== false) {
|
8
|
if (($extd === ".") || ($extd === ".."))
|
9
|
continue;
|
10
|
$fdt = fopen("{$g['www_path']}/ext/" . $section . "/" . $extd, "r");
|
11
|
$description = fread($fdt, 1024);
|
12
|
fclose($fdt);
|
13
|
echo "<!-- <a href=\"/pkg.php?xml=" . strtolower($extd) . ".xml\" class=\"navlnk\">" . $extd . "</a><br> -->\n";
|
14
|
$htmltext .= " <a href=\"" . $description . "\" class=\"navlnk\">" . $extd . "</a><br>\n";
|
15
|
}
|
16
|
closedir($dh);
|
17
|
}
|
18
|
return $htmltext;
|
19
|
}
|
20
|
?>
|
21
|
|
22
|
<script language="javascript">
|
23
|
<!--
|
24
|
var tri_open = "";
|
25
|
var tri_closed = "";
|
26
|
|
27
|
window.onload = preload;
|
28
|
|
29
|
function preload() {
|
30
|
if (document.images) {
|
31
|
tri_open = new Image(14,10);
|
32
|
tri_closed = new Image(14,10);
|
33
|
tri_open.src = "/tri_o.gif";
|
34
|
tri_closed.src = "/tri_c.gif";
|
35
|
}
|
36
|
}
|
37
|
|
38
|
function showhide(tspan, tri) {
|
39
|
tspanel = document.getElementById(tspan);
|
40
|
triel = document.getElementById(tri);
|
41
|
if (tspanel.style.display == 'none') {
|
42
|
tspanel.style.display = '';
|
43
|
triel.src = "/tri_o.gif";
|
44
|
} else {
|
45
|
tspanel.style.display = 'none';
|
46
|
triel.src = "/tri_c.gif";
|
47
|
}
|
48
|
}
|
49
|
-->
|
50
|
</script>
|
51
|
<table width="750" border="0" cellspacing="0" cellpadding="2">
|
52
|
<tr valign="bottom">
|
53
|
<td width="150" height="65" align="center" valign="middle"> <strong><a href="/"><img src="/logo.gif" border="0"></a></strong></td>
|
54
|
<td height="65" bgcolor="#990000">
|
55
|
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
56
|
<tr><td align="left" valign="bottom"><span class="tfrtitle"> webConfigurator</span></td>
|
57
|
<td align="right" valign="bottom">
|
58
|
<span class="hostname"><?=$config['system']['hostname'] . "." . $config['system']['domain'];?> </span>
|
59
|
</td></tr></table>
|
60
|
</td>
|
61
|
</tr>
|
62
|
<tr valign="top">
|
63
|
<td width="150" bgcolor="#000000">
|
64
|
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
65
|
<tr>
|
66
|
<td><span class="navlnk"><font color="#FFFFFF"> <strong>System</strong>
|
67
|
<br>
|
68
|
<a href="/system.php" class="navlnk">General
|
69
|
setup</a><br>
|
70
|
<a href="/system_routes.php" class="navlnk">Static
|
71
|
routes</a><br>
|
72
|
<a href="/system_firmware.php" class="navlnk">Firmware</a><br>
|
73
|
<a href="/system_advanced.php" class="navlnk">Advanced</a><br>
|
74
|
<a href="/pkg_mgr.php" class="navlnk">Package Manager</a><br>
|
75
|
<?php echo return_ext_menu("System"); ?>
|
76
|
<strong>Interfaces</strong>
|
77
|
<?php if (!isset($config['system']['webgui']['noassigninterfaces'])): ?>
|
78
|
<a href="/interfaces_assign.php" class="navlnks">(assign)</a>
|
79
|
<?php endif; ?>
|
80
|
<br>
|
81
|
<a href="/interfaces_lan.php" class="navlnk">LAN</a><br>
|
82
|
<a href="/interfaces_wan.php" class="navlnk">WAN</a><br>
|
83
|
<?php for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++): if (!isset($config['interfaces']['opt' . $i]['ovpn'])): ?>
|
84
|
<a href="/interfaces_opt.php?index=<?=$i;?>" class="navlnk"><?=htmlspecialchars($config['interfaces']['opt' . $i]['descr']);?></a><br>
|
85
|
<?php endif; endfor; ?>
|
86
|
<?php echo return_ext_menu("Interfaces"); ?>
|
87
|
<strong>Firewall</strong><br>
|
88
|
<a href="/firewall_rules.php" class="navlnk">Rules</a><br>
|
89
|
<a href="/firewall_nat.php" class="navlnk">NAT</a><br>
|
90
|
<a href="/firewall_aliases.php" class="navlnk">Aliases</a><br>
|
91
|
<a href="/firewall_shaper.php" class="navlnk">Traffic Shaper</a><br>
|
92
|
<?php echo return_ext_menu("Firewall"); ?>
|
93
|
<strong>Services</strong><br>
|
94
|
<a href="/services_dnsmasq.php" class="navlnk">DNS forwarder</a><br>
|
95
|
<a href="/services_dyndns.php" class="navlnk">Dynamic
|
96
|
DNS</a><br>
|
97
|
<a href="/services_dhcp.php" class="navlnk">DHCP server</a><br>
|
98
|
<a href="/services_dhcp_relay.php" class="navlnk">DHCP relay</a><br>
|
99
|
<a href="/services_snmp.php" class="navlnk">SNMP</a><br>
|
100
|
<a href="/services_proxyarp.php" class="navlnk">Proxy ARP</a><br>
|
101
|
<a href="/services_captiveportal.php" class="navlnk">Captive portal</a><br>
|
102
|
<a href="/services_wol.php" class="navlnk">Wake on LAN</a><br>
|
103
|
<?php echo return_ext_menu("Services"); ?>
|
104
|
<strong>VPN</strong><br>
|
105
|
<a href="/vpn_ipsec.php" class="navlnk">IPsec</a><br>
|
106
|
<a href="/vpn_pptp.php" class="navlnk">PPTP</a><br>
|
107
|
<a href="/vpn_openvpn.php" class="navlnk">OpenVPN</a><br>
|
108
|
<strong>Status</strong><br>
|
109
|
<a href="/index.php" class="navlnk">System</a><br>
|
110
|
<a href="/status_interfaces.php" class="navlnk">Interfaces</a><br>
|
111
|
<a href="/status_queues.php" class="navlnk">Queues</a><br>
|
112
|
<a href="/status_graph.php" class="navlnk">Traffic graph</a><br>
|
113
|
<a href="/status_wireless.php" class="navlnk">Wireless</a><br>
|
114
|
<?php if (isset($config['captiveportal']['enable'])): ?>
|
115
|
<a href="/status_captiveportal.php" class="navlnk">Captive portal</a><br>
|
116
|
<?php endif; ?>
|
117
|
<?php echo return_ext_menu("Status"); ?>
|
118
|
<?php if (isset($config['system']['webgui']['expanddiags']) || strstr($_SERVER['SCRIPT_FILENAME'], "diag_") || strstr($_SERVER['SCRIPT_FILENAME'], "reboot")): ?>
|
119
|
<a href="javascript:showhide('diag','tri_diag')"><img src="/tri_o.gif" id="tri_diag" width="14" height="10" border="0"></a><strong><a href="javascript:showhide('diag','tri_diag')" class="navlnk">Diagnostics</a></strong><br>
|
120
|
<span id="diag">
|
121
|
<?php else: ?>
|
122
|
<a href="javascript:showhide('diag','tri_diag')"><img src="/tri_c.gif" id="tri_diag" width="14" height="10" border="0"></a><strong><a href="javascript:showhide('diag','tri_diag')" class="navlnk">Diagnostics</a></strong><br>
|
123
|
<span id="diag" style="display: none">
|
124
|
<?php endif; ?>
|
125
|
<a href="/diag_logs.php" class="navlnk">System logs</a><br>
|
126
|
<a href="/diag_dhcp_leases.php" class="navlnk">DHCP leases</a><br>
|
127
|
<a href="/diag_ipsec_sad.php" class="navlnk">IPsec</a><br>
|
128
|
<a href="/diag_ping.php" class="navlnk">Ping</a><br>
|
129
|
<a href="/diag_resetstate.php" class="navlnk">Reset state</a><br>
|
130
|
<a href="/diag_backup.php" class="navlnk">Backup/Restore</a><br>
|
131
|
<a href="/diag_defaults.php" class="navlnk">Factory defaults </a><br>
|
132
|
<a href="/edit.php" class="navlnk">Edit File</a><br>
|
133
|
<a href="/exec.php" class="navlnk">Command Prompt</a><br>
|
134
|
<a href="/reboot.php" class="navlnk">Reboot system</a><br>
|
135
|
<a href="/halt.php" class="navlnk">Halt system</a><br>
|
136
|
<?php echo return_ext_menu("Diagnostics"); ?>
|
137
|
</span>
|
138
|
</font></span>
|
139
|
</td>
|
140
|
</tr></table></td>
|
141
|
<td width="600"><table width="100%" border="0" cellpadding="10" cellspacing="0">
|
142
|
<tr><td>
|