Project

General

Profile

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

    
2
<script src="/javascript/sorttable.js"></script>
3
<script src="/javascript/ticker.js"></script>
4
<style id="antiClickjack">body{display:none}</style> <script type="text/JavaScript">
5
if (self === top) { var antiClickjack = document.getElementById("antiClickjack"); antiClickjack.parentNode.removeChild(antiClickjack);
6
} else { top.location = self.location;
7
}
8
</script>
9
<?php
10
/*
11
	pfSense_MODULE:	header
12
*/
13

    
14
require_once("globals.inc");
15
require_once("functions.inc");
16
require_once("shortcuts.inc");
17
require_once("service-utils.inc");
18

    
19
/* $Id$ */
20

    
21

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

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

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

    
51
/* Build the full help URL. */
52
$helpurl .= "{$g['help_base_url']}?page={$pagename}";
53

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

    
84
function output_menu($arrayitem, $target = null) {
85
	foreach ($arrayitem as $item) {
86
		if (isAllowedPage($item[1]) || $item[1]=="/index.php?logout"){
87
			$attr = sprintf("href=\"%s\"", htmlentities($item[1]));
88
			if ($target) {
89
				$attr .= sprintf(" target=\"%s\"", htmlentities($target));
90
			}
91
			$class = "navlnk";
92
			if ($item['class']) {
93
				$class .= " {$item['class']}";
94
			}
95
			$attr .= sprintf(" class=\"%s\"", htmlentities($class));
96
			if ($item['style']) {
97
				$attr .= sprintf(" style=\"%s\"", htmlentities($item['style']));
98
			}
99
			echo "<li>\n";
100
			printf("<a %s>%s</a>\n", $attr, $item[0]);
101
			echo "</li>\n";
102
		}
103
	}
104
}
105

    
106
// System
107
$system_menu = array();
108
$system_menu[] = array(gettext("Advanced"), "/system_advanced_admin.php");
109
$system_menu[] = array(gettext("Firmware"), "/system_firmware.php");
110
$system_menu[] = array(gettext("General Setup"), "/system.php");
111
$system_menu[] = array(gettext("High Avail. Sync"), "/system_hasync.php");
112
$system_menu[] = array(gettext("Logout"), "/index.php?logout");
113
if ($g['platform'] == "pfSense" or $g['platform'] == "nanobsd")
114
	$system_menu[] = array(gettext("Packages"), "/pkg_mgr_installed.php");
115
$system_menu[] = array(gettext("Setup Wizard"), "/wizard.php?xml=setup_wizard.xml");
116
$system_menu[] = array(gettext("Routing"), "/system_gateways.php");
117
$system_menu[] = array(gettext("Cert Manager"), "/system_camanager.php");
118
if (!isAllowedPage("system_usermanager.php*"))
119
	$system_menu[] = array(gettext("User Manager"), "/system_usermanager_passwordmg.php");
120
else
121
	$system_menu[] = array(gettext("User Manager"), "/system_usermanager.php");
122
$system_menu = msort(array_merge($system_menu, return_ext_menu("System")),0);
123

    
124
// Interfaces
125
$interfaces_menu = array();
126
if (!isset($config['system']['webgui']['noassigninterfaces']))
127
	$interfaces_menu[] = array("(assign)", "/interfaces_assign.php");
128
$opts = get_configured_interface_with_descr(false, true);
129
foreach ($opts as $oif => $odescr)
130
	if (!isset($config['interfaces'][$oif]['ovpn']))
131
		$interfaces_menu[] = array(htmlspecialchars($odescr), "/interfaces.php?if={$oif}");
