1
|
<?php
|
2
|
|
3
|
require_once("globals.inc");
|
4
|
require_once("functions.inc");
|
5
|
/* $Id$ */
|
6
|
|
7
|
function return_ext_menu($section) {
|
8
|
global $config;
|
9
|
$htmltext = "";
|
10
|
if($config['installedpackages']['menu'] <> "") {
|
11
|
foreach($config['installedpackages']['menu'] as $menuitem) {
|
12
|
if($menuitem['section'] != $section) continue;
|
13
|
if($menuitem['url'] <> "") {
|
14
|
$addresswithport = getenv("HTTP_HOST");
|
15
|
$colonpos = strpos($addresswithport, ":");
|
16
|
if ($colonpos !== False){
|
17
|
//my url is actually just the IP address of the pfsense box
|
18
|
$myurl = substr($addresswithport, 0, $colonpos);
|
19
|
}
|
20
|
else
|
21
|
{
|
22
|
$myurl = $addresswithport;
|
23
|
}
|
24
|
|
25
|
$description = str_replace('$myurl', $myurl, $menuitem['url']);
|
26
|
} else {
|
27
|
$description = '/pkg.php?xml=' . $menuitem['configfile'];
|
28
|
}
|
29
|
$htmltext .= '<li><a href="' . $description . ' "class="navlnk">' . $menuitem['name'] . '</a></li>' . "\n";
|
30
|
}
|
31
|
}
|
32
|
return $htmltext;
|
33
|
}
|
34
|
|
35
|
/* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */
|
36
|
if ($_REQUEST['noticeaction'] == 'acknowledge') {
|
37
|
$notice_id = $_REQUEST['noticeid'];
|
38
|
close_notice($notice_id);
|
39
|
}
|
40
|
/**********************************************/
|
41
|
|
42
|
?>
|
43
|
|
44
|
<div id="wrapper">
|
45
|
|
46
|
<div id="header">
|
47
|
<div id="header-left"><a href="index.php" id="status-link"><img src="/themes/<?= $g['theme']; ?>/images/transparent.gif" border="0"></img></a></div>
|
48
|
<div id="header-right">
|
49
|
<div class="container">
|
50
|
<div class="left">webConfigurator</div>
|
51
|
<div class="right">
|
52
|
<?
|
53
|
if (are_notices_pending()) {
|
54
|
$notices = get_notices();
|
55
|
|
56
|
$requests=array();
|
57
|
|
58
|
## Get Query Arguments from URL ###
|
59
|
foreach ($_REQUEST as $key => $value) {
|
60
|
if ($key != "PHPSESSID")
|
61
|
$requests[] = $key.'='.$value;
|
62
|
}
|
63
|
if(is_array($requests))
|
64
|
$request_string = implode("&", $requests);
|
65
|
|
66
|
if(is_array($notices)) {
|
67
|
foreach ($notices as $key => $value) {
|
68
|
$date = date("m-d-y H:i:s", $key);
|
69
|
$noticemsg = str_replace("'", "", $value['notice']);
|
70
|
$noticemsg = str_replace('"', "", $noticemsg);
|
71
|
$noticemsg = str_replace("\n", "", $noticemsg);
|
72
|
$noticemsg = str_replace("<p>", "", $noticemsg);
|
73
|
$noticemsg = str_replace("<pre>", "", $noticemsg);
|
74
|
$noticemsg = str_replace("</pre>", "", $noticemsg);
|
75
|
$noticemsg = str_replace("</p>", "", $noticemsg);
|
76
|
$noticemsg = str_replace("<br>", "", $noticemsg);
|
77
|
$extra_args = "";
|
78
|
if($_GET['xml'])
|
79
|
$extraargs="&xml=" . $_GET['xml'];
|
80
|
if($_POST['xml'])
|
81
|
$extraargs="&xml=" . $_POST['xml'];
|
82
|
if($_GET['id'])
|
83
|
$extraargs="&xml=" . $_GET['id'];
|
84
|
if($_POST['id'])
|
85
|
$extraargs="&xml=" . $_POST['id'];
|
86
|
$notice_msgs = '<a href="?noticeaction=acknowledge¬iceid=all' . $extraargs . '">Acknowledge All</a> .:. ';
|
87
|
if ($value['url']) {
|
88
|
$notice_msgs .= $date.' - <a href="'.$url.'?'.$request_string.'¬iceaction=acknowledge¬iceid='.$key.'">['.$value['id'].']</a>';
|
89
|
} else {
|
90
|
$notice_msgs .= $date.' - <a href="?'.$request_string.'¬iceaction=acknowledge¬iceid='.$key.'">['.$value['id'].']'.$noticemsg.'</a>';
|
91
|
}
|
92
|
$notice_msgs .= " .:. ";
|
93
|
}
|
94
|
}
|
95
|
?>
|
96
|
<div id="alerts">
|
97
|
<script type="text/javascript">
|
98
|
var content='<div id="marquee-text"><?= $notice_msgs; ?></div>'
|
99
|
</script>
|
100
|
<script type="text/javascript" src="/javascript/ticker.js"></script>
|
101
|
</div>
|
102
|
<?
|
103
|
} else {
|
104
|
?>
|
105
|
<div id="hostname">
|
106
|
<? print $config['system']['hostname'] . "." . $config['system']['domain']; ?>
|
107
|
</div>
|
108
|
<?
|
109
|
}
|
110
|
?>
|
111
|
</div>
|
112
|
</div>
|
113
|
</div>
|
114
|
</div> <!-- Header DIV -->
|
115
|
<div id="content">
|
116
|
<div id="left">
|
117
|
<div id="navigation" style="z-index:1000">
|
118
|
<ul id="menu">
|
119
|
<li class="firstdrop">
|
120
|
<div>System</div>
|
121
|
<ul class="subdrop">
|
122
|
<?php
|
123
|
output_menu_item("/system_advanced_admin.php", "Advanced");
|
124
|
output_menu_item("/system_firmware.php", "Firmware");
|
125
|
output_menu_item("/system.php", "General Setup");
|
126
|
if ($g['platform'] == "pfSense" or $g['platform'] == "nanobsd")
|
127
|
output_menu_item("/pkg_mgr.php", "Packages");
|
128
|
output_menu_item("/wizard.php?xml=setup_wizard.xml", "Setup Wizard");
|
129
|
output_menu_item("/system_gateways.php", "Routing");
|
130
|
output_menu_item("/system_camanager.php", "Cert Manager");
|
131
|
output_menu_item("/system_usermanager.php", "User Manager");
|
132
|
?>
|
133
|
<li><a href="/index.php?logout" class="navlnk">Logout</a></li>
|
134
|
</ul>
|
135
|
</li>
|
136
|
<li class="drop">
|
137
|
<div>Interfaces</div>
|
138
|
<ul class="subdrop">
|
139
|
<?php
|
140
|
if (!isset($config['system']['webgui']['noassigninterfaces']))
|
141
|
output_menu_item("/interfaces_assign.php", "(assign)");
|
142
|
$opts = get_configured_interface_with_descr(false, true);
|
143
|
foreach ($opts as $oif => $odescr)
|
144
|
if (!isset($config['interfaces'][$oif]['ovpn']))
|
145
|
output_menu_item("/interfaces.php?if={$oif}", htmlspecialchars($odescr));
|
146
|
echo return_ext_menu("Interfaces");
|
147
|
?>
|
148
|
</ul>
|
149
|
</li>
|
150
|
<li class="drop">
|
151
|
<div>Firewall</div>
|
152
|
<ul class="subdrop">
|
153
|
<?php
|
154
|
output_menu_item("/firewall_aliases.php", "Aliases");
|
155
|
if($config['interfaces']['lan']) {
|
156
|
/* no use for NAT in single-interface deployments
|
157
|
remove to reduce user confusion
|
158
|
*/
|
159
|
output_menu_item("/firewall_nat.php", "NAT");
|
160
|
}
|
161
|
output_menu_item("/firewall_rules.php", "Rules");
|
162
|
output_menu_item("/firewall_schedule.php", "Schedules");
|
163
|
if($config['interfaces']['lan']) {
|
164
|
/* no use for traffic shaper in single-interface
|
165
|
deployments
|
166
|
remove to reduce user confusion
|
167
|
*/
|
168
|
output_menu_item("/firewall_shaper.php", "Traffic Shaper");
|
169
|
}
|
170
|
output_menu_item("/firewall_virtual_ip.php", "Virtual IPs");
|
171
|
echo return_ext_menu("Firewall");
|
172
|
?>
|
173
|
</ul>
|
174
|
</li>
|
175
|
<li class="drop">
|
176
|
<div>Services</div>
|
177
|
<ul class="subdrop">
|
178
|
<?
|
179
|
output_menu_item("/services_captiveportal.php", "Captive Portal");
|
180
|
output_menu_item("/services_dnsmasq.php", "DNS Forwarder");
|
181
|
output_menu_item("/services_dhcp_relay.php", "DHCP Relay");
|
182
|
if($g['services_dhcp_server_enable'])
|
183
|
output_menu_item("/services_dhcp.php", "DHCP Server");
|
184
|
output_menu_item("/services_dyndns.php", "Dynamic DNS");
|
185
|
output_menu_item("/services_igmpproxy.php", "IGMP proxy");
|
186
|
output_menu_item("/load_balancer_pool.php", "Load Balancer");
|
187
|
output_menu_item("/pkg_edit.php?xml=olsrd.xml&id=0", "OLSR");
|
188
|
output_menu_item("/vpn_pppoe.php", "PPPoE Server");
|
189
|
output_menu_item("/pkg_edit.php?xml=routed/routed.xml&id=0", "RIP");
|
190
|
output_menu_item("/services_snmp.php", "SNMP");
|
191
|
if($config['interfaces']['lan']) {
|
192
|
/* no use for UPnP in single-interface deployments
|
193
|
remove to reduce user confusion
|
194
|
*/
|
195
|
output_menu_item("/pkg_edit.php?xml=miniupnpd.xml&id=0", "UPnP");
|
196
|
}
|
197
|
output_menu_item("/pkg_edit.php?xml=openntpd.xml&id=0", "OpenNTPD");
|
198
|
output_menu_item("/services_wol.php", "Wake on LAN");
|
199
|
echo return_ext_menu("Services");
|
200
|
?>
|
201
|
</ul>
|
202
|
</li>
|
203
|
<li class="drop">
|
204
|
<div>VPN</div>
|
205
|
<ul class="subdrop">
|
206
|
<?php
|
207
|
output_menu_item("/vpn_ipsec.php", "IPsec");
|
208
|
output_menu_item("/vpn_openvpn_server.php", "OpenVPN");
|
209
|
output_menu_item("/vpn_pptp.php", "PPTP");
|
210
|
output_menu_item("/vpn_l2tp.php", "L2TP");
|
211
|
echo return_ext_menu("VPN");
|
212
|
?>
|
213
|
</ul>
|
214
|
</li>
|
215
|
<li class="drop">
|
216
|
<div>Status</div>
|
217
|
<ul class="subdrop">
|
218
|
<?php
|
219
|
if (isset($config['captiveportal']['enable']))
|
220
|
output_menu_item("/status_captiveportal.php", "Captive Portal");
|
221
|
output_menu_item("/carp_status.php", "CARP (failover)");
|
222
|
output_menu_item("/index.php", "Dashboard");
|
223
|
output_menu_item("/status_gateways.php", "Gateways");
|
224
|
output_menu_item("/diag_dhcp_leases.php", "DHCP Leases");
|
225
|
output_menu_item("/status_filter_reload.php", "Filter Reload");
|
226
|
output_menu_item("/status_interfaces.php", "Interfaces");
|
227
|
output_menu_item("/diag_ipsec.php", "IPsec");
|
228
|
output_menu_item("/status_slbd_pool.php", "Load Balancer");
|
229
|
output_menu_item("/status_openvpn.php", "OpenVPN");
|
230
|
if ($g['platform'] == "pfSense")
|
231
|
output_menu_item("/diag_pkglogs.php", "Package Logs");
|
232
|
output_menu_item("/status_queues.php", "Queues");
|
233
|
output_menu_item("/status_rrd_graph.php", "RRD Graphs");
|
234
|
output_menu_item("/status_services.php", "Services");
|
235
|
output_menu_item("/diag_logs.php", "System Logs");
|
236
|
output_menu_item("/status_graph.php?if=wan", "Traffic Graph");
|
237
|
if($config['interfaces']['lan']) {
|
238
|
/* no use for UPnP in single-interface deployments
|
239
|
remove to reduce user confusion
|
240
|
*/
|
241
|
output_menu_item("/status_upnp.php", "UPnP");
|
242
|
}
|
243
|
$ifentries = get_configured_interface_with_descr();
|
244
|
foreach ($ifentries as $ent => $entdesc) {
|
245
|
if (is_array($config['interfaces'][$ent]['wireless']) &&
|
246
|
preg_match($g['wireless_regex'], $config['interfaces'][$ent]['if']))
|
247
|
$ifdescrs[$ent] = $entdesc;
|
248
|
}
|
249
|
if (count($ifdescrs) > 0)
|
250
|
output_menu_item("/status_wireless.php", "Wireless");
|
251
|
echo return_ext_menu("Status");
|
252
|
?>
|
253
|
</ul>
|
254
|
</li>
|
255
|
<li class="lastdrop">
|
256
|
<div>Diagnostics</div>
|
257
|
<ul id="diag" class="subdrop">
|
258
|
<?
|
259
|
output_menu_item("/diag_arp.php", "ARP Tables");
|
260
|
output_menu_item("/diag_backup.php", "Backup/Restore");
|
261
|
output_menu_item("/exec.php", "Command Prompt");
|
262
|
output_menu_item("/diag_dns.php", "DNS");
|
263
|
output_menu_item("/edit.php", "Edit File");
|
264
|
output_menu_item("/diag_defaults.php", "Factory Defaults");
|
265
|
output_menu_item("/halt.php", "Halt System");
|
266
|
if($g['platform'] == "nanobsd")
|
267
|
output_menu_item("/diag_nanobsd.php", "NanoBSD");
|
268
|
output_menu_item("/diag_ping.php", "Ping");
|
269
|
output_menu_item("/diag_system_pftop.php", "pfTOP");
|
270
|
output_menu_item("/reboot.php", "Reboot");
|
271
|
output_menu_item("/diag_routes.php", "Routes");
|
272
|
output_menu_item("/diag_dump_states.php", "States");
|
273
|
output_menu_item("/diag_system_activity.php", "System Activity");
|
274
|
output_menu_item("/diag_traceroute.php", "Traceroute");
|
275
|
output_menu_item("/diag_packet_capture.php", "Packet Capture");
|
276
|
echo return_ext_menu("Diagnostics");
|
277
|
if (isset($config['system']['developer'])) {
|
278
|
echo "<li><hr width=\"80%\"/></li>";
|
279
|
output_menu_item("/restart_httpd.php", "Restart HTTPD");
|
280
|
}
|
281
|
?>
|
282
|
</ul>
|
283
|
</li>
|
284
|
</ul>
|
285
|
</div>
|
286
|
|
287
|
</div> <!-- Left DIV -->
|
288
|
|
289
|
<div id="right">
|
290
|
|
291
|
<?php
|
292
|
|
293
|
/* display a top alert bar if need be */
|
294
|
$need_alert_display = false;
|
295
|
$found_notices = are_notices_pending();
|
296
|
if($found_notices == true) {
|
297
|
$notices = get_notices();
|
298
|
if(!$notices) {
|
299
|
$need_alert_display = true;
|
300
|
$display_text = print_notices() . "<br>";
|
301
|
}
|
302
|
}
|
303
|
if($need_alert_display == true) {
|
304
|
echo "<div style=\"background-color:#000000\" id=\"roundalert\">";
|
305
|
echo "<table>";
|
306
|
echo "<tr><td><font color=\"#ffffff\">";
|
307
|
echo " <img align=\"middle\" src=\"/top_notification.gif\"> ";
|
308
|
echo $display_text;
|
309
|
echo "</td>";
|
310
|
echo "</tr>";
|
311
|
echo "</table>";
|
312
|
echo "</div>";
|
313
|
}
|
314
|
|
315
|
function output_menu_item($url, $name) {
|
316
|
if (isAllowedPage($url))
|
317
|
echo "<li><a href=\"{$url}\" class=\"navlnk\">{$name}</a></li>\n";
|
318
|
}
|
319
|
|
320
|
?>
|
321
|
|
322
|
<p class="pgtitle"><?=genhtmltitle($pgtitle);?></font></p>
|
323
|
|
324
|
<?php
|
325
|
$pgtitle_output = true;
|
326
|
?>
|