Project

General

Profile

Download (18 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 = null) {
78
	foreach ($arrayitem as $item) {
79
		$attr = sprintf("href=\"%s\"", htmlentities($item[1]));
80
		if ($target) {
81
			$attr .= sprintf(" target=\"%s\"", htmlentities($target));
82
		}
83
		$class = "navlnk";
84
		if ($item['class']) {
85
			$class .= " {$item['class']}";
86
		}
87
		$attr .= sprintf(" class=\"%s\"", htmlentities($class));
88
		if ($item['style']) {
89
			$attr .= sprintf(" style=\"%s\"", htmlentities($item['style']));
90
		}
91
		echo "<li>\n";
92
		printf("<a %s>%s</a>\n", $attr, $item[0]);
93
		echo "</li>\n";
94
	}
95
}
96

    
97
// System
98
$system_menu = array();
99
$system_menu[] = array(gettext("Advanced"), "/system_advanced_admin.php");
100
$system_menu[] = array(gettext("Firmware"), "/system_firmware.php");
101
$system_menu[] = array(gettext("General Setup"), "/system.php");
102
$system_menu[] = array(gettext("High Avail. Sync"), "/system_hasync.php");
103
$system_menu[] = array(gettext("Logout"), "/index.php?logout");
104
if ($g['platform'] == "pfSense" or $g['platform'] == "nanobsd")
105
	$system_menu[] = array(gettext("Packages"), "/pkg_mgr_installed.php");
106
$system_menu[] = array(gettext("Setup Wizard"), "/wizard.php?xml=setup_wizard.xml");
107
$system_menu[] = array(gettext("Routing"), "/system_gateways.php");
108
$system_menu[] = array(gettext("Cert Manager"), "/system_camanager.php");
109
if (!isAllowedPage("system_usermanager.php*"))
110
	$system_menu[] = array(gettext("User Manager"), "/system_usermanager_passwordmg.php");
111
else
112
	$system_menu[] = array(gettext("User Manager"), "/system_usermanager.php");
113
$system_menu = msort(array_merge($system_menu, return_ext_menu("System")),0);
114

    
115
// Interfaces
116
$interfaces_menu = array();
117
if (!isset($config['system']['webgui']['noassigninterfaces']))
118
	$interfaces_menu[] = array("(assign)", "/interfaces_assign.php");
119
$opts = get_configured_interface_with_descr(false, true);
120
foreach ($opts as $oif => $odescr)
121
	if (!isset($config['interfaces'][$oif]['ovpn']))
122
		$interfaces_menu[] = array(htmlspecialchars($odescr), "/interfaces.php?if={$oif}");
