Project

General

Profile

Download (28.2 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
 * head.inc
4
 *
5
 * part of pfSense (https://www.pfsense.org)
6
 * Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
7
 * All rights reserved.
8
 *
9
 * Redistribution and use in source and binary forms, with or without
10
 * modification, are permitted provided that the following conditions are met:
11
 *
12
 * 1. Redistributions of source code must retain the above copyright notice,
13
 *    this list of conditions and the following disclaimer.
14
 *
15
 * 2. Redistributions in binary form must reproduce the above copyright
16
 *    notice, this list of conditions and the following disclaimer in
17
 *    the documentation and/or other materials provided with the
18
 *    distribution.
19
 *
20
 * 3. All advertising materials mentioning features or use of this software
21
 *    must display the following acknowledgment:
22
 *    "This product includes software developed by the pfSense Project
23
 *    for use in the pfSense® software distribution. (http://www.pfsense.org/).
24
 *
25
 * 4. The names "pfSense" and "pfSense Project" must not be used to
26
 *    endorse or promote products derived from this software without
27
 *    prior written permission. For written permission, please contact
28
 *    coreteam@pfsense.org.
29
 *
30
 * 5. Products derived from this software may not be called "pfSense"
31
 *    nor may "pfSense" appear in their names without prior written
32
 *    permission of the Electric Sheep Fencing, LLC.
33
 *
34
 * 6. Redistributions of any form whatsoever must retain the following
35
 *    acknowledgment:
36
 *
37
 * "This product includes software developed by the pfSense Project
38
 * for use in the pfSense software distribution (http://www.pfsense.org/).
39
 *
40
 * THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
41
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
44
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51
 * OF THE POSSIBILITY OF SUCH DAMAGE.
52
 */
53

    
54
require_once("globals.inc");
55
require_once("functions.inc");
56
require_once("shortcuts.inc");
57
require_once("service-utils.inc");
58
require_once('notices.inc');
59

    
60
header('Content-Type: text/html; charset=utf-8');
61

    
62
$pagetitle = gentitle($pgtitle);
63

    
64
if ($user_settings['webgui']['pagenamefirst']) {
65
	$tabtitle = $pagetitle . " - " . htmlspecialchars($config['system']['hostname'] . "." . $config['system']['domain']);
66
} else {
67
	$tabtitle = htmlspecialchars($config['system']['hostname'] . "." . $config['system']['domain']) . " - " . $pagetitle;
68
}
69

    
70
$cssfile = "/css/pfSense.css";
71

    
72
if (isset($user_settings['webgui']['webguicss'])) {
73
	if (file_exists("/usr/local/www/css/" . $user_settings['webgui']['webguicss'])) {
74
		$cssfile = "/css/" . $user_settings['webgui']['webguicss'];
75
	}
76
}
77

    
78
// set default columns to two if unset
79
if (!isset($config['system']['webgui']['dashboardcolumns'])) {
80
	$config['system']['webgui']['dashboardcolumns'] = 2;
81
}
82

    
83
?>
84
<!DOCTYPE html>
85
<html lang="en">
86
<head>
87
	<meta name="viewport" content="width=device-width, initial-scale=1">
88

    
89
	<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
90
	<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
91
	<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
92
	<link rel="manifest" href="/manifest.json">
93
	<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
94
	<meta name="theme-color" content="#ffffff">
95

    
96
	<link rel="stylesheet" href="/vendor/font-awesome/css/font-awesome.min.css?v=<?=filemtime('/usr/local/www/vendor/font-awesome/css/font-awesome.min.css')?>">
97
	<link rel="stylesheet" href="/vendor/sortable/sortable-theme-bootstrap.css?v=<?=filemtime('/usr/local/www/vendor/sortable/sortable-theme-bootstrap.css')?>">
98
	<link rel="stylesheet" href="<?=$cssfile?>?v=<?=filemtime('/usr/local/www/' . $cssfile)?>" />
99

    
100
	<title><?=$tabtitle?></title>
101
	<script type="text/javascript">
102
	//<![CDATA[
103
	var events = events || [];
104
	//]]>
105
	</script>
106
</head>
107

    
108
<?php
109

    
110
/* Determine automated help URL. Should output the page name and parameters
111
   separately */
112
$uri_split = "";
113
preg_match("/\/(.*)\?(.*)/", $_SERVER["REQUEST_URI"], $uri_split);
114

    
115
/* If there was no match, there were no parameters, just grab the filename
116
   Otherwise, use the matched filename from above. */
117
if (empty($uri_split[0])) {
118
	$pagename = ltrim($_SERVER["REQUEST_URI"], '/');
119
} else {
120
	$pagename = $uri_split[1];
121
}
122

    
123
/* If the page name is still empty, the user must have requested / (index.php) */
124
if (empty($pagename)) {
125
	$pagename = "index.php";
126
}
127

    
128
/* If the filename is pkg_edit.php or wizard.php, reparse looking
129
	for the .xml filename */
130
if (($pagename == "pkg.php") || ($pagename == "pkg_edit.php") || ($pagename == "wizard.php")) {
131
	$param_split = explode('&', $uri_split[2]);
132
	foreach ($param_split as $param) {
133
		if (substr($param, 0, 4) == "xml=") {
134
			$xmlfile = explode('=', $param);
135
			$pagename = $xmlfile[1];
136
		}
137
	}
138
} else if ($pagename == "status_logs.php") {
139
	$param_split = explode('&', $uri_split[2]);
140
	foreach ($param_split as $param) {
141
		if (substr($param, 0, 8) == "logfile=") {
142
			$logtype = explode('=', $param);
143
			$pagename .= '-' . $logtype[1];
144
		}
145
	}
146
}
147

    
148
// Build the full help URL.
149
$helpurl .= "{$g['help_base_url']}?page={$pagename}";
150

    
151
/*
152
 * Read files from $g['ext_menu_path']/*.xml and fill an array with menu info
153
 */
154
function read_ext_menu_path_data() {
155
	global $g;
156

    
157
	$result = array();
158

    
159
	if (!is_dir($g['ext_menu_path'])) {
160
		return $result;
161
	}
162

    
163
	foreach (glob("{$g['ext_menu_path']}/*.xml") as $menu_xml) {
164
		$xml_data = parse_xml_config_pkg($menu_xml, "packagegui");
165
		if (empty($xml_data['menu'])) {
166
			continue;
167
		}
168
		foreach ($xml_data['menu'] as $menu) {
169
			$result[] = $menu;
170
		}
171
	}
172

    
173
	return $result;
174
}
175

    
176
// Create a menu entry of any installed packages in the specified category
177
// (Now reads the menu information from $config['installedpackages']['menu'] only)
178
function return_ext_menu($section) {
179
	global $config, $ext_menu_path_data;
180

    
181
	$htmltext = "";
182
	$extarray = array();
183
	$ext_menu_entries = array();
184

    
185
	if ((!empty($config['installedpackages']['package'])) && (!empty($config['installedpackages']['menu']))) {
186
		foreach ($config['installedpackages']['menu'] as $menu) {
187
//			print('Name: ' . $menu['name'] . ', Pkg category: ' . $menu['category'] . ', Section: ' . $section . '<br />');
188
			if ($menu['section'] == $section) {
189
				$ext_menu_entries[] = $menu;
190
			}
191
		}
192
	}
193

    
194
	foreach ($ext_menu_path_data as $menu) {
195
		if ($menu['section'] == $section) {
196
			$ext_menu_entries[] = $menu;
197
		}
198
	}
199

    
200
	foreach ($ext_menu_entries as $menu) {
201
		if ($menu['url'] != "") {
202
			$test_url = $menu['url'];
203
			$addresswithport = getenv("HTTP_HOST");
204
			$colonpos = strpos($addresswithport, ":");
205

    
206
			if ($colonpos !== false) {
207
				//my url is actually just the IP address of the pfsense box
208
				$myurl = substr($addresswithport, 0, $colonpos);
209
			} else {
210
				$myurl = $addresswithport;
211
			}
212
			$description = str_replace('$myurl', $myurl, $menu['url']);
213
		} else {
214
			$description = '/pkg.php?xml=' . $menu['configfile'];
215
			$test_url=$description;
216
		}
217

    
218
		if (isAllowedPage($test_url)) {
219
			$extarray[] = array($menu['name'], $description);
220
		}
221
	}
222

    
223
	return $extarray;
224
}
225

    
226
function output_menu($arrayitem, $target = null, $section = "") {
227

    
228
	foreach ($arrayitem as $item) {
229
		/* If the user has access to help pages, also show the full help menu. See #5909 */
230
		if (isAllowedPage($item[1]) || $item[1] == "/index.php?logout" || (($section == "Help") && isAllowedPage("help.php"))) {
231
			$attr = sprintf("href=\"%s\"", htmlentities($item[1]));
232

    
233
			if ($target) {
234
				$attr .= sprintf(" target=\"%s\"", htmlentities($target));
235
			}
236

    
237
			$class = "navlnk";
238

    
239
			if ($item['class']) {
240
				$class .= " {$item['class']}";
241
			}
242

    
243
			$attr .= sprintf(" class=\"%s\"", htmlentities($class));
244

    
245
			if ($item['style']) {
246
				$attr .= sprintf(" style=\"%s\"", htmlentities($item['style']));
247
			}
248

    
249
			if ($item[0] == '-DIVIDER-') {
250
				$output .= ' <li class="divider"></li>';
251
			} else {
252
				$output .= "<li>". sprintf("<a %s %s>%s</a>", $attr, ($item[1] == "/index.php?logout") ? "usepost":"",$item[0]) . "</li>\n";
253
			}
254
		}
255
	}
256

    
257
	print($output);
258
}
259

    
260
$ext_menu_path_data = read_ext_menu_path_data();
261

    
262
// System
263
$system_menu = array();
264
$system_menu[] = array(gettext("Logout"), "/index.php?logout");
265
$system_menu[] = array(gettext("Advanced"), "/system_advanced_admin.php");
266
$system_menu[] = array(gettext("Update"), "/pkg_mgr_install.php?id=firmware");
267
$system_menu[] = array(gettext("General Setup"), "/system.php");
268
$system_menu[] = array(gettext("High Avail. Sync"), "/system_hasync.php");
269
if ($g['platform'] == $g['product_name'] or $g['platform'] == "nanobsd") {
270
	$system_menu[] = array(gettext("Package Manager"), "/pkg_mgr_installed.php");
271
}
272
$system_menu[] = array(gettext("Setup Wizard"), "/wizard.php?xml=setup_wizard.xml");
273
$system_menu[] = array(gettext("Routing"), "/system_gateways.php");
274
$system_menu[] = array(gettext("Cert. Manager"), "/system_camanager.php");
275
if (!isAllowedPage("system_usermanager.php*")) {
276
	$system_menu[] = array(gettext("User Manager"), "/system_usermanager_passwordmg.php");
277
} else {
278
	$system_menu[] = array(gettext("User Manager"), "/system_usermanager.php");
279
}
280

    
281
if ($user_settings['customsettings'] && isAllowedPage("system_user_settings.php*")) {
282
	$system_menu[] = array(gettext("User Settings"), "/system_user_settings.php");
283
}
284

    
285
$system_menu = msort(array_merge($system_menu, return_ext_menu("System")), 0);
286

    
287
// Interfaces
288
// NOTE:
289
// Now that menus are sorted, adding a DIVIDER must be done after the sorting so an array is formed of the
290
// items above the divider and another for below it. These are then sorted and combined with the divider
291
$interfaces_menu = array();
292
$interfaces_top = array();
293
$interfaces_bottom = array();
294

    
295
if (!isset($config['system']['webgui']['noassigninterfaces'])) {
296
	$interfaces_top[] = array(gettext("Assignments"), "/interfaces_assign.php");
297
	$div = true;
298
}
299

    
300
$opts = get_configured_interface_with_descr(false, true);
301

    
302
foreach ($opts as $oif => $odescr) {
303
	if (!isset($config['interfaces'][$oif]['ovpn'])) {
304
		$interfaces_bottom[] = array(htmlspecialchars($odescr), "/interfaces.php?if={$oif}");
305
	}
306
}
307

    
308
$interfaces_bottom = array_merge($interfaces_bottom, return_ext_menu("Interfaces"));
309

    
310
if ($user_settings['webgui']['interfacessort']) {
311
	$interfaces_bottom = msort($interfaces_bottom, 0);
312
}
313

    
314
// Combine the top section, the divider and the bottom section of this menu
315
$interfaces_menu = array_merge($interfaces_top, [array(0 => "-DIVIDER-")], $interfaces_bottom);
316

    
317
// Firewall
318
$firewall_menu = array();
319
$firewall_menu[] = array(gettext("Aliases"), "/firewall_aliases.php");
320
$firewall_menu[] = array(gettext("NAT"), "/firewall_nat.php");
321
$firewall_menu[] = array(gettext("Rules"), "/firewall_rules.php");
322
$firewall_menu[] = array(gettext("Schedules"), "/firewall_schedule.php");
323
$firewall_menu[] = array(gettext("Traffic Shaper"), "/firewall_shaper.php");
324
$firewall_menu[] = array(gettext("Virtual IPs"), "/firewall_virtual_ip.php");
325
$firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")), 0);
326

    
327
// Services
328
$services_menu = array();
329
$services_menu[] = array(gettext("Captive Portal"), "/services_captiveportal.php");
330
$services_menu[] = array(gettext("DNS Forwarder"), "/services_dnsmasq.php");
331
$services_menu[] = array(gettext("DNS Resolver"), "/services_unbound.php");
332
$services_menu[] = array(gettext("DHCP Relay"), "/services_dhcp_relay.php");
333
$services_menu[] = array(gettext("DHCPv6 Relay"), "/services_dhcpv6_relay.php");
334

    
335
if ($g['services_dhcp_server_enable']) {
336
	$services_menu[] = array(gettext("DHCP Server"), "/services_dhcp.php");
337
	$services_menu[] = array(htmlspecialchars(gettext("DHCPv6 Server & RA")), "/services_dhcpv6.php");
338
}
339

    
340
$services_menu[] = array(gettext("Dynamic DNS"), "/services_dyndns.php");
341
$services_menu[] = array(gettext("IGMP Proxy"), "/services_igmpproxy.php");
342
$services_menu[] = array(gettext("Load Balancer"), "/load_balancer_pool.php");
343
$services_menu[] = array(gettext("NTP"), "/services_ntpd.php");
344
$services_menu[] = array(gettext("PPPoE Server"), "/services_pppoe.php");
345
$services_menu[] = array(gettext("SNMP"), "/services_snmp.php");
346

    
347
if (count($config['interfaces']) > 1) {
348
	/* no use for UPnP in single-interface deployments
349
	remove to reduce user confusion
350
	*/
351
	$services_menu[] = array(gettext("UPnP &amp; NAT-PMP"), "/pkg_edit.php?xml=miniupnpd.xml");
352
}
353

    
354
$services_menu[] = array(gettext("Wake-on-LAN"), "/services_wol.php");
355
$services_menu = msort(array_merge($services_menu, return_ext_menu("Services")), 0);
356

    
357
// VPN
358
$vpn_menu = array();
359
$vpn_menu[] = array(gettext("IPsec"), "/vpn_ipsec.php");
360
$vpn_menu[] = array(gettext("OpenVPN"), "/vpn_openvpn_server.php");
361
//$vpn_menu[] = array(gettext("PPTP"), "/vpn_pptp.php");
362
$vpn_menu[] = array(gettext("L2TP"), "/vpn_l2tp.php");
363
$vpn_menu = msort(array_merge($vpn_menu, return_ext_menu("VPN")), 0);
364

    
365
// Status
366
$status_menu = array();
367
$status_menu[] = array(gettext("Captive Portal"), "/status_captiveportal.php");
368
$status_menu[] = array(gettext("CARP (failover)"), "/status_carp.php");
369
$status_menu[] = array(gettext("Dashboard"), "/index.php");
370
$status_menu[] = array(gettext("Gateways"), "/status_gateways.php");
371
$status_menu[] = array(gettext("DHCP Leases"), "/status_dhcp_leases.php");
372
$status_menu[] = array(gettext("DHCPv6 Leases"), "/status_dhcpv6_leases.php");
373
$status_menu[] = array(gettext("Filter Reload"), "/status_filter_reload.php?user=true");
374
$status_menu[] = array(gettext("Interfaces"), "/status_interfaces.php");
375
$status_menu[] = array(gettext("IPsec"), "/status_ipsec.php");
376
$status_menu[] = array(gettext("Load Balancer"), "/status_lb_pool.php");
377
$status_menu[] = array(gettext("NTP"), "/status_ntpd.php");
378
$status_menu[] = array(gettext("OpenVPN"), "/status_openvpn.php");
379

    
380
if ($g['platform'] == $g['product_name']) {
381
	$status_menu[] = array(gettext("Package Logs"), "/status_pkglogs.php");
382
}
383

    
384
$status_menu[] = array(gettext("Queues"), "/status_queues.php");
385
$status_menu[] = array(gettext("Services"), "/status_services.php");
386
$status_menu[] = array(gettext("System Logs"), "/status_logs.php");
387
$status_menu[] = array(gettext("Traffic Graph"), "/status_graph.php?if=wan");
388

    
389
if (count($config['interfaces']) > 1) {
390
	$status_menu[] = array(gettext("UPnP &amp; NAT-PMP"), "/status_upnp.php");
391
}
392

    
393
$ifentries = get_configured_interface_with_descr();
394
foreach ($ifentries as $ent => $entdesc) {
395
	if (is_array($config['interfaces'][$ent]['wireless']) &&
396
	    preg_match($g['wireless_regex'], $config['interfaces'][$ent]['if'])) {
397
		$wifdescrs[$ent] = $entdesc;
398
	}
399
}
400

    
401
if (count($wifdescrs) > 0) {
402
	$status_menu[] = array(gettext("Wireless"), "/status_wireless.php");
403
}
404

    
405
$status_menu = msort(array_merge($status_menu, return_ext_menu("Status")), 0);
406

    
407
// Diagnostics
408
$diagnostics_menu = array();
409
$diagnostics_menu[] = array(gettext("ARP Table"), "/diag_arp.php");
410
$diagnostics_menu[] = array(gettext("Authentication"), "/diag_authentication.php");
411
$diagnostics_menu[] = array(htmlspecialchars(gettext("Backup & Restore")), "/diag_backup.php");
412
$diagnostics_menu[] = array(gettext("Command Prompt"), "/diag_command.php");
413
$diagnostics_menu[] = array(gettext("DNS Lookup"), "/diag_dns.php");
414
$diagnostics_menu[] = array(gettext("Edit File"), "/diag_edit.php");
415
$diagnostics_menu[] = array(gettext("Factory Defaults"), "/diag_defaults.php");
416

    
417
if (file_exists("/var/run/gmirror_active")) {
418
	$diagnostics_menu[] = array(gettext("GEOM Mirrors"), "/diag_gmirror.php");
419
}
420

    
421
$diagnostics_menu[] = array(gettext("Halt System"), "/diag_halt.php");
422
$diagnostics_menu[] = array(gettext("Limiter Info"), "/diag_limiter_info.php");
423
$diagnostics_menu[] = array(gettext("NDP Table"), "/diag_ndp.php");
424
$diagnostics_menu[] = array(gettext("Tables"), "/diag_tables.php");
425
$diagnostics_menu[] = array(gettext("Ping"), "/diag_ping.php");
426
$diagnostics_menu[] = array(gettext("Test Port"), "/diag_testport.php");
427
$diagnostics_menu[] = array(gettext("pfInfo"), "/diag_pf_info.php");
428
$diagnostics_menu[] = array(gettext("pfTop"), "/diag_pftop.php");
429
$diagnostics_menu[] = array(gettext("Reboot"), "/diag_reboot.php");
430
$diagnostics_menu[] = array(gettext("Routes"), "/diag_routes.php");
431
$diagnostics_menu[] = array(gettext("S.M.A.R.T. Status"), "/diag_smart.php");
432
$diagnostics_menu[] = array(gettext("Sockets"), "/diag_sockets.php");
433
$diagnostics_menu[] = array(gettext("States"), "/diag_dump_states.php");
434
$diagnostics_menu[] = array(gettext("States Summary"), "/diag_states_summary.php");
435
$diagnostics_menu[] = array(gettext("System Activity"), "/diag_system_activity.php");
436
$diagnostics_menu[] = array(gettext("Traceroute"), "/diag_traceroute.php");
437
$diagnostics_menu[] = array(gettext("Packet Capture"), "/diag_packet_capture.php");
438

    
439
if ($g['platform'] == "nanobsd") {
440
	$diagnostics_menu[] = array(gettext("NanoBSD"), "/diag_nanobsd.php");
441
}
442

    
443
if (isset($config['system']['developer'])) {
444
	$diagnostics_menu[] = array(gettext("Restart HTTPD"), "/restart_httpd.php", "style" => "font-weight: bold; color: yellow;");
445
}
446

    
447
$diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")), 0);
448

    
449
$gold_menu = array();
450
$gold_menu[] = array(gettext("pfSense Gold"), "https://www.pfsense.org/gold");
451
$gold_menu = msort(array_merge($gold_menu, return_ext_menu("Gold")), 0);
452

    
453
if (!$g['disablehelpmenu']) {
454
	$help_menu = array();
455
	$help_menu[] = array(gettext("About this Page"), $helpurl);
456
	if ($g['product_name'] == "pfSense") {
457
		$help_menu[] = array(gettext("Bug Database"), "https://www.pfsense.org/j.php?jumpto=redmine");
458
	}
459

    
460
	$help_menu[] = array(gettext("User Forum"), "https://www.pfsense.org/j.php?jumpto=forum");
461
	$help_menu[] = array(gettext("Documentation"), "https://www.pfsense.org/j.php?jumpto=doc");
462
	$help_menu[] = array(gettext("Paid Support"), "https://www.netgate.com/support");
463
	$help_menu[] = array(gettext("pfSense Book"), "https://www.pfsense.org/j.php?jumpto=book");
464
	$help_menu[] = array(gettext("FreeBSD Handbook"), "https://www.pfsense.org/j.php?jumpto=fbsdhandbook");
465
	$help_menu = msort(array_merge($help_menu, return_ext_menu("Help")), 0);
466
}
467

    
468
$menuclass = "static";
469

    
470
if ($user_settings['webgui']['webguifixedmenu'] == "fixed") {
471
	$menuclass = "fixed";
472
}
473

    
474
$numColumns = $user_settings['webgui']['dashboardcolumns'];
475

    
476
if (($pagename === "index.php") && ($numColumns > 2)) {
477
	$columnsContainer = 'style="max-width: ' . 585*$numColumns . 'px;width: 100%"';
478
}
479
?>
480
<body id="<?=$numColumns?>">
481
<nav id="topmenu" class="navbar navbar-<?=$menuclass?>-top navbar-inverse">
482
	<div class="container">
483
		<div class="navbar-header">
484
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#pf-navbar">
485
				<span class="sr-only">Toggle navigation</span>
486
				<span class="icon-bar"></span>
487
				<span class="icon-bar"></span>
488
				<span class="icon-bar"></span>
489
			</button>
490
			<a class="navbar-brand" href="/"><img src="/logo.png" alt="pfSense" title="<?=$config['system']['hostname'] . '.' . $config['system']['domain']?>"/></a>
491
		</div>
492
		<div class="collapse navbar-collapse" id="pf-navbar">
493
			<ul class="nav navbar-nav">
494
			<?php
495
                if ($user_settings['webgui']['webguihostnamemenu'] == 'hostonly') {
496
                    $help_menu_title = htmlspecialchars($config['system']['hostname']);
497
                }
498
                elseif ($user_settings['webgui']['webguihostnamemenu'] == 'fqdn') {
499
                    $help_menu_title = htmlspecialchars($config['system']['hostname'] . "." . $config['system']['domain']);
500
                }
501
                else {
502
                    $help_menu_title = 'Help';
503
                }
504
                foreach ([
505
					['name' => 'System',	     'menu' => $system_menu,	  'href' => null],
506
					['name' => 'Interfaces',     'menu' => $interfaces_menu,  'href' => null],
507
					['name' => 'Firewall',	     'menu' => $firewall_menu,	  'href' => null],
508
					['name' => 'Services',	     'menu' => $services_menu,	  'href' => null],
509
					['name' => 'VPN',		     'menu' => $vpn_menu,		  'href' => null],
510
					['name' => 'Status',	     'menu' => $status_menu,	  'href' => null],
511
					['name' => 'Diagnostics',    'menu' => $diagnostics_menu, 'href' => null],
512
					['name' => 'Gold',		     'menu' => $gold_menu,		  'href' => '_blank'],
513
                    ['name' => $help_menu_title, 'menu' => $help_menu,		  'href' => '_blank']
514
				] as $item):
515
					if ($item['name'] == 'Help' && $g['disablehelpmenu']) {
516
						continue;
517
					} ?>
518
				<li class="dropdown">
519
					<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
520
						<?=gettext($item['name'])?>
521
						<span class="caret"></span>
522
					</a>
523
					<ul class="dropdown-menu" role="menu"><?=output_menu($item['menu'], $item['href'], $item['name'])?></ul>
524
				</li>
525
			<?php endforeach?>
526
			</ul>
527
			<ul class="nav navbar-nav navbar-right">
528
				<?php if (are_notices_pending()):?>
529
					<?php $notices = get_notices()?>
530
					<li class="dropdown">
531
						<a href="#" data-toggle="modal" data-target="#notices" role="button" aria-expanded="false">
532
							<i class="fa fa-bell text-danger" title="<?=gettext("Notices")?>"></i>
533
							<span class="badge bg-danger"><?=count($notices)?></span>
534
						</a>
535
					</li>
536
				<?php
537
					endif;
538
				?>
539
					<li class="dropdown">
540
						<a href="/index.php?logout">
541
							<i class="fa fa-sign-out" title="<?=gettext("Log out")?>"></i>
542
						</a>
543
					</li>
544
			</ul>
545
		</div>
546
	</div>
547
</nav>
548

    
549
<div class="container <?=$menuclass?>" <?=$columnsContainer?>>
550
	<header class="header">
551

    
552
<?php
553
	// If you set $notitle = true BEFORE including head.inc, the page title will be supressed
554
	if (isset($notitle)) {
555
		print('<br />');
556
		unset($notitle);
557
	} else {
558
		if (isset($pglinks)) {
559
			print(genhtmltitle($pgtitle, $pglinks));
560
		} else {
561
			print(genhtmltitle($pgtitle));
562
		}
563
	}
564
?>
565
		<ul class="context-links">
566

    
567
	<?php if (isset($widgets)): ?>
568
		<li>
569
			<a href="#" title="<?=gettext("Save dashboard layout")?>" id="btnstore" class="invisible">
570
				<i class="fa fa-save icon-pointer"></i>
571
			</a>
572
		</li>
573
	<?php endif?>
574

    
575
	<?php if ($dashboard_available_widgets_hidden): ?>
576
		<li>
577
			<a onclick="$('#widget-available').toggle(360);" title="<?=gettext("Available widgets")?>">
578
				<i class="fa fa-plus icon-pointer"></i>
579
			</a>
580
		</li>
581
	<?php endif?>
582

    
583
	<?php if ($system_logs_filter_form_hidden): ?>
584
		<li>
585
			<a onclick="$('#filter-form').toggle(360)" title="<?=gettext("Log filter")?>">
586
				<i class="fa fa-filter icon-pointer"></i>
587
			</a>
588
		</li>
589
	<?php endif ?>
590

    
591
	<?php if ($system_logs_manage_log_form_hidden):
592
			/* If the user does not have access to status logs settings page, then exclude the manage log panel icon from the title bar. */
593
			if (isAllowedPage("status_logs_settings.php")) {
594
	?>
595
		<li>
596
			<a onclick="$('#manage-log-form').toggle(360)" title="<?=gettext("Manage log")?>">
597
				<i class="fa fa-wrench icon-pointer"></i>
598
			</a>
599
		</li>
600
	<?php	}
601
		endif
602
	?>
603

    
604
	<?php if ($monitoring_settings_form_hidden): ?>
605
		<li>
606
			<a onclick="$('#monitoring-settings-form').toggle(360);" title="<?=gettext("Settings")?>">
607
				<i class="fa fa-wrench icon-pointer"></i>
608
			</a>
609
		</li>
610
	<?php endif?>
611

    
612
	<?php if ($status_monitoring): ?>
613
		<li>
614
			<a class="update-graph" title="<?=gettext("Refresh Graph")?>">
615
				<i class="fa fa-repeat icon-pointer"></i>
616
			</a>
617
		</li>
618
		<li>
619
			<a class="export-graph" id="export-graph" title="<?=gettext("Export Graph")?>">
620
				<i class="fa fa-download icon-pointer"></i>
621
			</a>
622
		</li>
623
	<?php endif?>
624

    
625
<?php
626
if (!$hide_service_status && !empty($shortcuts[$shortcut_section]['service']) && isAllowedPage('status_services.php')) {
627
	$ssvc = array();
628
	switch ($shortcut_section) {
629
		case "openvpn":
630
			$ssvc = find_service_by_openvpn_vpnid($vpnid);
631
			break;
632
		case "captiveportal":
633
			$ssvc = find_service_by_cp_zone($cpzone);
634
			break;
635
		default:
636
			$ssvc = find_service_by_name($shortcuts[$shortcut_section]['service']);
637
	}
638
	if (!empty($ssvc)) {
639
		// echo '<li>'. get_service_status_icon($ssvc, false). '</li>'; TODO: Add missing function
640
		echo '<li>'. get_service_control_links($ssvc, false). '</li>';
641
	}
642
}
643

    
644
if (('' != ($link = get_shortcut_main_link($shortcut_section, false))) && (isAllowedPage($shortcuts[$shortcut_section]['main']))) {
645
	echo '<li>' . $link . '</li>';
646
}
647

    
648
if (('' != ($link = get_shortcut_status_link($shortcut_section, false))) && (isAllowedPage($shortcuts[$shortcut_section]['status']))) {
649
	echo '<li>' . $link . '</li>';
650
}
651

    
652
if (('' != ($link = get_shortcut_log_link($shortcut_section, false))) && (isAllowedPage($shortcuts[$shortcut_section]['log']))) {
653
	echo '<li>' . $link . '</li>';
654
}
655

    
656
?>
657
	<?php if (!$g['disablehelpicon']): ?>
658
		<li>
659
			<a href="<?=$helpurl?>" target="_blank" title="<?=gettext("Help for items on this page")?>">
660
				<i class="fa fa-question-circle"></i>
661
			</a>
662
		</li>
663
	<?php endif?>
664
		</ul>
665
	</header>
666
<?php
667
/* if upgrade in progress, alert user */
668
if (is_subsystem_dirty('packagelock') || (file_exists('/conf/needs_package_sync') && platform_booting())) {
669
	if (file_exists('/conf/needs_package_sync') && platform_booting()) {
670
		$warning_text = sprintf(gettext("<p>%s is booting, then packages will be reinstalled in the background.</p><p>Do not make changes in the GUI until this is complete.</p>"), $g['product_name']);
671
	} else {
672
		$pgtitle = array(gettext("System"), gettext("Package Manager"));
673
		$warning_text = gettext("<p>Packages are currently being reinstalled in the background.</p><p>Do not make changes in the GUI until this is complete.</p>");
674
		$warning_text .= sprintf(gettext('<p>If the above message is still displayed after a couple of hours, use the \'Clear Package Lock\' button on the <a href="diag_backup.php" title="%1$s &gt; %2$s">%1$s &gt; %2$s</a> page and reinstall packages manually.</p>'), gettext('Diagnostics'), htmlspecialchars(gettext('Backup & Restore')));
675
	}
676

    
677
	print_info_box($warning_text);
678
}
679

    
680
/*	If this page is being remotely managed then do not allow the loading of the contents. */
681
if ($config['remote_managed_pages']['item']) {
682
	foreach ($config['remote_managed_pages']['item'] as $rmp) {
683
		if ($rmp == $_SERVER['SCRIPT_NAME']) {
684
			print_info_box(gettext("This page is currently being managed by a remote machine."));
685
			include("foot.inc");
686
			exit;
687
		}
688
	}
689
}
690

    
691
// Modal notices window
692
// The notices modal needs to be outside of the page display div or things get messy
693
if (are_notices_pending()):?>
694

    
695
<div id="notices" class="modal fade" role="dialog">
696
	<div class="modal-dialog">
697
		<div class="modal-content">
698
			<div class="modal-header">
699
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
700
					<span aria-hidden="true">&times;</span>
701
				</button>
702

    
703
				<h3 class="modal-title" id="myModalLabel"><?=gettext("Notices")?></h3>
704
			</div>
705

    
706
			<div class="modal-body">
707
<?php
708
	$noticeCategories = array();
709

    
710
	if (is_array($notices)) {
711
		foreach ($notices as $time => $notice) {
712
			if (!isset($noticeCategories[ $notice['category'] ])) {
713
				$noticeCategories[ $notice['category'] ] = array();
714
			}
715

    
716
			$notice['time'] = $time;
717
			array_push($noticeCategories[ $notice['category'] ], $notice);
718
		}
719
	}
720

    
721
	foreach ($noticeCategories as $category => $catNotices):?>
722
				<h4><?=$category?></h4>
723
				<ul>
724
<?php
725
	foreach ($catNotices as $notice):
726
?>
727
					<li>
728
						<b>
729
<?php if (!empty($notice['url'])):?>
730
							<a href="<?=htmlspecialchars($notice['url'])?>"><?=htmlspecialchars($notice['id'])?></a> -
731
<?php endif;?>
732
						</b>
733
						<?=str_replace("\n", "<br/>", htmlspecialchars($notice['notice']))?>
734
						<i>@ <?=date('Y-m-d H:i:s', $notice['time'])?></i>
735
					</li>
736
<?php	endforeach;?>
737
				</ul>
738
<?php endforeach;?>
739
			</div>
740

    
741
			<div class="modal-footer">
742
				<button type="button" class="btn btn-info" data-dismiss="modal"><i class="fa fa-times icon-embed-btn"></i><?=gettext("Close")?></button>
743
<?php if (isAllowedPage("/index.php")):?>
744
				<button type="button" id="clearallnotices" class="btn btn-primary"><i class="fa fa-trash-o icon-embed-btn"></i><?=gettext("Mark All as Read")?></button>
745
<?php endif;?>
746
			</div>
747
		</div>
748
	</div>
749
</div>
750

    
751
<script type="text/javascript">
752
//<![CDATA[
753
	events.push(function() {
754
	    $('#clearallnotices').click(function() {
755
			ajaxRequest = $.ajax({
756
				url: "/index.php",
757
				type: "post",
758
				data: { closenotice: "all"},
759
				success: function() {
760
					window.location = window.location.href;
761
				},
762
				failure: function() {
763
					alert("Error clearing notices!");
764
				}
765
			});
766
		});
767
	});
768
//]]>
769
</script>
770

    
771
<?php endif;
772

    
773
// Get the flash Messages
774
get_flash_message();
(67-67/233)