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