Project

General

Profile

Download (17.7 KB) Statistics
| Branch: | Tag: | Revision:
1

    
2
<script src="/javascript/sorttable.js"></script>
3
<style id="antiClickjack">body{display:none}</style> <script type="text/JavaScript">
4
if (self === top) { var antiClickjack = document.getElementById("antiClickjack"); antiClickjack.parentNode.removeChild(antiClickjack);
5
} else { top.location = self.location;
6
}</script>
7

    
8
<?php
9
/*
10
	pfSense_MODULE:	header
11
*/
12

    
13
require_once("globals.inc");
14
require_once("functions.inc");
15

    
16
/* $Id$ */
17

    
18

    
19
/* Determine automated help URL. Should output the page name and
20
   parameters separately */
21
$uri_split = "";
22
preg_match("/\/(.*)\?(.*)/", $_SERVER["REQUEST_URI"], $uri_split);
23

    
24
/* If there was no match, there were no parameters, just grab the filename
25
   Otherwise, use the matched filename from above. */
26
if (empty($uri_split[0])) {
27
	$pagename = ltrim($_SERVER["REQUEST_URI"], '/');
28
} else {
29
	$pagename = $uri_split[1];
30
}
31
/* If the page name is still empty, the user must have requested / (index.php) */
32
if (empty($pagename)) {
33
	$pagename = "index.php";
34
}
35

    
36
/* If the filename is pkg_edit.php or wizard.php, reparse looking
37
	for the .xml filename */
38
if (($pagename == "pkg.php") || ($pagename == "pkg_edit.php") || ($pagename == "wizard.php")) {
39
	$param_split = explode('&', $uri_split[2]);
40
	foreach ($param_split as $param) {
41
		if (substr($param, 0, 4) == "xml=") {
42
			$xmlfile = explode('=', $param);
43
			$pagename = $xmlfile[1];
44
		}
45
	}
46
}
47

    
48
/* Build the full help URL. */
49
$helpurl .= "{$g['help_base_url']}?page={$pagename}";
50

    
51
function return_ext_menu($section) {
52
	global $config;
53
	$htmltext = "";
54
	$extarray = array();
55
	if($config['installedpackages']['menu'] <> "") {
56
		foreach($config['installedpackages']['menu'] as $menuitem) {
57
			if($menuitem['section'] != $section) continue;
58
			if($menuitem['url'] <> "") {
59
			 	$addresswithport = getenv("HTTP_HOST");
60
				$colonpos = strpos($addresswithport, ":");
61
				if ($colonpos !== False){
62
					//my url is actually just the IP address of the pfsense box
63
					$myurl = substr($addresswithport, 0, $colonpos);
64
				} else {
65
					$myurl = $addresswithport;
66
				}
67
				$description = str_replace('$myurl', $myurl, $menuitem['url']);
68
			} else {
69
				$description = '/pkg.php?xml=' . $menuitem['configfile'];
70
			}
71
			$extarray[] = array($menuitem['name'], $description);
72
		}
73
	}
74
	return $extarray;
75
}
76

    
77
function output_menu($arrayitem, $target="") {
78
	foreach($arrayitem as $item) {
79
		if($target)
80
			$targetinfo = "target='{$target}'";
81
		echo '<li><a ' . $targetinfo. ' href="' . $item[1] . '" class="navlnk">' . $item[0] . '</a></li>' . "\n";
82
	}
83
}
84

    
85
// System
86
$system_menu = array();
87
$system_menu[] = array(gettext("Advanced"), "/system_advanced_admin.php");
88
$system_menu[] = array(gettext("Firmware"), "/system_firmware.php");
89
$system_menu[] = array(gettext("General Setup"), "/system.php");
90
$system_menu[] = array(gettext("High Avail. Sync"), "/system_hasync.php");
91
$system_menu[] = array(gettext("Logout"), "/index.php?logout");
92
if ($g['platform'] == "pfSense" or $g['platform'] == "nanobsd")
93
	$system_menu[] = array(gettext("Packages"), "/pkg_mgr_installed.php");