123
$interfaces_menu = msort(array_merge($interfaces_menu, return_ext_menu("Interfaces")),0);
124

    
125
// Firewall
126
$firewall_menu = array();
127
$firewall_menu[] = array(gettext("Aliases"), "/firewall_aliases.php");
128
$firewall_menu[] = array(gettext("NAT"), "/firewall_nat.php");
129
$firewall_menu[] = array(gettext("Rules"), "/firewall_rules.php");
130
$firewall_menu[] = array(gettext("Schedules"), "/firewall_schedule.php");
131
$firewall_menu[] = array(gettext("Traffic Shaper"), "/firewall_shaper.php");
132
$firewall_menu[] = array(gettext("Virtual IPs"), "/firewall_virtual_ip.php");
133
$firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")),0);
134

    
135
// Services
136
$services_menu = array();
137
$services_menu[] = array(gettext("Captive Portal"), "/services_captiveportal.php");
138
$services_menu[] = array(gettext("DNS Forwarder"), "/services_dnsmasq.php");
139
$services_menu[] = array(gettext("DHCP Relay"), "/services_dhcp_relay.php");
140
$services_menu[] = array(gettext("DHCPv6 Relay"), "/services_dhcpv6_relay.php");
141
if($g['services_dhcp_server_enable']) {
142
	$services_menu[] = array(gettext("DHCP Server"), "/services_dhcp.php");
143
	$services_menu[] = array(gettext("DHCPv6 Server/RA"), "/services_dhcpv6.php");
144
}
145
$services_menu[] = array(gettext("Dynamic DNS"), "/services_dyndns.php");
146
$services_menu[] = array(gettext("IGMP proxy"), "/services_igmpproxy.php");
147
$services_menu[] = array(gettext("Load Balancer"), "/load_balancer_pool.php");
148
$services_menu[] = array(gettext("NTP"), "/services_ntpd.php");
149
$services_menu[] = array(gettext("PPPoE Server"), "/vpn_pppoe.php");
150
$services_menu[] = array(gettext("RIP"), "/pkg_edit.php?xml=routed.xml&id=0");
151
$services_menu[] = array(gettext("SNMP"), "/services_snmp.php");
152
if(count($config['interfaces']) > 1) {
153
	/* no use for UPnP in single-interface deployments
154
	remove to reduce user confusion
155
	*/
156
	$services_menu[] = array(gettext("UPnP &amp; NAT-PMP"), "/pkg_edit.php?xml=miniupnpd.xml&id=0");
157
}
158
$services_menu[] = array(gettext("Wake on LAN"), "/services_wol.php");
159
$services_menu = msort(array_merge($services_menu, return_ext_menu("Services")),0);
160

    
161
// VPN
162
$vpn_menu = array();
163
$vpn_menu[] = array(gettext("IPsec"), "/vpn_ipsec.php");
164
$vpn_menu[] = array(gettext("OpenVPN"), "/vpn_openvpn_server.php");
165
$vpn_menu[] = array(gettext("PPTP"), "/vpn_pptp.php");
166
$vpn_menu[] = array(gettext("L2TP"), "/vpn_l2tp.php");
167
$vpn_menu = msort(array_merge($vpn_menu, return_ext_menu("VPN")),0);
168

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

    
203
// Diagnostics
204
$diagnostics_menu = array();
205
$diagnostics_menu[] = array(gettext("ARP Table"), "/diag_arp.php");
206
$diagnostics_menu[] = array(gettext("Authentication"), "/diag_authentication.php");
207
$diagnostics_menu[] = array(gettext("Backup/Restore"), "/diag_backup.php");
208
$diagnostics_menu[] = array(gettext("Command Prompt"), "/exec.php");
209
$diagnostics_menu[] = array(gettext("DNS Lookup"), "/diag_dns.php");
210
$diagnostics_menu[] = array(gettext("Edit File"), "/edit.php");
211
$diagnostics_menu[] = array(gettext("Factory Defaults"), "/diag_defaults.php");
212
$diagnostics_menu[] = array(gettext("Halt System"), "/halt.php" );
213
$diagnostics_menu[] = array(gettext("Limiter Info"), "/diag_limiter_info.php" );
214
$diagnostics_menu[] = array(gettext("NDP Table"), "/diag_ndp.php" );
215

    
216
$diagnostics_menu[] = array(gettext("Tables"), "/diag_tables.php");
217
$diagnostics_menu[] = array(gettext("Ping"), "/diag_ping.php");
218
$diagnostics_menu[] = array(gettext("pfInfo"), "/diag_pf_info.php");
219
$diagnostics_menu[] = array(gettext("pfTop"), "/diag_system_pftop.php");
220
$diagnostics_menu[] = array(gettext("Reboot"), "/reboot.php");
221
$diagnostics_menu[] = array(gettext("Routes"), "/diag_routes.php");
222
$diagnostics_menu[] = array(gettext("SMART Status"), "/diag_smart.php");
223
$diagnostics_menu[] = array(gettext("States"), "/diag_dump_states.php");
224
$diagnostics_menu[] = array(gettext("States Summary"), "/diag_states_summary.php");
225
$diagnostics_menu[] = array(gettext("System Activity"), "/diag_system_activity.php");
226
$diagnostics_menu[] = array(gettext("Traceroute"), "/diag_traceroute.php");
227
$diagnostics_menu[] = array(gettext("Packet Capture"), "/diag_packet_capture.php");
228
if($g['platform'] == "nanobsd")
229
	$diagnostics_menu[] = array(gettext("NanoBSD"), "/diag_nanobsd.php");
