1
|
<?php
|
2
|
require_once("notices.inc");
|
3
|
/* $Id$ */
|
4
|
function return_ext_menu($section) {
|
5
|
global $config;
|
6
|
$htmltext = "";
|
7
|
if($config['installedpackages']['menu'] <> "") {
|
8
|
foreach($config['installedpackages']['menu'] as $menuitem) {
|
9
|
if($menuitem['section'] != $section) continue;
|
10
|
if($menuitem['url'] <> "") {
|
11
|
$description = str_replace('$myurl', getenv("HTTP_HOST"), $menuitem['url']);
|
12
|
} else {
|
13
|
$description = '/pkg.php?xml=' . $menuitem['configfile'];
|
14
|
}
|
15
|
$htmltext .= ' <a href="' . $description . ' "class="navlnk">' . $menuitem['name'] . '</a><br>' . "\n";
|
16
|
}
|
17
|
}
|
18
|
return $htmltext;
|
19
|
}
|
20
|
|
21
|
|
22
|
?>
|
23
|
|
24
|
<script language="javascript">
|
25
|
<!--
|
26
|
var tri_open = "";
|
27
|
var tri_closed = "";
|
28
|
|
29
|
window.onload = preload;
|
30
|
|
31
|
function preload() {
|
32
|
if (document.images) {
|
33
|
tri_open = new Image(14,10);
|
34
|
tri_closed = new Image(14,10);
|
35
|
tri_open.src = "/tri_o.gif";
|
36
|
tri_closed.src = "/tri_c.gif";
|
37
|
}
|
38
|
}
|
39
|
|
40
|
function showhide(tspan, tri) {
|
41
|
tspanel = document.getElementById(tspan);
|
42
|
triel = document.getElementById(tri);
|
43
|
if (tspanel.style.display == 'none') {
|
44
|
tspanel.style.display = '';
|
45
|
triel.src = "/tri_o.gif";
|
46
|
} else {
|
47
|
tspanel.style.display = 'none';
|
48
|
triel.src = "/tri_c.gif";
|
49
|
}
|
50
|
}
|
51
|
|
52
|
function showhide_black(tspan, tri) {
|
53
|
tspanel = document.getElementById(tspan);
|
54
|
triel = document.getElementById(tri);
|
55
|
if (tspanel.style.display == 'none') {
|
56
|
tspanel.style.display = '';
|
57
|
triel.src = "/tri_o_black.gif";
|
58
|
} else {
|
59
|
tspanel.style.display = 'none';
|
60
|
triel.src = "/tri_c_black.gif";
|
61
|
}
|
62
|
}
|
63
|
-->
|
64
|
</script>
|
65
|
<table width="750" border="0" cellspacing="0" cellpadding="0">
|
66
|
<tr valign="bottom" height="65">
|
67
|
<td width="150" height="65" align="center" valign="middle"> <strong><a href="/"><img src="/logo.gif" border="0"></a></strong></td>
|
68
|
<td height="100%">
|
69
|
<div style="height:100%" id="topbox">
|
70
|
<table bgcolor="#990000" background="top_background.gif" border="0" cellspacing="0" cellpadding="0" width="100%" height="85%">
|
71
|
<tr><td align="left" valign="bottom"><span class="tfrtitle"> webConfigurator</span></td>
|
72
|
<td align="right" valign="bottom">
|
73
|
<span class="hostname"><?=$config['system']['hostname'] . "." . $config['system']['domain'];?> </span>
|
74
|
</td>
|
75
|
</tr>
|
76
|
<?php
|
77
|
/* display a top alert bar if need be */
|
78
|
$need_alert_display = false;
|
79
|
$display_text .= "";
|
80
|
if(file_exists("{$g["tmp_path"]}/filter_reloading")) {
|
81
|
$need_alert_display = true;
|
82
|
$display_text .= "The filter rules are currently reloading. You will receive an alert if there is an error.<br>";
|
83
|
}
|
84
|
$found_notices = are_notices_pending();
|
85
|
if($found_notices == true) {
|
86
|
$notices = get_notices();
|
87
|
if(!$notices) {
|
88
|
$need_alert_display = true;
|
89
|
$display_text .= print_notices() . "<br>";
|
90
|
}
|
91
|
}
|
92
|
if($need_alert_display == true) {
|
93
|
// XXX: make rounded.
|
94
|
echo "<tr bgcolor=\"#000000\"><td colspan=\"2\"><font color=\"#ffffff\">";
|
95
|
echo "<div id=\"roundalert\">";
|
96
|
echo "<img src=\"/top_notification.gif\"> ";
|
97
|
echo $display_text;
|
98
|
echo "</div>";
|
99
|
echo "</td></tr>";
|
100
|
}
|
101
|
?>
|
102
|
</div>
|
103
|
</table>
|
104
|
</td>
|
105
|
</tr>
|
106
|
<tr valign="top">
|
107
|
<td valign="top" height="100%" width="150">
|
108
|
<div id="niftyMenu" style="height:100%">
|
109
|
<table height="100%" width="100%" class="menu" bgcolor="#000000">
|
110
|
<tr valign="top">
|
111
|
<td nowrap><span class="navlnk"><font color="#FFFFFF"> <strong>System</strong>
|
112
|
<br>
|
113
|
<a href="/system_advanced.php" class="navlnk">Advanced</a><br>
|
114
|
<a href="/system_firmware_check.php" class="navlnk">Firmware</a><br>
|
115
|
<a href="/system.php" class="navlnk">General setup</a><br>
|
116
|
<a href="/pkg_mgr.php" class="navlnk">Packages</a><br>
|
117
|
<a href="/system_routes.php" class="navlnk">Static routes</a><br>
|
118
|
<?php echo return_ext_menu("System"); ?>
|
119
|
<strong>Interfaces</strong>
|
120
|
<?php if (!isset($config['system']['webgui']['noassigninterfaces'])): ?>
|
121
|
<a href="/interfaces_assign.php" class="navlnks">(assign)</a>
|
122
|
<?php endif; ?>
|
123
|
<br>
|
124
|
<a href="/interfaces_lan.php" class="navlnk">LAN</a><br>
|
125
|
<?php for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++): if (!isset($config['interfaces']['opt' . $i]['ovpn'])): ?>
|
126
|
<a href="/interfaces_opt.php?index=<?=$i;?>" class="navlnk"><?=htmlspecialchars($config['interfaces']['opt' . $i]['descr']);?></a><br>
|
127
|
<?php endif; endfor; ?>
|
128
|
<a href="/interfaces_wan.php" class="navlnk">WAN</a><br>
|
129
|
<?php echo return_ext_menu("Interfaces"); ?>
|
130
|
<strong>Firewall</strong><br>
|
131
|
<a href="/firewall_aliases.php" class="navlnk">Aliases</a><br>
|
132
|
<a href="/firewall_nat.php" class="navlnk">NAT</a><br>
|
133
|
<a href="/firewall_rules.php" class="navlnk">Rules</a><br>
|
134
|
<a href="/firewall_shaper.php" class="navlnk">Traffic Shaper</a><br>
|
135
|
<?php echo return_ext_menu("Firewall"); ?>
|
136
|
<strong>Services</strong><br>
|
137
|
<a href="/services_captiveportal.php" class="navlnk">Captive portal</a><br>
|
138
|
<a href="/services_dnsmasq.php" class="navlnk">DNS forwarder</a><br>
|
139
|
<a href="/services_dhcp_relay.php" class="navlnk">DHCP relay</a><br>
|
140
|
<a href="/services_dhcp.php" class="navlnk">DHCP server</a><br>
|
141
|
<a href="/services_dyndns.php" class="navlnk">Dynamic DNS</a><br>
|
142
|
<a href="/services_snmp.php" class="navlnk">SNMP</a><br>
|
143
|
<a href="/services_proxyarp.php" class="navlnk">Proxy ARP</a><br>
|
144
|
<a href="/services_wol.php" class="navlnk">Wake on LAN</a><br>
|
145
|
<a href="/carp_status.php" class="navlnk">CARP (failover)</a><br>
|
146
|
<?php echo return_ext_menu("Services"); ?>
|
147
|
<strong>VPN</strong><br>
|
148
|
<a href="/vpn_ipsec.php" class="navlnk">IPsec</a><br>
|
149
|
<a href="/vpn_pptp.php" class="navlnk">PPTP</a><br>
|
150
|
<strong>Status</strong><br>
|
151
|
<?php if (isset($config['captiveportal']['enable'])): ?>
|
152
|
<a href="/status_captiveportal.php" class="navlnk">Captive portal</a><br>
|
153
|
<?php endif; ?>
|
154
|
<a href="/diag_dhcp_leases.php" class="navlnk">DHCP leases</a><br>
|
155
|
<a href="/status_interfaces.php" class="navlnk">Interfaces</a><br>
|
156
|
<a href="/diag_ipsec_sad.php" class="navlnk">IPsec</a><br>
|
157
|
<a href="/diag_pkglogs.php" class="navlnk">Package logs</a><br>
|
158
|
<a href="/status_queues.php" class="navlnk">Queues</a><br>
|
159
|
<a href="/status_services.php" class="navlnk">Services</a><br>
|
160
|
<a href="/index.php" class="navlnk">System</a><br>
|
161
|
<a href="/diag_logs.php" class="navlnk">System logs</a><br>
|
162
|
<a href="/status_graph.php" class="navlnk">Traffic graph</a><br>
|
163
|
<?php $i = 0; $ifdescrs = array();
|
164
|
if (is_array($config['interfaces']['wan']['wireless']) &&
|
165
|
(strstr($config['interfaces']['wan']['if'], "wi") || strstr($config['interfaces']['wan']['if'], "ath")))
|
166
|
$ifdescrs['wan'] = 'WAN';
|
167
|
|
168
|
if (is_array($config['interfaces']['lan']['wireless']) &&
|
169
|
(strstr($config['interfaces']['lan']['if'], "wi") || strstr($config['interfaces']['lan']['if'], "ath")))
|
170
|
$ifdescrs['lan'] = 'LAN';
|
171
|
|
172
|
for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
|
173
|
if (is_array($config['interfaces']['opt' . $j]['wireless']) &&
|
174
|
isset($config['interfaces']['opt' . $j]['enable']) &&
|
175
|
(strstr($config['interfaces']['opt' . $j]['if'], "wi") || strstr($config['interfaces']['opt' . $j]['if'], "ath")))
|
176
|
$ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
|
177
|
}
|
178
|
if (count($ifdescrs) > 0): ?>
|
179
|
<a href="/status_wireless.php" class="navlnk">Wireless</a><br>
|
180
|
<?php endif; ?>
|
181
|
<?php echo return_ext_menu("Status"); ?>
|
182
|
<?php if (isset($config['system']['developer'])) { ?>
|
183
|
<strong>Developers</strong><br>
|
184
|
<a href="/restart_httpd.php" class="navlnk">Restart HTTPD</a><br>
|
185
|
<?php } ?>
|
186
|
<?php if (isset($config['system']['webgui']['expanddiags']) || strstr($_SERVER['SCRIPT_FILENAME'], "diag_") || strstr($_SERVER['SCRIPT_FILENAME'], "reboot")): ?>
|
187
|
<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>
|
188
|
<span id="diag">
|
189
|
<?php else: ?>
|
190
|
<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>
|
191
|
<span id="diag" style="display: none">
|
192
|
<?php endif; ?>
|
193
|
<a href="/diag_backup.php" class="navlnk">Backup/Restore</a><br>
|
194
|
<a href="/exec.php" class="navlnk">Command Prompt</a><br>
|
195
|
<a href="/edit.php" class="navlnk">Edit File</a><br>
|
196
|
<a href="/diag_defaults.php" class="navlnk">Factory defaults </a><br>
|
197
|
<a href="/halt.php" class="navlnk">Halt system</a><br>
|
198
|
<a href="/diag_ping.php" class="navlnk">Ping</a><br>
|
199
|
<a href="/reboot.php" class="navlnk">Reboot system</a><br>
|
200
|
<a href="/diag_dump_states.php" class="navlnk">States</a><br>
|
201
|
<?php echo return_ext_menu("Diagnostics"); ?>
|
202
|
</span>
|
203
|
</font></span>
|
204
|
</td>
|
205
|
</tr>
|
206
|
</table>
|
207
|
</div>
|
208
|
</td>
|
209
|
<td width="600"><table width="100%" border="0" cellpadding="10" cellspacing="0">
|
210
|
<tr><td>
|