94
$system_menu[] = array(gettext("Setup Wizard"), "/wizard.php?xml=setup_wizard.xml");
95
$system_menu[] = array(gettext("Routing"), "/system_gateways.php");
96
$system_menu[] = array(gettext("Cert Manager"), "/system_camanager.php");
97
if (!isAllowedPage("system_usermanager.php*"))
98
	$system_menu[] = array(gettext("User Manager"), "/system_usermanager_passwordmg.php");
99
else
100
	$system_menu[] = array(gettext("User Manager"), "/system_usermanager.php");
101
$system_menu = msort(array_merge($system_menu, return_ext_menu("System")),0);
102

    
103
// Interfaces
104
$interfaces_menu = array();
105
if (!isset($config['system']['webgui']['noassigninterfaces']))
106
	$interfaces_menu[] = array("(assign)", "/interfaces_assign.php");
107
$opts = get_configured_interface_with_descr(false, true);
108
foreach ($opts as $oif => $odescr)
109
	if (!isset($config['interfaces'][$oif]['ovpn']))
110
		$interfaces_menu[] = array(htmlspecialchars($odescr), "/interfaces.php?if={$oif}");
111
$interfaces_menu = msort(array_merge($interfaces_menu, return_ext_menu("Interfaces")),0);
112

    
113
// Firewall
114
$firewall_menu = array();
115
$firewall_menu[] = array(gettext("Aliases"), "/firewall_aliases.php");
116
$firewall_menu[] = array(gettext("NAT"), "/firewall_nat.php");
117
$firewall_menu[] = array(gettext("Rules"), "/firewall_rules.php");
118
$firewall_menu[] = array(gettext("Schedules"), "/firewall_schedule.php");
119
$firewall_menu[] = array(gettext("Traffic Shaper"), "/firewall_shaper.php");
120
$firewall_menu[] = array(gettext("Virtual IPs"), "/firewall_virtual_ip.php");
121
$firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")),0);
122

    
123
// Services
124
$services_menu = array();
125
$services_menu[] = array(gettext("Captive Portal"), "/services_captiveportal.php");
126
$services_menu[] = array(gettext("DNS Forwarder"), "/services_dnsmasq.php");
127
$services_menu[] = array(gettext("DHCP Relay"), "/services_dhcp_relay.php");
128
$services_menu[] = array(gettext("DHCPv6 Relay"), "/services_dhcpv6_relay.php");
129
if($g['services_dhcp_server_enable']) {
130
	$services_menu[] = array(gettext("DHCP Server"), "/services_dhcp.php");
131
	$services_menu[] = array(gettext("DHCPv6 Server"), "/services_dhcpv6.php");
132
}
133
$services_menu[] = array(gettext("Dynamic DNS"), "/services_dyndns.php");
134
$services_menu[] = array(gettext("IGMP proxy"), "/services_igmpproxy.php");
135
$services_menu[] = array(gettext("Load Balancer"), "/load_balancer_pool.php");
136
$services_menu[] = array(gettext("OLSR"), "/pkg_edit.php?xml=olsrd.xml&id=0");
137
$services_menu[] = array(gettext("PPPoE Server"), "/vpn_pppoe.php");
138
$services_menu[] = array(gettext("RIP"), "/pkg_edit.php?xml=routed.xml&id=0");
139
$services_menu[] = array(gettext("SNMP"), "/services_snmp.php");
140
if(count($config['interfaces']) > 1) {
141
	/* no use for UPnP in single-interface deployments
142
	remove to reduce user confusion
143
	*/
144
	$services_menu[] = array(gettext("UPnP &amp; NAT-PMP"), "/pkg_edit.php?xml=miniupnpd.xml&id=0");
145
}
146
$services_menu[] = array(gettext("Wake on LAN"), "/services_wol.php");
147
$services_menu = msort(array_merge($services_menu, return_ext_menu("Services")),0);
148

    
149
// VPN
150
$vpn_menu = array();
151
$vpn_menu[] = array(gettext("IPsec"), "/vpn_ipsec.php");
152
$vpn_menu[] = array(gettext("OpenVPN"), "/vpn_openvpn_server.php");
153
$vpn_menu[] = array(gettext("PPTP"), "/vpn_pptp.php");
154
$vpn_menu[] = array(gettext("L2TP"), "/vpn_l2tp.php");
155
$vpn_menu = msort(array_merge($vpn_menu, return_ext_menu("VPN")),0);
156

    
157
// Status
158
$status_menu = array();
159
if (count($config['captiveportal']) > 0)
160
	$status_menu[] = array(gettext("Captive Portal"), "/status_captiveportal.php");
