Project

General

Profile

Download (15.9 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

    
17
/* $Id$ */
18

    
19

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
253
?>
254

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

    
342
		</div> <!-- Left DIV -->
343

    
344
		<div id="right">
345

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

    
373
function add_to_menu($url, $name) {
374
	if (isAllowedPage($url))
375
		echo "<li><a href=\"{$url}\" class=\"navlnk\">{$name}</a></li>\n";
376
}
377
?>
378

    
379
<div>
380
<span class="pgtitle"><a href="<?= $_SERVER['SCRIPT_NAME'] ?>"><?=genhtmltitle($pgtitle);?></a></span>
381
<span style="float:right; margin: 0 0 20px 20px;">
382
<?php if(! empty($statusurl)): ?>
383
<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>
384
<?php endif; ?>
385
<?php if(! empty($logurl)): ?>
386
<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>
387
<?php endif; ?>
388
<?php if(! $g['disablehelpicon']): ?>
389
<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>
390
<?php endif; ?>
391
</span>
392
</div>
393
<br />
394

    
395
<?php
396
/* if upgrade in progress, alert user */
397
if(is_subsystem_dirty('packagelock')) {
398
	$pgtitle = array(gettext("System"),gettext("Package Manager"));
399
	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'>");
400
}
401
	$pgtitle_output = true;
402
?>
(55-55/249)