Project

General

Profile

Download (11.7 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2

    
3
require_once("functions.inc");
4
/* $Id$ */
5

    
6
function return_ext_menu($section) {
7
	global $config;
8
	$htmltext = "";
9
	if($config['installedpackages']['menu'] <> "") {
10
		foreach($config['installedpackages']['menu'] as $menuitem) {
11
			if($menuitem['section'] != $section) continue;
12
			if($menuitem['url'] <> "") {
13
			 	$addresswithport = getenv("HTTP_HOST");
14
				$colonpos = strpos($addresswithport, ":");
15
				if ($colonpos !== False){
16
					//my url is actually just the IP address of the pfsense box
17
					$myurl = substr($addresswithport, 0, $colonpos);
18
				}
19
				else
20
				{
21
					$myurl = $addresswithport;
22
				}
23

    
24
				$description = str_replace('$myurl', $myurl, $menuitem['url']);
25
			} else {
26
				$description = '/pkg.php?xml=' . $menuitem['configfile'];
27
			}
28
			$htmltext .= '<li><a href="' . $description . ' "class="navlnk">' . $menuitem['name'] . '</a></li>' . "\n";
29
		}
30
	}
31
	return $htmltext;
32
}
33

    
34
/* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */
35
if ($_REQUEST['noticeaction'] == 'acknowledge') {
36
	$notice_id = $_REQUEST['noticeid'];
37
	close_notice($notice_id);
38
}
39
/**********************************************/
40

    
41
?>
42

    
43
<div id="wrapper">
44

    
45
	<div id="header">
46
		<div id="header-left"><a href="index.php" id="status-link"><img src="/themes/<?= $g['theme']; ?>/images/transparent.gif" border="0"></img></a></div>
47
		<div id="header-right">
48
			<div class="container">
49
				<div class="left">webConfigurator</div>
50
				<div class="right">
51
<?
52
				if (are_notices_pending()) {
53
					$notices = get_notices();
54

    
55
					$requests=array();
56

    
57
					## Get Query Arguments from URL ###
58
					foreach ($_REQUEST as $key => $value) {
59
						if ($key != "PHPSESSID")
60
							$requests[] = $key.'='.$value;
61
					}
62
					if(is_array($requests))
63
						$request_string = implode("&", $requests);
64

    
65
					if(is_array($notices)) {
66
						foreach ($notices as $key => $value) {
67
							$date = date("m-d-y H:i:s", $key);
68
							$noticemsg = str_replace("'", "", $value['notice']);
69
							$noticemsg = str_replace('"', "", $noticemsg);
70
							$noticemsg = str_replace("\n", "", $noticemsg);
71
							$noticemsg = str_replace("<p>", "", $noticemsg);
72
							$noticemsg = str_replace("<pre>", "", $noticemsg);
73
							$noticemsg = str_replace("</pre>", "", $noticemsg);
74
							$noticemsg = str_replace("</p>", "", $noticemsg);
75
							$noticemsg = str_replace("<br>", "", $noticemsg);
76
							$extra_args = "";
77
							if($_GET['xml']) 
78
								$extraargs="&xml=" . $_GET['xml'];
79
							if($_POST['xml']) 
80
								$extraargs="&xml=" . $_POST['xml'];
81
							if($_GET['id']) 
82
								$extraargs="&xml=" . $_GET['id'];
83
							if($_POST['id'])
84
								$extraargs="&xml=" . $_POST['id'];
85
							$notice_msgs = '<a href="?noticeaction=acknowledge&noticeid=all' . $extraargs . '">Acknowledge All</a> &nbsp;&nbsp;&nbsp;&nbsp;.:.&nbsp;&nbsp;&nbsp;&nbsp; ';
86
							if ($value['url']) {
87
								$notice_msgs .= $date.' - <a href="'.$url.'?'.$request_string.'&noticeaction=acknowledge&noticeid='.$key.'">['.$value['id'].']</a>';
88
							} else {
89
								$notice_msgs .= $date.' - <a href="?'.$request_string.'&noticeaction=acknowledge&noticeid='.$key.'">['.$value['id'].']'.$noticemsg.'</a>';
90
							}
91
							$notice_msgs .= " &nbsp;&nbsp;&nbsp;&nbsp;.:.&nbsp;&nbsp;&nbsp;&nbsp; ";
92
						}
93
					}
94
?>
95
					<div id="alerts">
96
						<script type="text/javascript">
97
							var content='<div id="marquee-text"><?= $notice_msgs; ?></div>'
98
						</script>
99
						<script type="text/javascript" src="/ticker.js"></script>
100
					</div>
101
<?
102
				} else {
103
?>
104
					<div id="hostname">
105
						<? print $config['system']['hostname'] . "." . $config['system']['domain']; ?>
106
					</div>
107
<?
108
				}
109
?>
110
				</div>
111
			</div>
112
		</div>
113
	</div> <!-- Header DIV -->
114
	<div id="content">
115
		<div id="left">
116
			<div id="navigation" style="z-index:1000">
117
				<ul id="menu">
118
					<li class="firstdrop">
119
						<div>System</div>
120
						<ul class="subdrop">
121
							<?php
122
							output_menu_item("/system_advanced_admin.php", "Advanced");
123
							output_menu_item("/system_firmware.php", "Firmware");
124
							output_menu_item("/system.php", "General Setup");
125
							?>
126
						<?php if($g['platform'] == "pfSense"): ?>
127
							<?=output_menu_item("/pkg_mgr.php", "Packages");?>
128
						<?php endif; ?>
129
							<?=output_menu_item("/wizard.php?xml=setup_wizard.xml", "Setup Wizard");?>
130
							<?=output_menu_item("/system_gateways.php", "Routing");?>
131
							<?=output_menu_item("/system_camanager.php", "Cert Manager");?>	
132
							<?=output_menu_item("/system_usermanager.php", "User Manager");?>
133
							<li><a href="/index.php?logout" class="navlnk">Logout</a></li>
134
						</ul>
135
					</li>
136
					<li class="drop">
137
						<div>Interfaces</div>
138
						<ul class="subdrop">
139
							<?php if (!isset($config['system']['webgui']['noassigninterfaces'])): ?>
140
							<?=output_menu_item("/interfaces_assign.php", "(assign)");?>								
141
							<?php endif; ?>
142
							<?php $opts = get_configured_interface_with_descr(false, true); 
143
							foreach ($opts as $oif => $odescr): 
144
								if (!isset($config['interfaces'][$oif]['ovpn'])): ?>
145
							<?=output_menu_item("/interfaces.php?if={$oif}", htmlspecialchars($odescr))?>
146
							<?php endif; endforeach; ?>
147
							<?php echo return_ext_menu("Interfaces"); ?>
148
						</ul>
149
					</li>
150
<?php
151
        if($config['system']['shapertype'] <> "m0n0")
152
          $shaper = "firewall_shaper.php";
153
        else
154
          $shaper = "m0n0/firewall_shaper.php";
155
?>
156
					<li class="drop">
157
						<div>Firewall</div>
158
						<ul class="subdrop">
159
							<?=output_menu_item("/firewall_aliases.php", "Aliases");?>	
160
							<?php
161
							if($config['interfaces']['lan']) {
162
								/* no use for NAT in single-interface deployments
163
								remove to reduce user confusion
164
								*/
165
								output_menu_item("/firewall_nat.php", "NAT");	
166
							}
167
							?>
168
							<?=output_menu_item("/firewall_rules.php", "Rules");?>	
169
							<?=output_menu_item("/firewall_schedule.php", "Schedules");?>	
170
							<?php
171
							if($config['interfaces']['lan']) {
172
								/* no use for traffic shaper in single-interface
173
								  deployments
174
								remove to reduce user confusion
175
								*/
176
								output_menu_item("{$shaper}", "Traffic Shaper");
177
							}
178
							?>	
179
							<?=output_menu_item("/firewall_virtual_ip.php", "Virtual IPs");?>	
180
							<?php echo return_ext_menu("Firewall"); ?>
181
						</ul>
182
					</li>
183
					<li class="drop">
184
						<div>Services</div>
185
						<ul class="subdrop">
186
							<?=output_menu_item("/services_captiveportal.php", "Captive Portal");?>	
187
							<?=output_menu_item("/services_dnsmasq.php", "DNS Forwarder");?>	
188
							<?=output_menu_item("/services_dhcp_relay.php", "DHCP Relay");?>	
189
							<?=output_menu_item("/services_dhcp.php", "DHCP Server");?>	
190
							<?=output_menu_item("/services_dyndns.php", "Dynamic DNS");?>
191
							<?=output_menu_item("/load_balancer_pool.php", "Load Balancer");?>	
192
							<?=output_menu_item("/pkg_edit.php?xml=olsrd.xml&id=0", "OLSR");?>	
193
							<?=output_menu_item("/vpn_pppoe.php", "PPPoE Server");?>	
194
							<?=output_menu_item("/pkg_edit.php?xml=routed/routed.xml&id=0", "RIP");?>	
195
							<?=output_menu_item("/services_snmp.php", "SNMP");?>	
196
							<?php
197
							if($config['interfaces']['lan']) {
198
								/* no use for UPnP in single-interface deployments
199
								remove to reduce user confusion
200
								*/
201
								output_menu_item("/pkg_edit.php?xml=miniupnpd.xml&id=0", "UPnP");	
202
							}
203
							?>
204
							<?=output_menu_item("/pkg_edit.php?xml=openntpd.xml&id=0", "OpenNTPD");?>	
205
							<?=output_menu_item("/services_wol.php", "Wake on LAN");?>	
206
							<?php echo return_ext_menu("Services"); ?>
207
						</ul>
208
					</li>
209
					<li class="drop">
210
						<div>VPN</div>
211
						<ul class="subdrop">
212
							<?=output_menu_item("/vpn_ipsec.php", "IPsec");?>
213
							<?=output_menu_item("/vpn_openvpn_server.php", "OpenVPN");?>
214
							<?=output_menu_item("/vpn_pptp.php", "PPTP");?>
215
							<?php echo return_ext_menu("VPN"); ?>
216
						</ul>
217
					</li>
218
					<li class="drop">
219
						<div>Status</div>
220
						<ul class="subdrop">
221
							<?php if (isset($config['captiveportal']['enable'])): ?>
222
							<?=output_menu_item("/status_captiveportal.php", "Captive Portal");?>
223
							<?php endif; ?>
224
							<?=output_menu_item("/carp_status.php", "CARP (failover)");?>
225
							<?=output_menu_item("/index.php", "Dashboard");?>
226
							<?=output_menu_item("/status_gateways.php", "Gateways");?>
227
							<?=output_menu_item("/diag_dhcp_leases.php", "DHCP Leases");?>
228
							<?=output_menu_item("/status_filter_reload.php", "Filter Reload");?>
229
							<?=output_menu_item("/status_interfaces.php", "Interfaces");?>
230
							<?=output_menu_item("/diag_ipsec.php", "IPsec");?>
231
							<?=output_menu_item("/status_slbd_pool.php", "Load Balancer");?>
232
							<?=output_menu_item("/status_openvpn.php", "OpenVPN");?>
233
							<?php if($g['platform'] == "pfSense"): ?>
234
							<?=output_menu_item("/diag_pkglogs.php", "Package Logs");?>
235
							<?php endif; ?>
236
							<?=output_menu_item("/status_queues.php", "Queues");?>
237
							<?=output_menu_item("/status_rrd_graph.php", "RRD Graphs");?>
238
							<?=output_menu_item("/status_services.php", "Services");?>
239
							<?=output_menu_item("/diag_logs.php", "System Logs");?>
240
							<?=output_menu_item("/status_graph.php?if=wan", "Traffic Graph");?>
241
							<?php
242
							if($config['interfaces']['lan']) {
243
								/* no use for UPnP in single-interface deployments
244
								remove to reduce user confusion
245
								*/
246
								output_menu_item("/status_upnp.php", "UPnP");	
247
							}
248
							?>
249
							<?php $ifentries = get_configured_interface_with_descr();
250
							foreach ($ifentries as $ent => $entdesc) {
251
								if (is_array($config['interfaces'][$ent]['wireless']) &&
252
									preg_match($g['wireless_regex'], $config['interfaces'][$ent]['if']))
253
									$ifdescrs[$ent] = $entdesc;
254
							}
255
							if (count($ifdescrs) > 0): ?>
256
							<?=output_menu_item("/status_wireless.php", "Wireless");?>
257
							<?php endif; ?>
258
							<?php echo return_ext_menu("Status"); ?>
259
						</ul>
260
					</li>
261
					<li class="lastdrop">
262
						<div>Diagnostics</div>
263
						<ul id="diag" class="subdrop">
264
							<?=output_menu_item("/diag_arp.php", "ARP Tables");?>
265
							<?=output_menu_item("/diag_backup.php", "Backup/Restore");?>
266
							<?=output_menu_item("/exec.php", "Command Prompt");?>
267
							<?=output_menu_item("/edit.php", "Edit File");?>
268
							<?=output_menu_item("/diag_defaults.php", "Factory Defaults");?>
269
							<?=output_menu_item("/halt.php", "Halt System");?>
270
							<?=output_menu_item("/diag_ping.php", "Ping");?>
271
							<?=output_menu_item("/reboot.php", "Reboot");?>
272
							<?=output_menu_item("/diag_routes.php", "Routes");?>
273
							<?=output_menu_item("/diag_dump_states.php", "States");?>
274
							<?=output_menu_item("/diag_traceroute.php", "Traceroute");?>
275
							<?=output_menu_item("/diag_packet_capture.php", "Packet Capture");?>
276
							<?php echo return_ext_menu("Diagnostics"); ?>
277
							<?php if(isset($config['system']['developer'])): ?>
278
							<li><hr width="80%"/></li>
279
							<?=output_menu_item("/restart_httpd.php", "Restart HTTPD");?>							
280
							<?php endif; ?>
281
						</ul>
282
					</li>
283
				</ul>
284
			</div>
285

    
286
		</div> <!-- Left DIV -->
287

    
288
		<div id="right">
289

    
290
<?php
291

    
292
	/* display a top alert bar if need be */
293
	$need_alert_display = false;
294
	$found_notices = are_notices_pending();
295
	if($found_notices == true) {
296
		$notices = get_notices();
297
		if(!$notices) {
298
			$need_alert_display = true;
299
			$display_text = print_notices() . "<br>";
300
		}
301
	}
302
	if($need_alert_display == true) {
303
                echo "<div style=\"background-color:#000000\" id=\"roundalert\">";
304
                echo "<table>";
305
		echo "<tr><td><font color=\"#ffffff\">";
306
		echo "&nbsp;&nbsp;<img align=\"middle\" src=\"/top_notification.gif\">&nbsp;&nbsp;&nbsp;";
307
		echo $display_text;
308
		echo "</td>";
309
		echo "</tr>";
310
		echo "</table>";
311
		echo "</div>";
312
	}
313

    
314
function output_menu_item($url, $name) {
315
	if (isAllowedPage($url))
316
		echo "<li><a href=\"{$url}\" class=\"navlnk\">{$name}</a></li>\n";
317
}
318
	
319
?>
320

    
321
<p class="pgtitle"><?=genhtmltitle($pgtitle);?></font></p>
(38-38/209)