161
$status_menu[] = array(gettext("CARP (failover)"), "/carp_status.php");
162
$status_menu[] = array(gettext("Dashboard"), "/index.php");
163
$status_menu[] = array(gettext("Gateways"), "/status_gateways.php");
164
$status_menu[] = array(gettext("DHCP Leases"), "/status_dhcp_leases.php");
165
$status_menu[] = array(gettext("DHCPv6 Leases"), "/status_dhcpv6_leases.php");
166
$status_menu[] = array(gettext("Filter Reload"), "/status_filter_reload.php");
167
$status_menu[] = array(gettext("Interfaces"), "/status_interfaces.php");
168
$status_menu[] = array(gettext("IPsec"), "/diag_ipsec.php");
169
$status_menu[] = array(gettext("Load Balancer"), "/status_lb_pool.php");
170
$status_menu[] = array(gettext("NTP"), "/status_ntpd.php");
171
$status_menu[] = array(gettext("OpenVPN"), "/status_openvpn.php");
172
if ($g['platform'] == "pfSense")
173
	$status_menu[] = array(gettext("Package Logs"), "/diag_pkglogs.php");
174
$status_menu[] = array(gettext("Queues"), "/status_queues.php");
175
$status_menu[] = array(gettext("RRD Graphs"), "/status_rrd_graph.php");
176
$status_menu[] = array(gettext("Services"), "/status_services.php");
177
$status_menu[] = array(gettext("System Logs"), "/diag_logs.php");
178
$status_menu[] = array(gettext("Traffic Graph"), "/status_graph.php?if=wan");
179
if(count($config['interfaces']) > 1) 
180
	$status_menu[] = array(gettext("UPnP &amp; NAT-PMP"), "/status_upnp.php");
181
$ifentries = get_configured_interface_with_descr();
182
foreach ($ifentries as $ent => $entdesc) {
183
	if (is_array($config['interfaces'][$ent]['wireless']) &&
184
		preg_match($g['wireless_regex'], $config['interfaces'][$ent]['if']))
185
		$wifdescrs[$ent] = $entdesc;
186
}
187
if (count($wifdescrs) > 0)
188
	$status_menu[] = array(gettext("Wireless"), "/status_wireless.php");