230

    
231
if (isset($config['system']['developer'])) {
232
	$diagnostics_menu[] = array(gettext("Restart HTTPD"), "/restart_httpd.php", "style" => "font-weight: bold; color: yellow;");
233
	
234
}
235
$diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")),0);
236

    
237
if(! $g['disablehelpmenu']) {
238
	$help_menu = array();
239
	$help_menu[] = array(gettext("About this Page"), $helpurl);
240
	if($g['product_name'] == "pfSense") 
241
		$help_menu[] = array(gettext("Bug Database"), "http://www.pfsense.org/j.php?jumpto=redmine");
242
	$help_menu[] = array(gettext("User Forum"), "http://www.pfsense.org/j.php?jumpto=forum");
243
	$help_menu[] = array(gettext("Documentation"), "http://www.pfsense.org/j.php?jumpto=doc");
244
	$help_menu[] = array(gettext("Developers Wiki"), "http://www.pfsense.org/j.php?jumpto=devwiki");
245
	$help_menu[] = array(gettext("Paid Support"), "http://www.pfsense.org/j.php?jumpto=portal");
246
	$help_menu[] = array(gettext("pfSense Book"), "http://www.pfsense.org/j.php?jumpto=book");
247
	$help_menu[] = array(gettext("Search portal"), "http://www.pfsense.org/j.php?jumpto=searchportal");
248
	$help_menu[] = array(gettext("FreeBSD Handbook"), "http://www.pfsense.org/j.php?jumpto=fbsdhandbook");
249
	$help_menu = msort(array_merge($help_menu, return_ext_menu("Help")),0);	
250
}
251

    
252
/* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */
253
if ($_REQUEST['noticeaction'] == 'acknowledge') {
254
	$notice_id = htmlspecialchars($_REQUEST['noticeid']);
255
	close_notice($notice_id);
256
}
257
/**********************************************/
258

    
259
?>
260

    
261
<div id="wrapper">
262
	<div id="header">
263
		<div id="header-left"><a href="/index.php" id="status-link"><img src="/themes/<?= $g['theme']; ?>/images/transparent.gif" border="0"></a></div>
264
		<div id="header-right">
265
			<div class="container">
266
				<div class="left">webConfigurator</div>
267
				<div class="right">
268
<?
269
				if (are_notices_pending()) {
270
					$notices = get_notices();
271

    
272
					$requests=array();
273

    
274
					## Get Query Arguments from URL ###
275
					foreach ($_REQUEST as $key => $value) {
276
						if ($key != "PHPSESSID")
277
							$requests[] = $key.'='.$value;
278
					}
279
					if(is_array($requests))
280
						$request_string = implode("&", $requests);
281

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

    
404
		</div> <!-- Left DIV -->
405

    
406
		<div id="right">
407

    
408
<?php
409

    
410
	/* display a top alert bar if need be */
411
	$need_alert_display = false;
412
	$found_notices = are_notices_pending();
413
	if($found_notices == true) {
414
		$notices = get_notices();
415
		if(!$notices) {
416
			$need_alert_display = true;
417
			$display_text = print_notices($notices) . "<br>";
418
		}
419
	}
420
	if($need_alert_display == true) {
421
                echo "<div style=\"background-color:#000000\" id=\"roundalert\">";
422
                echo "<table>";
423
		echo "<tr><td><font color=\"#ffffff\">";
424
		echo "&nbsp;&nbsp;<img align=\"middle\" src=\"/top_notification.gif\">&nbsp;&nbsp;&nbsp;";
425
		echo $display_text;
426
		echo "</td>";
427
		echo "</tr>";
428
		echo "</table>";
429
		echo "</div>";
430
	}
431

    
432
function add_to_menu($url, $name) {
433
	if (isAllowedPage($url))
434
		echo "<li><a href=\"{$url}\" class=\"navlnk\">{$name}</a></li>\n";
435
}
436
?>
437

    
438
<div>
439
<span class="pgtitle"><a href="<?= $_SERVER['SCRIPT_NAME'] ?>"><?=genhtmltitle($pgtitle);?></a></span>
440
<span style="float:right; margin: 0 0 20px 20px;">
441
<?php if(! empty($statusurl)): ?>
442
<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>
443
<?php endif; ?>
444
<?php if(! empty($logurl)): ?>
445
<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>
446
<?php endif; ?>
447
<?php if(! $g['disablehelpicon']): ?>
448
<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>
449
<?php endif; ?>
450
</span>
451
</div>
452
<br />
453

    
454
<?php
455
/* if upgrade in progress, alert user */
456
if(is_subsystem_dirty('packagelock')) {
457
	$pgtitle = array(gettext("System"),gettext("Package Manager"));
458
	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'>");
459
}
460
	$pgtitle_output = true;
461
?>
(55-55/249)