132
$interfaces_menu = msort(array_merge($interfaces_menu, return_ext_menu("Interfaces")),0);
133

    
134
// Firewall
135
$firewall_menu = array();
136
$firewall_menu[] = array(gettext("Aliases"), "/firewall_aliases.php");
137
$firewall_menu[] = array(gettext("NAT"), "/firewall_nat.php");
138
$firewall_menu[] = array(gettext("Rules"), "/firewall_rules.php");
139
$firewall_menu[] = array(gettext("Schedules"), "/firewall_schedule.php");
140
$firewall_menu[] = array(gettext("Traffic Shaper"), "/firewall_shaper.php");
141
$firewall_menu[] = array(gettext("Virtual IPs"), "/firewall_virtual_ip.php");
142
$firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")),0);
143

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

    
170
// VPN
171
$vpn_menu = array();
172
$vpn_menu[] = array(gettext("IPsec"), "/vpn_ipsec.php");
173
$vpn_menu[] = array(gettext("OpenVPN"), "/vpn_openvpn_server.php");
174
$vpn_menu[] = array(gettext("PPTP"), "/vpn_pptp.php");
175
$vpn_menu[] = array(gettext("L2TP"), "/vpn_l2tp.php");
176
$vpn_menu = msort(array_merge($vpn_menu, return_ext_menu("VPN")),0);
177

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

    
212
// Diagnostics
213
$diagnostics_menu = array();
214
$diagnostics_menu[] = array(gettext("ARP Table"), "/diag_arp.php");
215
$diagnostics_menu[] = array(gettext("Authentication"), "/diag_authentication.php");
216
$diagnostics_menu[] = array(gettext("Backup/Restore"), "/diag_backup.php");
217
$diagnostics_menu[] = array(gettext("Command Prompt"), "/exec.php");
218
$diagnostics_menu[] = array(gettext("DNS Lookup"), "/diag_dns.php");
219
$diagnostics_menu[] = array(gettext("Edit File"), "/edit.php");
220
$diagnostics_menu[] = array(gettext("Factory Defaults"), "/diag_defaults.php");
221
$diagnostics_menu[] = array(gettext("Halt System"), "/halt.php" );
222
$diagnostics_menu[] = array(gettext("Limiter Info"), "/diag_limiter_info.php" );
223
$diagnostics_menu[] = array(gettext("NDP Table"), "/diag_ndp.php" );
224

    
225
$diagnostics_menu[] = array(gettext("Tables"), "/diag_tables.php");
226
$diagnostics_menu[] = array(gettext("Ping"), "/diag_ping.php");
227
$diagnostics_menu[] = array(gettext("Test Port"), "/diag_testport.php");
228
$diagnostics_menu[] = array(gettext("pfInfo"), "/diag_pf_info.php");
229
$diagnostics_menu[] = array(gettext("pfTop"), "/diag_system_pftop.php");
230
$diagnostics_menu[] = array(gettext("Reboot"), "/reboot.php");
231
$diagnostics_menu[] = array(gettext("Routes"), "/diag_routes.php");
232
$diagnostics_menu[] = array(gettext("SMART Status"), "/diag_smart.php");
233
$diagnostics_menu[] = array(gettext("Sockets"), "/diag_sockets.php" );
234
$diagnostics_menu[] = array(gettext("States"), "/diag_dump_states.php");
235
$diagnostics_menu[] = array(gettext("States Summary"), "/diag_states_summary.php");
236
$diagnostics_menu[] = array(gettext("System Activity"), "/diag_system_activity.php");
237
$diagnostics_menu[] = array(gettext("Traceroute"), "/diag_traceroute.php");
238
$diagnostics_menu[] = array(gettext("Packet Capture"), "/diag_packet_capture.php");
239
if($g['platform'] == "nanobsd")
240
	$diagnostics_menu[] = array(gettext("NanoBSD"), "/diag_nanobsd.php");
241

    
242
if (isset($config['system']['developer'])) {
243
	$diagnostics_menu[] = array(gettext("Restart HTTPD"), "/restart_httpd.php", "style" => "font-weight: bold; color: yellow;");
244
	
245
}
246
$diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")),0);
247

    
248
if(! $g['disablehelpmenu']) {
249
	$help_menu = array();
250
	$help_menu[] = array(gettext("About this Page"), $helpurl);
251
	if($g['product_name'] == "pfSense") 
252
		$help_menu[] = array(gettext("Bug Database"), "http://www.pfsense.org/j.php?jumpto=redmine");
253
	$help_menu[] = array(gettext("User Forum"), "http://www.pfsense.org/j.php?jumpto=forum");
254
	$help_menu[] = array(gettext("Documentation"), "http://www.pfsense.org/j.php?jumpto=doc");
255
	$help_menu[] = array(gettext("Developers Wiki"), "http://www.pfsense.org/j.php?jumpto=devwiki");
256
	$help_menu[] = array(gettext("Paid Support"), "http://www.pfsense.org/j.php?jumpto=portal");
257
	$help_menu[] = array(gettext("pfSense Book"), "http://www.pfsense.org/j.php?jumpto=book");
258
	$help_menu[] = array(gettext("Search portal"), "http://www.pfsense.org/j.php?jumpto=searchportal");
259
	$help_menu[] = array(gettext("FreeBSD Handbook"), "http://www.pfsense.org/j.php?jumpto=fbsdhandbook");
260
	$help_menu = msort(array_merge($help_menu, return_ext_menu("Help")),0);	
261
}
262

    
263
?>
264

    
265
<div id="wrapper">
266
	<div id="header">
267
		<div id="header-left"><a href="/index.php" id="status-link"><img src="/themes/<?= $g['theme']; ?>/images/transparent.gif" border="0"></a></div>
268
		<div id="header-right">
269
			<div class="container">
270
				<div class="left">webConfigurator</div>
271
				<div class="right" id="menu_messages">
272
<?
273
				echo get_menu_messages();
274
?>
275
	</div>
276
			</div>
277
		</div>
278
	</div> <!-- Header DIV -->
279
	<div id="content">
280
		<div id="left">
281
			<div id="navigation" style="z-index:1000;">
282
				<ul id="menu">
283
					<li class="firstdrop">
284
						<div><?php echo gettext("System"); ?></div>
285
						<ul class="subdrop">
286
						<?php
287
							output_menu($system_menu);
288
						?>
289
						</ul>
290
					</li>
291
					<li class="drop">