189
$status_menu = msort(array_merge($status_menu, return_ext_menu("Status")),0);
190

    
191
// Diagnostics
192
$diagnostics_menu = array();
193
$diagnostics_menu[] = array(gettext("ARP Table"), "/diag_arp.php");
194
$diagnostics_menu[] = array(gettext("Authentication"), "/diag_authentication.php");
195
$diagnostics_menu[] = array(gettext("Backup/Restore"), "/diag_backup.php");
196
$diagnostics_menu[] = array(gettext("Command Prompt"), "/exec.php");
197
$diagnostics_menu[] = array(gettext("DNS Lookup"), "/diag_dns.php");
198
$diagnostics_menu[] = array(gettext("Edit File"), "/edit.php");
199
$diagnostics_menu[] = array(gettext("Factory Defaults"), "/diag_defaults.php");
200
$diagnostics_menu[] = array(gettext("Halt System"), "/halt.php" );
201
$diagnostics_menu[] = array(gettext("Limiter Info"), "/diag_limiter_info.php" );
202
$diagnostics_menu[] = array(gettext("NDP Table"), "/diag_ndp.php" );
203

    
204
$diagnostics_menu[] = array(gettext("Tables"), "/diag_tables.php");
205
$diagnostics_menu[] = array(gettext("Ping"), "/diag_ping.php");
206
$diagnostics_menu[] = array(gettext("pfInfo"), "/diag_pf_info.php");
207
$diagnostics_menu[] = array(gettext("pfTop"), "/diag_system_pftop.php");
208
$diagnostics_menu[] = array(gettext("Reboot"), "/reboot.php");
209
$diagnostics_menu[] = array(gettext("Routes"), "/diag_routes.php");
210
$diagnostics_menu[] = array(gettext("SMART Status"), "/diag_smart.php");
211
$diagnostics_menu[] = array(gettext("States"), "/diag_dump_states.php");
212
$diagnostics_menu[] = array(gettext("States Summary"), "/diag_states_summary.php");
213
$diagnostics_menu[] = array(gettext("System Activity"), "/diag_system_activity.php");
214
$diagnostics_menu[] = array(gettext("Traceroute"), "/diag_traceroute.php");
215
$diagnostics_menu[] = array(gettext("Packet Capture"), "/diag_packet_capture.php");
216
if($g['platform'] == "nanobsd")
217
	$diagnostics_menu[] = array(gettext("NanoBSD"), "/diag_nanobsd.php");
218

    
219
if (isset($config['system']['developer'])) {
220
	echo "<li><hr width=\"80%\"/></li>";
221
	$diagnostics_menu[] = array(gettext("Restart HTTPD"), "/restart_httpd.php");
222
}
223
$diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")),0);
224

    
225
if(! $g['disablehelpmenu']) {
226
	$help_menu = array();
227
	$help_menu[] = array(gettext("About this Page"), $helpurl);
228
	if($g['product_name'] == "pfSense") 
229
		$help_menu[] = array(gettext("Bug Database"), "http://www.pfsense.org/j.php?jumpto=redmine");
230
	$help_menu[] = array(gettext("User Forum"), "http://www.pfsense.org/j.php?jumpto=forum");
231
	$help_menu[] = array(gettext("Documentation"), "http://www.pfsense.org/j.php?jumpto=doc");
232
	$help_menu[] = array(gettext("Developers Wiki"), "http://www.pfsense.org/j.php?jumpto=devwiki");
233
	$help_menu[] = array(gettext("Paid Support"), "http://www.pfsense.org/j.php?jumpto=portal");
234
	$help_menu[] = array(gettext("pfSense Book"), "http://www.pfsense.org/j.php?jumpto=book");
235
	$help_menu[] = array(gettext("Search portal"), "http://www.pfsense.org/j.php?jumpto=searchportal");
236
	$help_menu[] = array(gettext("FreeBSD Handbook"), "http://www.pfsense.org/j.php?jumpto=fbsdhandbook");
237
	$help_menu = msort(array_merge($help_menu, return_ext_menu("Help")),0);	
238
}
239

    
240
/* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */
241
if ($_REQUEST['noticeaction'] == 'acknowledge') {
242
	$notice_id = htmlspecialchars($_REQUEST['noticeid']);
243
	close_notice($notice_id);
244
}
245
/**********************************************/
246

    
247
?>
248

    
249
<div id="wrapper">
250
	<div id="header">
251
		<div id="header-left"><a href="/index.php" id="status-link"><img src="/themes/<?= $g['theme']; ?>/images/transparent.gif" border="0"></a></div>
252
		<div id="header-right">
253
			<div class="container">
254
				<div class="left">webConfigurator</div>
255
				<div class="right">
