Project

General

Profile

Download (32.8 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
 * Licensed under the Apache License, Version 2.0 (the "License");
10
 * you may not use this file except in compliance with the License.
11
 * You may obtain a copy of the License at
12
 *
13
 * http://www.apache.org/licenses/LICENSE-2.0
14
 *
15
 * Unless required by applicable law or agreed to in writing, software
16
 * distributed under the License is distributed on an "AS IS" BASIS,
17
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
 * See the License for the specific language governing permissions and
19
 * limitations under the License.
20
 */
21

    
22
require_once("globals.inc");
23
require_once("functions.inc");
24
require_once("shortcuts.inc");
25
require_once("service-utils.inc");
26
require_once('notices.inc');
27

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

    
30
$pagetitle = gentitle($pgtitle);
31
$system_url = $config['system']['hostname'] . "." . $config['system']['domain'];
32

    
33
if ($user_settings['webgui']['pagenamefirst']) {
34
	$tabtitle = $pagetitle . " - " . htmlspecialchars($system_url);
35
} else {
36
	$tabtitle = htmlspecialchars($system_url) . " - " . $pagetitle;
37
}
38

    
39
$cssfile = "/css/pfSense.css";
40

    
41
if (isset($user_settings['webgui']['webguicss'])) {
42
	if (file_exists("/usr/local/www/css/" . $user_settings['webgui']['webguicss'])) {
43
		$cssfile = "/css/" . $user_settings['webgui']['webguicss'];
44
	}
45
}
46

    
47
// set default columns to two if unset
48
if (!isset($config['system']['webgui']['dashboardcolumns'])) {
49
	$config['system']['webgui']['dashboardcolumns'] = 2;
50
}
51

    
52
?>
53
<!DOCTYPE html>
54
<html lang="en">
55
<head>
56
	<meta name="viewport" content="width=device-width, initial-scale=1">
57

    
58
	<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
59
	<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
60
	<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
61
	<link rel="manifest" href="/manifest.json">
62
	<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
63
	<meta name="theme-color" content="#ffffff">
64

    
65
	<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')?>">
66
	<link rel="stylesheet" href="/vendor/sortable/sortable-theme-bootstrap.css?v=<?=filemtime('/usr/local/www/vendor/sortable/sortable-theme-bootstrap.css')?>">
67
	<link rel="stylesheet" href="<?=$cssfile?>?v=<?=filemtime('/usr/local/www/' . $cssfile)?>" />
68

    
69
	<title><?=$tabtitle?></title>
70
	<script type="text/javascript">
71
	//<![CDATA[
72
	var events = events || [];
73
	//]]>
74
	</script>
75
</head>
76

    
77
<?php
78

    
79
/* Determine automated help URL. Should output the page name and parameters
80
   separately */
81
$uri_split = "";
82
preg_match("/\/(.*)\?(.*)/", $_SERVER["REQUEST_URI"], $uri_split);
83

    
84
/* If there was no match, there were no parameters, just grab the filename
85
   Otherwise, use the matched filename from above. */
86
if (empty($uri_split[0])) {
87
	$pagename = ltrim($_SERVER["REQUEST_URI"], '/');
88
} else {
89
	$pagename = $uri_split[1];
90
}
91

    
92
/* If the page name is still empty, the user must have requested / (index.php) */
93
if (empty($pagename)) {
94
	$pagename = "index.php";
95
}
96

    
97
/* If the filename is pkg_edit.php or wizard.php, reparse looking
98
	for the .xml filename */
99
if (($pagename == "pkg.php") || ($pagename == "pkg_edit.php") || ($pagename == "wizard.php")) {
100
	$param_split = explode('&', $uri_split[2]);
101
	foreach ($param_split as $param) {
102
		if (substr($param, 0, 4) == "xml=") {
103
			$xmlfile = explode('=', $param);
104
			$pagename = $xmlfile[1];
105
		}
106
	}
107
} else if ($pagename == "status_logs.php") {
108
	$param_split = explode('&', $uri_split[2]);
109
	foreach ($param_split as $param) {
110
		if (substr($param, 0, 8) == "logfile=") {
111
			$logtype = explode('=', $param);
112
			$pagename .= '-' . $logtype[1];
113
		}
114
	}
115
}
116

    
117
// Build the full help URL.
118
$helpurl .= "{$g['help_base_url']}?page={$pagename}";
119

    
120
/*
121
 * Read files from $g['ext_menu_path']/*.xml and fill an array with menu info
122
 */
123
function read_ext_menu_path_data() {
124
	global $g;
125

    
126
	$result = array();
127

    
128
	if (!is_dir($g['ext_menu_path'])) {
129
		return $result;
130
	}
131

    
132
	foreach (glob("{$g['ext_menu_path']}/*.xml") as $menu_xml) {
133
		$xml_data = parse_xml_config_pkg($menu_xml, "packagegui");
134
		if (empty($xml_data['menu'])) {
135
			continue;
136
		}
137
		foreach ($xml_data['menu'] as $menu) {
138
			$result[] = $menu;
139
		}
140
	}
141

    
142
	return $result;
143
}
144

    
145
// Create a menu entry of any installed packages in the specified category
146
// (Now reads the menu information from $config['installedpackages']['menu'] only)
147
function return_ext_menu($section) {
148
	global $config, $ext_menu_path_data;
149

    
150
	$htmltext = "";
151
	$extarray = array();
152
	$ext_menu_entries = array();
153

    
154
	if ((!empty($config['installedpackages']['package'])) && (!empty($config['installedpackages']['menu']))) {
155
		foreach ($config['installedpackages']['menu'] as $menu) {
156
//			print('Name: ' . $menu['name'] . ', Pkg category: ' . $menu['category'] . ', Section: ' . $section . '<br />');
157
			if ($menu['section'] == $section) {
158
				$ext_menu_entries[] = $menu;
159
			}
160
		}
161
	}
162

    
163
	foreach ($ext_menu_path_data as $menu) {
164
		if ($menu['section'] == $section) {
165
			$ext_menu_entries[] = $menu;
166
		}
167
	}
168

    
169
	foreach ($ext_menu_entries as $menu) {
170
		if ($menu['url'] != "") {
171
			$test_url = $menu['url'];
172
			$addresswithport = getenv("HTTP_HOST");
173
			$colonpos = strpos($addresswithport, ":");
174

    
175
			if ($colonpos !== false) {
176
				//my url is actually just the IP address of the pfsense box
177
				$myurl = substr($addresswithport, 0, $colonpos);
178
			} else {
179
				$myurl = $addresswithport;
180
			}
181
			$description = str_replace('$myurl', $myurl, $menu['url']);
182
		} else {
183
			$description = '/pkg.php?xml=' . $menu['configfile'];
184
			$test_url=$description;
185
		}
186

    
187
		if (isAllowedPage($test_url)) {
188
			$extarray[] = array($menu['name'], $description);
189
		}
190
	}
191

    
192
	return $extarray;
193
}
194

    
195
function output_menu($arrayitem, $target = null, $section = "") {
196
	$output = "";
197

    
198
	foreach ($arrayitem as $item) {
199

    
200
		/* If the user has access to help pages, also show the full help menu. See #5909 */
201
		if (isAllowedPage($item[1]) || $item[1] == "/index.php?logout" ||
202
		    (($section == "Help") && isAllowedPage("help.php")) ||
203
		    (substr($item[1], 0, 8) == "https://")) {
204
			$attr = sprintf("href=\"%s\"", htmlentities($item[1]));
205

    
206
			if ($target) {
207
				$attr .= sprintf(" target=\"%s\"", htmlentities($target));
208
			}
209

    
210
			$class = "navlnk";
211

    
212
			if ($item['class']) {
213
				$class .= " {$item['class']}";
214
			}
215

    
216
			$attr .= sprintf(" class=\"%s\"", htmlentities($class));
217

    
218
			if ($item['style']) {
219
				$attr .= sprintf(" style=\"%s\"", htmlentities($item['style']));
220
			}
221

    
222

    
223
			if ($item[0] == '-DIVIDER-') {
224
				$output .= ' <li class="divider"></li>';
225
			} else {
226
				$output .= "<li>". sprintf("<a %s %s>%s</a>", $attr, ($item[1] == "/index.php?logout") ? "usepost":"",$item[0]) . "</li>\n";
227
			}
228
		}
229
	}
230

    
231
	return $output;
232
}
233

    
234
$ext_menu_path_data = read_ext_menu_path_data();
235

    
236
// System
237
$system_menu = array();
238
$system_menu[] = array(gettext("Logout") . " (" . $_SESSION['Username'] . ")", "/index.php?logout");
239
$system_menu[] = array(gettext("Advanced"), "/system_advanced_admin.php");
240
$system_menu[] = array(gettext("Update"), "/pkg_mgr_install.php?id=firmware");
241
$system_menu[] = array(gettext("General Setup"), "/system.php");
242
$system_menu[] = array(gettext("High Avail. Sync"), "/system_hasync.php");
243
$system_menu[] = array(gettext("Package Manager"), "/pkg_mgr_installed.php");
244
$system_menu[] = array(gettext("Setup Wizard"), "/wizard.php?xml=setup_wizard.xml");
245
$system_menu[] = array(gettext("Routing"), "/system_gateways.php");
246
$system_menu[] = array(gettext("Cert. Manager"), "/system_camanager.php");
247
if (!isAllowedPage("system_usermanager.php*")) {
248
	$system_menu[] = array(gettext("User Manager"), "/system_usermanager_passwordmg.php");
249
} else {
250
	$system_menu[] = array(gettext("User Manager"), "/system_usermanager.php");
251
}
252

    
253
if ($user_settings['customsettings'] && isAllowedPage("system_user_settings.php*")) {
254
	$system_menu[] = array(gettext("User Settings"), "/system_user_settings.php");
255
}
256

    
257
$system_menu = msort(array_merge($system_menu, return_ext_menu("System")), 0);
258

    
259
// Interfaces
260
// NOTE:
261
// Now that menus are sorted, adding a DIVIDER must be done after the sorting so an array is formed of the
262
// items above the divider and another for below it. These are then sorted and combined with the divider
263
$interfaces_menu = array();
264
$interfaces_top = array();
265
$interfaces_bottom = array();
266

    
267
if (!isset($config['system']['webgui']['noassigninterfaces'])) {
268
	$interfaces_top[] = array(gettext("Assignments"), "/interfaces_assign.php");
269
	$div = true;
270
}
271

    
272
$platform = system_identify_specific_platform();
273

    
274
if ($platform['name'] == "uFW") {
275
	$interfaces_top[] = array(gettext("Switches"), "/switch_system.php");
276
}
277

    
278
$opts = get_configured_interface_with_descr(true);
279

    
280
foreach ($opts as $oif => $odescr) {
281
	if (!isset($config['interfaces'][$oif]['ovpn'])) {
282
		$interfaces_bottom[] = array(htmlspecialchars($odescr), "/interfaces.php?if={$oif}");
283
	}
284
}
285

    
286
$interfaces_bottom = array_merge($interfaces_bottom, return_ext_menu("Interfaces"));
287

    
288
if ($user_settings['webgui']['interfacessort']) {
289
	$interfaces_bottom = msort($interfaces_bottom, 0);
290
}
291

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

    
295
// Firewall
296
$firewall_menu = array();
297
$firewall_menu[] = array(gettext("Aliases"), "/firewall_aliases.php");
298
$firewall_menu[] = array(gettext("NAT"), "/firewall_nat.php");
299
$firewall_menu[] = array(gettext("Rules"), "/firewall_rules.php");
300
$firewall_menu[] = array(gettext("Schedules"), "/firewall_schedule.php");
301
$firewall_menu[] = array(gettext("Traffic Shaper"), "/firewall_shaper.php");
302
$firewall_menu[] = array(gettext("Virtual IPs"), "/firewall_virtual_ip.php");
303
$firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")), 0);
304

    
305
// Services
306
$services_menu = array();
307
$services_menu[] = array(gettext("Captive Portal"), "/services_captiveportal.php");
308
$services_menu[] = array(gettext("DNS Forwarder"), "/services_dnsmasq.php");
309
$services_menu[] = array(gettext("DNS Resolver"), "/services_unbound.php");
310
$services_menu[] = array(gettext("DHCP Relay"), "/services_dhcp_relay.php");
311
$services_menu[] = array(gettext("DHCPv6 Relay"), "/services_dhcpv6_relay.php");
312

    
313
if ($g['services_dhcp_server_enable']) {
314
	$services_menu[] = array(gettext("DHCP Server"), "/services_dhcp.php");
315
	$services_menu[] = array(htmlspecialchars(gettext("DHCPv6 Server & RA")), "/services_dhcpv6.php");
316
}
317

    
318
$services_menu[] = array(gettext("Dynamic DNS"), "/services_dyndns.php");
319
$services_menu[] = array(gettext("IGMP Proxy"), "/services_igmpproxy.php");
320
$services_menu[] = array(gettext("Load Balancer"), "/load_balancer_pool.php");
321
$services_menu[] = array(gettext("NTP"), "/services_ntpd.php");
322
$services_menu[] = array(gettext("PPPoE Server"), "/services_pppoe.php");
323
$services_menu[] = array(gettext("SNMP"), "/services_snmp.php");
324

    
325
if (count($config['interfaces']) > 1) {
326
	/* no use for UPnP in single-interface deployments
327
	remove to reduce user confusion
328
	*/
329
	$services_menu[] = array(gettext("UPnP &amp; NAT-PMP"), "/pkg_edit.php?xml=miniupnpd.xml");
330
}
331

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

    
335
// VPN
336
$vpn_menu = array();
337
$vpn_menu[] = array(gettext("IPsec"), "/vpn_ipsec.php");
338
$vpn_menu[] = array(gettext("OpenVPN"), "/vpn_openvpn_server.php");
339
//$vpn_menu[] = array(gettext("PPTP"), "/vpn_pptp.php");
340
$vpn_menu[] = array(gettext("L2TP"), "/vpn_l2tp.php");
341
$vpn_menu = msort(array_merge($vpn_menu, return_ext_menu("VPN")), 0);
342

    
343
// Status
344
$status_menu = array();
345
$status_menu[] = array(gettext("Captive Portal"), "/status_captiveportal.php");
346
$status_menu[] = array(gettext("CARP (failover)"), "/status_carp.php");
347
$status_menu[] = array(gettext("Dashboard"), "/index.php");
348
$status_menu[] = array(gettext("Gateways"), "/status_gateways.php");
349
$status_menu[] = array(gettext("DHCP Leases"), "/status_dhcp_leases.php");
350
$status_menu[] = array(gettext("DHCPv6 Leases"), "/status_dhcpv6_leases.php");
351
$status_menu[] = array(gettext("Filter Reload"), "/status_filter_reload.php?user=true");
352
$status_menu[] = array(gettext("Interfaces"), "/status_interfaces.php");
353
$status_menu[] = array(gettext("IPsec"), "/status_ipsec.php");
354
$status_menu[] = array(gettext("Load Balancer"), "/status_lb_pool.php");
355
$status_menu[] = array(gettext("NTP"), "/status_ntpd.php");
356
$status_menu[] = array(gettext("OpenVPN"), "/status_openvpn.php");
357
$status_menu[] = array(gettext("Package Logs"), "/status_pkglogs.php");
358
$status_menu[] = array(gettext("Queues"), "/status_queues.php");
359
$status_menu[] = array(gettext("Services"), "/status_services.php");
360
$status_menu[] = array(gettext("System Logs"), "/status_logs.php");
361
$status_menu[] = array(gettext("Traffic Graph"), "/status_graph.php?if=wan");
362

    
363
if (count($config['interfaces']) > 1) {
364
	$status_menu[] = array(gettext("UPnP &amp; NAT-PMP"), "/status_upnp.php");
365
}
366

    
367
$ifentries = get_configured_interface_with_descr();
368
foreach ($ifentries as $ent => $entdesc) {
369
	if (is_array($config['interfaces'][$ent]['wireless']) &&
370
	    preg_match($g['wireless_regex'], $config['interfaces'][$ent]['if'])) {
371
		$wifdescrs[$ent] = $entdesc;
372
	}
373
}
374

    
375
if (count($wifdescrs) > 0) {
376
	$status_menu[] = array(gettext("Wireless"), "/status_wireless.php");
377
}
378

    
379
$status_menu = msort(array_merge($status_menu, return_ext_menu("Status")), 0);
380

    
381
// Diagnostics
382
$diagnostics_menu = array();
383
$diagnostics_menu[] = array(gettext("ARP Table"), "/diag_arp.php");
384
$diagnostics_menu[] = array(gettext("Authentication"), "/diag_authentication.php");
385
$diagnostics_menu[] = array(htmlspecialchars(gettext("Backup & Restore")), "/diag_backup.php");
386
$diagnostics_menu[] = array(gettext("Command Prompt"), "/diag_command.php");
387
$diagnostics_menu[] = array(gettext("DNS Lookup"), "/diag_dns.php");
388
$diagnostics_menu[] = array(gettext("Edit File"), "/diag_edit.php");
389
$diagnostics_menu[] = array(gettext("Factory Defaults"), "/diag_defaults.php");
390

    
391
if (file_exists("/var/run/gmirror_active")) {
392
	$diagnostics_menu[] = array(gettext("GEOM Mirrors"), "/diag_gmirror.php");
393
}
394

    
395
$diagnostics_menu[] = array(gettext("Halt System"), "/diag_halt.php");
396
$diagnostics_menu[] = array(gettext("Limiter Info"), "/diag_limiter_info.php");
397
$diagnostics_menu[] = array(gettext("NDP Table"), "/diag_ndp.php");
398
$diagnostics_menu[] = array(gettext("Tables"), "/diag_tables.php");
399
$diagnostics_menu[] = array(gettext("Ping"), "/diag_ping.php");
400
$diagnostics_menu[] = array(gettext("Test Port"), "/diag_testport.php");
401
$diagnostics_menu[] = array(gettext("pfInfo"), "/diag_pf_info.php");
402
$diagnostics_menu[] = array(gettext("pfTop"), "/diag_pftop.php");
403
$diagnostics_menu[] = array(gettext("Reboot"), "/diag_reboot.php");
404
$diagnostics_menu[] = array(gettext("Routes"), "/diag_routes.php");
405
$diagnostics_menu[] = array(gettext("S.M.A.R.T. Status"), "/diag_smart.php");
406
$diagnostics_menu[] = array(gettext("Sockets"), "/diag_sockets.php");
407
$diagnostics_menu[] = array(gettext("States"), "/diag_dump_states.php");
408
$diagnostics_menu[] = array(gettext("States Summary"), "/diag_states_summary.php");
409
$diagnostics_menu[] = array(gettext("System Activity"), "/diag_system_activity.php");
410
$diagnostics_menu[] = array(gettext("Traceroute"), "/diag_traceroute.php");
411
$diagnostics_menu[] = array(gettext("Packet Capture"), "/diag_packet_capture.php");
412

    
413
$diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")), 0);
414

    
415
$gold_menu = array();
416
$gold_menu[] = array(gettext("pfSense Gold"), "https://www.pfsense.org/gold");
417
$gold_menu = msort(array_merge($gold_menu, return_ext_menu("Gold")), 0);
418

    
419
if (!$g['disablehelpmenu']) {
420
	$help_menu = array();
421
	$help_menu[] = array(gettext("About this Page"), $helpurl);
422
	if ($g['product_name'] == "pfSense") {
423
		$help_menu[] = array(gettext("Bug Database"), "https://www.pfsense.org/j.php?jumpto=redmine");
424
	}
425

    
426
	$help_menu[] = array(gettext("User Forum"), "https://www.pfsense.org/j.php?jumpto=forum");
427
	$help_menu[] = array(gettext("Documentation"), "https://www.pfsense.org/j.php?jumpto=doc");
428
	$help_menu[] = array(gettext("Paid Support"), "https://www.netgate.com/support");
429
	$help_menu[] = array(gettext("pfSense Book"), "https://www.pfsense.org/j.php?jumpto=book");
430
	$help_menu[] = array(gettext("FreeBSD Handbook"), "https://www.pfsense.org/j.php?jumpto=fbsdhandbook");
431
	$help_menu = msort(array_merge($help_menu, return_ext_menu("Help")), 0);
432
}
433

    
434
$menuclass = "static";
435

    
436
if ($user_settings['webgui']['webguifixedmenu'] == "fixed") {
437
	$menuclass = "fixed";
438
}
439

    
440
$numColumns = $user_settings['webgui']['dashboardcolumns'];
441

    
442
if (($pagename === "index.php") && ($numColumns > 2)) {
443
	$columnsContainer = 'style="max-width: ' . 585*$numColumns . 'px;width: 100%"';
444
}
445

    
446
$display_notices = false;
447
$allow_clear_notices = false;
448

    
449
if (are_notices_pending()) {
450
	// Evaluate user privs to determine if notices should be displayed, and if the user can clear them.
451
	$user_entry = getUserEntry($_SESSION['Username']);
452
	if (isAdminUID($_SESSION['Username']) || userHasPrivilege($user_entry, "user-view-clear-notices") || userHasPrivilege($user_entry, "page-all")) {
453
		$display_notices = true;
454
		$allow_clear_notices = true;
455
	} elseif (userHasPrivilege($user_entry, "user-view-notices")) {
456
		$display_notices = true;
457
	}
458
}
459
?>
460
<body id="<?=$numColumns?>">
461
<nav id="topmenu" class="navbar navbar-<?=$menuclass?>-top navbar-inverse">
462
	<div class="container">
463
		<div class="navbar-header">
464
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#pf-navbar">
465
				<span class="sr-only">Toggle navigation</span>
466
				<span class="icon-bar"></span>
467
				<span class="icon-bar"></span>
468
				<span class="icon-bar"></span>
469
			</button>
470
			<a class="navbar-brand" href="/">
471
				<svg role="img" aria-labelledby="pfsense-logo" x="0px" y="0px" viewBox="0 0 282.8 84.2" width="105">
472
					<title id="pfsense-logo-svg">pfSense Logo</title>
473
					<style type="text/css">
474
						.logo-st0{fill:#FFFFFF;}
475
						.logo-st1{fill:#FFFFFF;}
476
						.logo-st2{fill:#FFFFFF;}
477
					</style>
478
					<path class="logo-st0" d="M27.8,57.7c2.9,0,5.4-0.9,7.5-2.6c2.1-1.7,3.6-4,4.4-6.8c0.8-2.8,0.6-5.1-0.5-6.8c-1.1-1.7-3.2-2.6-6.1-2.6 c-2.9,0-5.4,0.9-7.5,2.6c-2.1,1.7-3.5,4-4.3,6.8c-0.8,2.8-0.7,5.1,0.5,6.8C22.8,56.9,24.8,57.7,27.8,57.7"/>
479
					<path class="logo-st0" d="M115.1,46.6c-1.5-0.8-3-1.4-4.7-1.8c-1.7-0.4-3.2-0.7-4.7-1.1c-1.5-0.3-2.7-0.7-3.6-1.1c-0.9-0.4-1.4-1.1-1.4-2 c0-1.1,0.5-1.9,1.4-2.4c0.9-0.5,1.9-0.7,2.8-0.7c2.8,0,5,1,6.7,3.1l7-7c-1.7-1.8-3.9-3.1-6.4-3.8c-2.5-0.7-5-1.1-7.4-1.1 c-1.9,0-3.9,0.2-5.7,0.7c-1.9,0.5-3.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M278.6,65.7c-0.5,0-1,0.1-1.5,0.4c-0.5,0.3-0.8,0.6-1.1,1.1 c-0.3,0.5-0.4,1-0.4,1.5c0,0.5,0.1,1,0.4,1.5c0.3,0.5,0.6,0.8,1.1,1.1c0.5,0.3,1,0.4,1.5,0.4c0.5,0,1-0.1,1.5-0.4 c0.5-0.3,0.8-0.6,1.1-1.1c0.3-0.5,0.4-1,0.4-1.5c0-0.5-0.1-1-0.4-1.5c-0.3-0.5-0.6-0.8-1.1-1.1C279.6,65.8,279.1,65.7,278.6,65.7z M278.6,65.1c0.6,0,1.2,0.2,1.8,0.5c0.6,0.3,1,0.7,1.3,1.3c0.3,0.6,0.5,1.2,0.5,1.8c0,0.6-0.2,1.2-0.5,1.8c-0.3,0.6-0.8,1-1.3,1.3 c-0.6,0.3-1.2,0.5-1.8,0.5c-0.6,0-1.2-0.2-1.8-0.5c-0.6-0.3-1-0.8-1.3-1.3c-0.3-0.6-0.5-1.2-0.5-1.8c0-0.6,0.2-1.2,0.5-1.8 c0.3-0.6,0.8-1,1.3-1.3C277.4,65.2,278,65.1,278.6,65.1z"/>
487
				</svg>
488
				<span style="color:white;font-size:.5em;text-transform:uppercase;letter-spacing:1px;">Community Edition</span>
489
			</a>
490
		</div>
491
		<div class="collapse navbar-collapse" id="pf-navbar">
492
			<ul class="nav navbar-nav">
493
			<?php
494
                if ($user_settings['webgui']['webguihostnamemenu'] == 'hostonly') {
495
                    $help_menu_title = htmlspecialchars($config['system']['hostname']);
496
                }
497
                elseif ($user_settings['webgui']['webguihostnamemenu'] == 'fqdn') {
498
                    $help_menu_title = htmlspecialchars($system_url);
499
                }
500
                else {
501
                    $help_menu_title = 'Help';
502
                }
503
                foreach ([
504
					['name' => 'System',	     'menu' => $system_menu,	  'href' => null],
505
					['name' => 'Interfaces',     'menu' => $interfaces_menu,  'href' => null],
506
					['name' => 'Firewall',	     'menu' => $firewall_menu,	  'href' => null],
507
					['name' => 'Services',	     'menu' => $services_menu,	  'href' => null],
508
					['name' => 'VPN',		     'menu' => $vpn_menu,		  'href' => null],
509
					['name' => 'Status',	     'menu' => $status_menu,	  'href' => null],
510
					['name' => 'Diagnostics',    'menu' => $diagnostics_menu, 'href' => null],
511
//					['name' => 'Gold',		     'menu' => $gold_menu,		  'href' => '_blank'],
512
                    ['name' => $help_menu_title, 'menu' => $help_menu,		  'href' => '_blank']
513
				] as $item):
514
					if ($item['name'] == 'Help' && $g['disablehelpmenu']) {
515
						continue;
516
					}
517

    
518
					$menu_output = output_menu($item['menu'], $item['href'], $item['name']);
519

    
520
					if (strlen($menu_output) > 0):
521
?>
522
				<li class="dropdown">
523
					<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
524
						<?=gettext($item['name'])?>
525
						<span class="caret"></span>
526
					</a>
527
					<ul class="dropdown-menu" role="menu"><?=$menu_output?></ul>
528
				</li>
529

    
530
<?php
531
					endif;
532
			 	endforeach?>
533
			</ul>
534
			<ul class="nav navbar-nav navbar-right">
535
				<?php if ($display_notices):?>
536
					<?php $notices = get_notices()?>
537
					<li class="dropdown">
538
						<a href="#" data-toggle="modal" data-target="#notices" role="button" aria-expanded="false">
539
							<i class="fa fa-bell text-danger" title="<?=gettext("Notices")?>"></i>
540
							<span class="badge bg-danger"><?=count($notices)?></span>
541
						</a>
542
					</li>
543
				<?php
544
					endif;
545
				?>
546
					<li class="dropdown">
547
						<a href="/index.php?logout" usepost>
548
							<i class="fa fa-sign-out" title="<?=gettext("Logout") . " (" . $_SESSION['Username'] . "@" . htmlspecialchars($system_url) . ")"?>"></i>
549
						</a>
550
					</li>
551
			</ul>
552
		</div>
553
	</div>
554
</nav>
555

    
556
<div class="container <?=$menuclass?>" <?=$columnsContainer?>>
557
	<header class="header">
558

    
559
<?php
560
	// If you set $notitle = true BEFORE including head.inc, the page title will be supressed
561
	if (isset($notitle)) {
562
		print('<br />');
563
		unset($notitle);
564
	} else {
565
		if (isset($pglinks)) {
566
			print(genhtmltitle($pgtitle, $pglinks));
567
		} else {
568
			print(genhtmltitle($pgtitle));
569
		}
570
	}
571
?>
572
		<ul class="context-links">
573

    
574
	<?php if (isset($widgets)): ?>
575
		<li>
576
			<a href="#" title="<?=gettext("Save dashboard layout")?>" id="btnstore" class="invisible">
577
				<i class="fa fa-save icon-pointer"></i>
578
			</a>
579
		</li>
580
	<?php endif?>
581

    
582
	<?php if ($dashboard_available_widgets_hidden): ?>
583
		<li>
584
			<a onclick="$('#widget-available').toggle(360);" title="<?=gettext("Available widgets")?>">
585
				<i class="fa fa-plus icon-pointer"></i>
586
			</a>
587
		</li>
588
	<?php endif?>
589

    
590
	<?php if ($system_logs_filter_form_hidden): ?>
591
		<li>
592
			<a onclick="$('#filter-form').toggle(360)" title="<?=gettext("Log filter")?>">
593
				<i class="fa fa-filter icon-pointer"></i>
594
			</a>
595
		</li>
596
	<?php endif ?>
597

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

    
611
	<?php if ($monitoring_settings_form_hidden): ?>
612
		<li>
613
			<a onclick="$('#monitoring-settings-form').toggle(360);" title="<?=gettext("Settings")?>">
614
				<i class="fa fa-wrench icon-pointer"></i>
615
			</a>
616
		</li>
617
	<?php endif?>
618

    
619
	<?php if ($status_monitoring): ?>
620
		<li>
621
			<a class="update-graph" title="<?=gettext("Refresh Graph")?>">
622
				<i class="fa fa-repeat icon-pointer"></i>
623
			</a>
624
		</li>
625
		<li>
626
			<a class="export-graph" id="export-graph" title="<?=gettext("Export Graph")?>">
627
				<i class="fa fa-download icon-pointer"></i>
628
			</a>
629
		</li>
630
	<?php endif?>
631

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

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

    
655
if (('' != ($link = get_shortcut_status_link($shortcut_section, false))) && (isAllowedPage($shortcuts[$shortcut_section]['status']))) {
656
	echo '<li>' . $link . '</li>';
657
}
658

    
659
if (('' != ($link = get_shortcut_log_link($shortcut_section, false))) && (isAllowedPage($shortcuts[$shortcut_section]['log']))) {
660
	echo '<li>' . $link . '</li>';
661
}
662

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

    
684
	print_info_box($warning_text);
685
}
686

    
687
/*	If this page is being remotely managed then do not allow the loading of the contents. */
688
if ($config['remote_managed_pages']['item']) {
689
	foreach ($config['remote_managed_pages']['item'] as $rmp) {
690
		if ($rmp == $_SERVER['SCRIPT_NAME']) {
691
			print_info_box(gettext("This page is currently being managed by a remote machine."));
692
			include("foot.inc");
693
			exit;
694
		}
695
	}
696
}
697

    
698
// Modal notices window
699
// The notices modal needs to be outside of the page display div or things get messy
700
if ($display_notices):
701
?>
702

    
703
<div id="notices" class="modal fade" role="dialog">
704
	<div class="modal-dialog">
705
		<div class="modal-content">
706
			<div class="modal-header">
707
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
708
					<span aria-hidden="true">&times;</span>
709
				</button>
710

    
711
				<h3 class="modal-title" id="myModalLabel"><?=gettext("Notices")?></h3>
712
			</div>
713

    
714
			<div class="modal-body">
715
<?php
716
	$noticeCategories = array();
717

    
718
	if (is_array($notices)) {
719
		foreach ($notices as $time => $notice) {
720
			if (!isset($noticeCategories[ $notice['category'] ])) {
721
				$noticeCategories[ $notice['category'] ] = array();
722
			}
723

    
724
			$notice['time'] = $time;
725
			array_push($noticeCategories[ $notice['category'] ], $notice);
726
		}
727
	}
728

    
729
	foreach ($noticeCategories as $category => $catNotices):?>
730
				<h4><?=$category?></h4>
731
				<ul>
732
<?php
733
	foreach ($catNotices as $notice):
734
?>
735
					<li>
736
						<b>
737
<?php if (!empty($notice['url'])):?>
738
							<a href="<?=htmlspecialchars($notice['url'])?>"><?=htmlspecialchars($notice['id'])?></a> -
739
<?php endif;?>
740
						</b>
741
						<?=str_replace("\n", "<br/>", htmlspecialchars($notice['notice']))?>
742
						<i>@ <?=date('Y-m-d H:i:s', $notice['time'])?></i>
743
					</li>
744
<?php	endforeach;?>
745
				</ul>
746
<?php endforeach;?>
747
			</div>
748

    
749
			<div class="modal-footer">
750
				<button type="button" class="btn btn-info" data-dismiss="modal"><i class="fa fa-times icon-embed-btn"></i><?=gettext("Close")?></button>
751
<?php if ($allow_clear_notices && isAllowedPage("/index.php")):?>
752
				<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>
753
<?php endif;?>
754
			</div>
755
		</div>
756
	</div>
757
</div>
758

    
759
<script type="text/javascript">
760
//<![CDATA[
761
	events.push(function() {
762
	    $('#clearallnotices').click(function() {
763
			ajaxRequest = $.ajax({
764
				url: "/index.php",
765
				type: "post",
766
				data: { closenotice: "all"},
767
				success: function() {
768
					window.location = window.location.href;
769
				},
770
				failure: function() {
771
					alert("Error clearing notices!");
772
				}
773
			});
774
		});
775
	});
776
//]]>
777
</script>
778

    
779
<?php
780
endif; // ($display_notices)
781

    
782
// Get the flash Messages
783
get_flash_message();
(66-66/228)