292
						<div><?php echo gettext("Interfaces"); ?></div>
293
						<ul class="subdrop">
294
						<?php
295
							output_menu($interfaces_menu);
296
						?>
297
						</ul>
298
					</li>
299
					<li class="drop">
300
						<div><?php echo gettext("Firewall"); ?></div>
301
						<ul class="subdrop">
302
						<?php
303
							output_menu($firewall_menu);
304
						?>
305
						</ul>
306
					</li>
307
					<li class="drop">
308
						<div><?php echo gettext("Services"); ?></div>
309
						<ul class="subdrop">
310
						<?
311
							output_menu($services_menu);
312
						?>
313
						</ul>
314
					</li>
315
					<li class="drop">
316
						<div><?php echo gettext("VPN"); ?></div>
317
						<ul class="subdrop">
318
						<?php
319
							output_menu($vpn_menu);
320
						?>
321
						</ul>
322
					</li>
323
					<li class="drop">
324
						<div><?php echo gettext("Status"); ?></div>
325
						<ul class="subdrop">
326
						<?php
327
							output_menu($status_menu);
328
						?>
329
						</ul>
330
					</li>
331
					<li class="drop">
332
						<div><?php echo gettext("Diagnostics"); ?></div>
333
						<ul id="diag" class="subdrop">
334
						<?
335
							output_menu($diagnostics_menu);
336
						?>
337
						</ul>
338
					</li>
339
					<?php if(! $g['disablehelpmenu']): ?>
340
					<li class="lastdrop">
341
						<div><?php echo gettext("Help"); ?></div>
342
						<ul id="help" class="subdrop">
343
						<?
344
							output_menu($help_menu, "_new");
345
						?>
346
						</ul>
347
					</li>
348
					<?php endif; ?>
349
				</ul>
350
			</div>
351

    
352
		</div> <!-- Left DIV -->
353

    
354
		<div id="right">
355

    
356
<?php
357
echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/domLib.js\"></script>\n";
358
echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/domTT.js\"></script>\n";
359
echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/behaviour.js\"></script>\n";
360
echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/fadomatic.js\"></script>\n";
361
	/* display a top alert bar if need be */
362
	$need_alert_display = false;
363
	$found_notices = are_notices_pending();
364
	if($found_notices == true) {
365
		$notices = get_notices();
366
		if(!$notices) {
367
			$need_alert_display = true;
368
			$display_text = print_notices($notices) . "<br>";
369
		}
370
	}
371
	if($need_alert_display == true) {
372
                echo "<div style=\"background-color:#000000\" id=\"roundalert\">";
373
                echo "<table>";
374
		echo "<tr><td><font color=\"#ffffff\">";
375
		echo "&nbsp;&nbsp;<img align=\"middle\" src=\"/top_notification.gif\">&nbsp;&nbsp;&nbsp;";
376
		echo $display_text;
377
		echo "</td>";
378
		echo "</tr>";
379
		echo "</table>";
380
		echo "</div>";
381
	}
382

    
383
function add_to_menu($url, $name) {
384
	if (isAllowedPage($url))
385
		echo "<li><a href=\"{$url}\" class=\"navlnk\">{$name}</a></li>\n";
386
}
387

    
388
?>
389

    
390
<div>
391
<span class="pgtitle"><a href="<?= $_SERVER['REQUEST_URI'] ?>"><?=genhtmltitle($pgtitle);?></a></span>
392
<span style="float:right; margin: 0 0 20px 20px">
393
<?php
394
if (!$hide_service_status && !empty($shortcuts[$shortcut_section]['service'])) {
395
	$ssvc = array();
396
	switch ($shortcut_section) {
397
		case "openvpn":
398
			$ssvc = find_service_by_openvpn_vpnid($vpnid);
399
			break;
400
		case "captiveportal":
401
			$ssvc = find_service_by_cp_zone($cpzone);
402
			break;
403
		default:
404
			$ssvc = find_service_by_name($shortcuts[$shortcut_section]['service']);
405

    
406
	}
407
	if (!empty($ssvc)) {
408
		echo get_service_status_icon($ssvc, false);
409
		echo get_service_control_links($ssvc, true);
410
	}
411
}
412

    
413
echo get_shortcut_main_link($shortcut_section, true);
414
echo get_shortcut_status_link($shortcut_section, true);
415
echo get_shortcut_log_link($shortcut_section, true);
416

    
417
?>
418
<?php if(! $g['disablehelpicon']): ?>
419

    
420
<a href="<?php echo $helpurl; ?>" title="<?php echo gettext("Help for items on this page"); ?>"><img style="vertical-align:middle" src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_help.gif" border="0"></a>
421
<?php endif; ?>
422
</span>
423
</div>
424
<br />
425

    
426
<?php
427
/* if upgrade in progress, alert user */
428
if(is_subsystem_dirty('packagelock')) {
429
	$pgtitle = array(gettext("System"),gettext("Package Manager"));
430
	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'>");
431
}
432
	$pgtitle_output = true;
433
?>
(56-56/249)