256
<?
257
				if (are_notices_pending()) {
258
					$notices = get_notices();
259

    
260
					$requests=array();
261

    
262
					## Get Query Arguments from URL ###
263
					foreach ($_REQUEST as $key => $value) {
264
						if ($key != "PHPSESSID")
265
							$requests[] = $key.'='.$value;
266
					}
267
					if(is_array($requests))
268
						$request_string = implode("&", $requests);
269

    
270
					if(is_array($notices)) {
271
						foreach ($notices as $key => $value) {
272
							$date = date("m-d-y H:i:s", $key);
273
							$noticemsg = str_replace("'", "", $value['notice']);
274
							$noticemsg = str_replace('"', "", $noticemsg);
275
							$noticemsg = str_replace("\n", "", $noticemsg);
276
							$noticemsg = str_replace("<p>", "", $noticemsg);
277
							$noticemsg = str_replace("<pre>", "", $noticemsg);
278
							$noticemsg = str_replace("</pre>", "", $noticemsg);
279
							$noticemsg = str_replace("</p>", "", $noticemsg);
280
							$noticemsg = str_replace("<br>", "", $noticemsg);
281
							$extra_args = "";
282
							if($_GET['xml']) 
283
								$extraargs="&xml=" .  htmlspecialchars($_GET['xml']);
284
							if($_POST['xml']) 
285
								$extraargs="&xml=" .  htmlspecialchars($_POST['xml']);
286
							if($_GET['id']) 
287
								$extraargs="&xml=" .  htmlspecialchars($_GET['id']);
288
							if($_POST['id'])
289
								$extraargs="&xml=" .  htmlspecialchars($_POST['id']);
290
							$notice_msgs = '<a href="?noticeaction=acknowledge&noticeid=all' . $extraargs . '">Acknowledge All</a> &nbsp;&nbsp;&nbsp;&nbsp;.:.&nbsp;&nbsp;&nbsp;&nbsp; ';
291
							if ($value['url']) {
292
								$notice_msgs .= $date.' - <a href="'.$url.'?' . htmlspecialchars($request_string) . '&noticeaction=acknowledge&noticeid='.$key.'">['.$value['id'].']</a>';
293
							} else {
294
								$notice_msgs .= $date.' - <a href="?' . htmlspecialchars($request_string) . '&noticeaction=acknowledge&noticeid='.$key.'">['.$value['id'].']'.htmlspecialchars($noticemsg).'</a>';
295
							}
296
							$notice_msgs .= " &nbsp;&nbsp;&nbsp;&nbsp;.:.&nbsp;&nbsp;&nbsp;&nbsp; ";
297
						}
298
					}
299
?>
300
					<div id="alerts">
301
						<script type="text/javascript">
302
							var content='<div id="marquee-text"><?= $notice_msgs; ?></div>'
303
						</script>
304
						<script type="text/javascript" src="/javascript/ticker.js"></script>
305
					</div>
306
<?
307
				} else {
308
?>
309
					<div id="hostname">
310
						<? print $config['system']['hostname'] . "." . $config['system']['domain']; ?>
311
					</div>
312
<?
313
				}
314
?>
315
				</div>
316
			</div>
317
		</div>
318
	</div> <!-- Header DIV -->
319
	<div id="content">
320
		<div id="left">
321
			<div id="navigation" style="z-index:1000">
322
				<ul id="menu">
323
					<li class="firstdrop">
324
						<div><?php echo gettext("System"); ?></div>
325
						<ul class="subdrop">
326
						<?php
327
							output_menu($system_menu);
328
						?>
329
						</ul>
330
					</li>
331
					<li class="drop">
332
						<div><?php echo gettext("Interfaces"); ?></div>
333
						<ul class="subdrop">
334
						<?php
335
							output_menu($interfaces_menu);
336
						?>
337
						</ul>
338
					</li>
339
					<li class="drop">
340
						<div><?php echo gettext("Firewall"); ?></div>
341
						<ul class="subdrop">
342
						<?php
343
							output_menu($firewall_menu);
344
						?>
345
						</ul>
346
					</li>
347
					<li class="drop">
348
						<div><?php echo gettext("Services"); ?></div>
349
						<ul class="subdrop">
350
						<?
351
							output_menu($services_menu);
352
						?>
353
						</ul>
354
					</li>
355
					<li class="drop">
356
						<div><?php echo gettext("VPN"); ?></div>
357
						<ul class="subdrop">
358
						<?php
359
							output_menu($vpn_menu);
360
						?>
361
						</ul>
362
					</li>
363
					<li class="drop">
364
						<div><?php echo gettext("Status"); ?></div>
365
						<ul class="subdrop">
366
						<?php
367
							output_menu($status_menu);
368
						?>
369
						</ul>
370
					</li>
371
					<li class="drop">
372
						<div><?php echo gettext("Diagnostics"); ?></div>
373
						<ul id="diag" class="subdrop">
374
						<?
375
							output_menu($diagnostics_menu);
376
						?>
377
						</ul>
378
					</li>
379
					<?php if(! $g['disablehelpmenu']): ?>
380
					<li class="lastdrop">
381
						<div><?php echo gettext("Help"); ?></div>
382
						<ul id="help" class="subdrop">
383
						<?
384
							output_menu($help_menu, "_new");
385
						?>
386
						</ul>
387
					</li>
388
					<?php endif; ?>
389
				</ul>
390
			</div>
391

    
392
		</div> <!-- Left DIV -->
393

    
394
		<div id="right">
395

    
396
<?php
397

    
398
	/* display a top alert bar if need be */
399
	$need_alert_display = false;
400
	$found_notices = are_notices_pending();
401
	if($found_notices == true) {
402
		$notices = get_notices();
403
		if(!$notices) {
404
			$need_alert_display = true;
405
			$display_text = print_notices($notices) . "<br>";
406
		}
407
	}
408
	if($need_alert_display == true) {
409
                echo "<div style=\"background-color:#000000\" id=\"roundalert\">";
410
                echo "<table>";
411
		echo "<tr><td><font color=\"#ffffff\">";
412
		echo "&nbsp;&nbsp;<img align=\"middle\" src=\"/top_notification.gif\">&nbsp;&nbsp;&nbsp;";
413
		echo $display_text;
414
		echo "</td>";
415
		echo "</tr>";
416
		echo "</table>";
417
		echo "</div>";
418
	}
419

    
420
function add_to_menu($url, $name) {
421
	if (isAllowedPage($url))
422
		echo "<li><a href=\"{$url}\" class=\"navlnk\">{$name}</a></li>\n";
423
}
424
?>
425

    
426
<div>
427
<span class="pgtitle"><a href="<?= $_SERVER['SCRIPT_NAME'] ?>"><?=genhtmltitle($pgtitle);?></a></span>
428
<span style="float:right; margin: 0 0 20px 20px;">
429
<?php if(! empty($statusurl)): ?>
430
<a href="<?php echo $statusurl; ?>" target="_new" title="<?php echo gettext("Status of items on this page."); ?>"><img src="/themes/<?php echo $g['theme']; ?>/images/status.png" border="0"></a>
431
<?php endif; ?>
432
<?php if(! empty($logurl)): ?>
433
<a href="<?php echo $logurl; ?>" target="_new" title="<?php echo gettext("Log entries for items on this page."); ?>"><img src="/themes/<?php echo $g['theme']; ?>/images/log.png" border="0"></a>
434
<?php endif; ?>
435
<?php if(! $g['disablehelpicon']): ?>
436
<a href="<?php echo $helpurl; ?>" target="_new" title="<?php echo gettext("Help for items on this page."); ?>"><img src="/themes/<?php echo $g['theme']; ?>/images/help.png" border="0"></a>
437
<?php endif; ?>
438
</span>
439
</div>
440
<br />
441

    
442
<?php
443
/* if upgrade in progress, alert user */
444
if(is_subsystem_dirty('packagelock')) {
445
	$pgtitle = array(gettext("System"),gettext("Package Manager"));
446
	print_info_box(gettext("Packages are currently being reinstalled in the background.<p>Do not make changes in the GUI until this is complete.") . "<p><img src='/themes/{$g['theme']}/images/icons/icon_fw-update.gif'>");
447
}
448
	$pgtitle_output = true;
449
?>
(55-55/246)