Project

General

Profile

Download (11.6 KB) Statistics
| Branch: | Tag: | Revision:
1 c6c150e9 Scott Ullrich
<?php
2 f0394bbb Scott Ullrich
3 705a4137 Ermal Luçi
require_once("globals.inc");
4 b8f82cd7 Scott Ullrich
require_once("functions.inc");
5 b46bfcf5 Bill Marquette
/* $Id$ */
6 e86a8e57 Scott Ullrich
7 e93441e0 Scott Ullrich
function return_ext_menu($section) {
8
	global $config;
9
	$htmltext = "";
10
	if($config['installedpackages']['menu'] <> "") {
11
		foreach($config['installedpackages']['menu'] as $menuitem) {
12
			if($menuitem['section'] != $section) continue;
13
			if($menuitem['url'] <> "") {
14
			 	$addresswithport = getenv("HTTP_HOST");
15
				$colonpos = strpos($addresswithport, ":");
16
				if ($colonpos !== False){
17
					//my url is actually just the IP address of the pfsense box
18
					$myurl = substr($addresswithport, 0, $colonpos);
19
				}
20
				else
21
				{
22
					$myurl = $addresswithport;
23 90e3bbc0 Colin Smith
				}
24 e93441e0 Scott Ullrich
25
				$description = str_replace('$myurl', $myurl, $menuitem['url']);
26
			} else {
27
				$description = '/pkg.php?xml=' . $menuitem['configfile'];
28 c6c150e9 Scott Ullrich
			}
29 e93441e0 Scott Ullrich
			$htmltext .= '<li><a href="' . $description . ' "class="navlnk">' . $menuitem['name'] . '</a></li>' . "\n";
30 c6c150e9 Scott Ullrich
		}
31
	}
32 e93441e0 Scott Ullrich
	return $htmltext;
33
}
34 65384707 Erik Kristensen
35 e93441e0 Scott Ullrich
/* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */
36
if ($_REQUEST['noticeaction'] == 'acknowledge') {
37
	$notice_id = $_REQUEST['noticeid'];
38
	close_notice($notice_id);
39
}
40
/**********************************************/
41 65384707 Erik Kristensen
42 c6c150e9 Scott Ullrich
?>
43 12a00813 Erik Kristensen
44 9f53d3a8 Scott Ullrich
<div id="wrapper">
45
46
	<div id="header">
47 de115edf Scott Ullrich
		<div id="header-left"><a href="index.php" id="status-link"><img src="/themes/<?= $g['theme']; ?>/images/transparent.gif" border="0"></img></a></div>
48 9f53d3a8 Scott Ullrich
		<div id="header-right">
49 1df0159c Erik Kristensen
			<div class="container">
50
				<div class="left">webConfigurator</div>
51
				<div class="right">
52 64fcbfc8 Erik Kristensen
<?
53 b1cbbf24 Erik Kristensen
				if (are_notices_pending()) {
54
					$notices = get_notices();
55 dca32536 Scott Ullrich
56 a2046789 Scott Ullrich
					$requests=array();
57 dca32536 Scott Ullrich
58 a6fac06e Erik Kristensen
					## Get Query Arguments from URL ###
59
					foreach ($_REQUEST as $key => $value) {
60
						if ($key != "PHPSESSID")
61
							$requests[] = $key.'='.$value;
62
					}
63 a2046789 Scott Ullrich
					if(is_array($requests))
64
						$request_string = implode("&", $requests);
65 a6fac06e Erik Kristensen
66 35eef977 Scott Ullrich
					if(is_array($notices)) {
67
						foreach ($notices as $key => $value) {
68
							$date = date("m-d-y H:i:s", $key);
69
							$noticemsg = str_replace("'", "", $value['notice']);
70
							$noticemsg = str_replace('"', "", $noticemsg);
71
							$noticemsg = str_replace("\n", "", $noticemsg);
72
							$noticemsg = str_replace("<p>", "", $noticemsg);
73
							$noticemsg = str_replace("<pre>", "", $noticemsg);
74
							$noticemsg = str_replace("</pre>", "", $noticemsg);
75
							$noticemsg = str_replace("</p>", "", $noticemsg);
76
							$noticemsg = str_replace("<br>", "", $noticemsg);
77 91d3d442 Scott Ullrich
							$extra_args = "";
78
							if($_GET['xml']) 
79
								$extraargs="&xml=" . $_GET['xml'];
80
							if($_POST['xml']) 
81
								$extraargs="&xml=" . $_POST['xml'];
82
							if($_GET['id']) 
83
								$extraargs="&xml=" . $_GET['id'];
84
							if($_POST['id'])
85
								$extraargs="&xml=" . $_POST['id'];
86
							$notice_msgs = '<a href="?noticeaction=acknowledge&noticeid=all' . $extraargs . '">Acknowledge All</a> &nbsp;&nbsp;&nbsp;&nbsp;.:.&nbsp;&nbsp;&nbsp;&nbsp; ';
87 35eef977 Scott Ullrich
							if ($value['url']) {
88
								$notice_msgs .= $date.' - <a href="'.$url.'?'.$request_string.'&noticeaction=acknowledge&noticeid='.$key.'">['.$value['id'].']</a>';
89
							} else {
90
								$notice_msgs .= $date.' - <a href="?'.$request_string.'&noticeaction=acknowledge&noticeid='.$key.'">['.$value['id'].']'.$noticemsg.'</a>';
91
							}
92
							$notice_msgs .= " &nbsp;&nbsp;&nbsp;&nbsp;.:.&nbsp;&nbsp;&nbsp;&nbsp; ";
93 b1cbbf24 Erik Kristensen
						}
94
					}
95 64fcbfc8 Erik Kristensen
?>
96 b1cbbf24 Erik Kristensen
					<div id="alerts">
97
						<script type="text/javascript">
98
							var content='<div id="marquee-text"><?= $notice_msgs; ?></div>'
99
						</script>
100 625dcc40 Bill Marquette
						<script type="text/javascript" src="/javascript/ticker.js"></script>
101 b1cbbf24 Erik Kristensen
					</div>
102
<?
103
				} else {
104 612832ec Erik Kristensen
?>
105
					<div id="hostname">
106
						<? print $config['system']['hostname'] . "." . $config['system']['domain']; ?>
107
					</div>
108
<?
109 b1cbbf24 Erik Kristensen
				}
110
?>
111 1df0159c Erik Kristensen
				</div>
112
			</div>
113 9f53d3a8 Scott Ullrich
		</div>
114
	</div> <!-- Header DIV -->
115
	<div id="content">
116
		<div id="left">
117 2779b49b Scott Dale
			<div id="navigation" style="z-index:1000">
118 41058a8c Erik Kristensen
				<ul id="menu">
119 d86286ed Erik Kristensen
					<li class="firstdrop">
120 9f53d3a8 Scott Ullrich
						<div>System</div>
121 d86286ed Erik Kristensen
						<ul class="subdrop">
122 7cf210f1 Ermal Lu?i
						<?php
123 df81417f Matthew Grooms
							output_menu_item("/system_advanced_admin.php", "Advanced");
124 b8f82cd7 Scott Ullrich
							output_menu_item("/system_firmware.php", "Firmware");
125
							output_menu_item("/system.php", "General Setup");
126 72cbe1bd Scott Ullrich
							if ($g['platform'] == "pfSense" or $g['platform'] == "nanobsd")
127 7cf210f1 Ermal Lu?i
								output_menu_item("/pkg_mgr.php", "Packages");
128
							output_menu_item("/wizard.php?xml=setup_wizard.xml", "Setup Wizard");
129
							output_menu_item("/system_gateways.php", "Routing");
130
							output_menu_item("/system_camanager.php", "Cert Manager");
131
							output_menu_item("/system_usermanager.php", "User Manager");
132
						?>
133 df81417f Matthew Grooms
							<li><a href="/index.php?logout" class="navlnk">Logout</a></li>
134 9f53d3a8 Scott Ullrich
						</ul>
135
					</li>
136 d86286ed Erik Kristensen
					<li class="drop">
137
						<div>Interfaces</div>
138
						<ul class="subdrop">
139 7cf210f1 Ermal Lu?i
						<?php
140
							if (!isset($config['system']['webgui']['noassigninterfaces']))
141
								output_menu_item("/interfaces_assign.php", "(assign)");
142
							$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
							echo return_ext_menu("Interfaces");
147
						?>
148 9f53d3a8 Scott Ullrich
						</ul>
149
					</li>
150 d86286ed Erik Kristensen
					<li class="drop">
151 9f53d3a8 Scott Ullrich
						<div>Firewall</div>
152 d86286ed Erik Kristensen
						<ul class="subdrop">
153 7cf210f1 Ermal Lu?i
						<?php
154
							output_menu_item("/firewall_aliases.php", "Aliases");
155 74e44a2e Chris Buechler
							if($config['interfaces']['lan']) {
156
								/* no use for NAT in single-interface deployments
157
								remove to reduce user confusion
158
								*/
159
								output_menu_item("/firewall_nat.php", "NAT");	
160
							}
161 7cf210f1 Ermal Lu?i
							output_menu_item("/firewall_rules.php", "Rules");
162
							output_menu_item("/firewall_schedule.php", "Schedules");
163 f97e2dab Chris Buechler
							if($config['interfaces']['lan']) {
164
								/* no use for traffic shaper in single-interface
165
								  deployments
166
								remove to reduce user confusion
167
								*/
168 7ed54491 Ermal Luçi
								output_menu_item("/firewall_shaper.php", "Traffic Shaper");
169 f97e2dab Chris Buechler
							}
170 7cf210f1 Ermal Lu?i
							output_menu_item("/firewall_virtual_ip.php", "Virtual IPs");
171
							echo return_ext_menu("Firewall");
172
						?>
173 9f53d3a8 Scott Ullrich
						</ul>
174
					</li>
175 d86286ed Erik Kristensen
					<li class="drop">
176 9f53d3a8 Scott Ullrich
						<div>Services</div>
177 d86286ed Erik Kristensen
						<ul class="subdrop">
178 7cf210f1 Ermal Lu?i
						<?
179
							output_menu_item("/services_captiveportal.php", "Captive Portal");
180
							output_menu_item("/services_dnsmasq.php", "DNS Forwarder");
181
							output_menu_item("/services_dhcp_relay.php", "DHCP Relay");
182
							if($g['services_dhcp_server_enable'])
183
								output_menu_item("/services_dhcp.php", "DHCP Server");
184
							output_menu_item("/services_dyndns.php", "Dynamic DNS");
185
							output_menu_item("/services_igmpproxy.php", "IGMP proxy");
186
							output_menu_item("/load_balancer_pool.php", "Load Balancer");
187
							output_menu_item("/pkg_edit.php?xml=olsrd.xml&id=0", "OLSR");
188
							output_menu_item("/vpn_pppoe.php", "PPPoE Server");
189
							output_menu_item("/pkg_edit.php?xml=routed/routed.xml&id=0", "RIP");
190
							output_menu_item("/services_snmp.php", "SNMP");
191 f97e2dab Chris Buechler
							if($config['interfaces']['lan']) {
192
								/* no use for UPnP in single-interface deployments
193
								remove to reduce user confusion
194
								*/
195
								output_menu_item("/pkg_edit.php?xml=miniupnpd.xml&id=0", "UPnP");	
196
							}
197 7cf210f1 Ermal Lu?i
							output_menu_item("/pkg_edit.php?xml=openntpd.xml&id=0", "OpenNTPD");
198
							output_menu_item("/services_wol.php", "Wake on LAN");
199
							echo return_ext_menu("Services");
200
						?>
201 9f53d3a8 Scott Ullrich
						</ul>
202
					</li>
203 d86286ed Erik Kristensen
					<li class="drop">
204 9f53d3a8 Scott Ullrich
						<div>VPN</div>
205 d86286ed Erik Kristensen
						<ul class="subdrop">
206 7cf210f1 Ermal Lu?i
						<?php
207
							output_menu_item("/vpn_ipsec.php", "IPsec");
208
							output_menu_item("/vpn_openvpn_server.php", "OpenVPN");
209
							output_menu_item("/vpn_pptp.php", "PPTP");
210
							output_menu_item("/vpn_l2tp.php", "L2TP");
211
							echo return_ext_menu("VPN");
212
						?>
213 9f53d3a8 Scott Ullrich
						</ul>
214
					</li>
215 d86286ed Erik Kristensen
					<li class="drop">
216 9f53d3a8 Scott Ullrich
						<div>Status</div>
217 d86286ed Erik Kristensen
						<ul class="subdrop">
218 7cf210f1 Ermal Lu?i
						<?php
219
							if (isset($config['captiveportal']['enable']))
220
								output_menu_item("/status_captiveportal.php", "Captive Portal");
221
							output_menu_item("/carp_status.php", "CARP (failover)");
222
							output_menu_item("/index.php", "Dashboard");
223
							output_menu_item("/status_gateways.php", "Gateways");
224
							output_menu_item("/diag_dhcp_leases.php", "DHCP Leases");
225
							output_menu_item("/status_filter_reload.php", "Filter Reload");
226
							output_menu_item("/status_interfaces.php", "Interfaces");
227
							output_menu_item("/diag_ipsec.php", "IPsec");
228
							output_menu_item("/status_slbd_pool.php", "Load Balancer");
229
							output_menu_item("/status_openvpn.php", "OpenVPN");
230
							if ($g['platform'] == "pfSense")
231
								output_menu_item("/diag_pkglogs.php", "Package Logs");
232
							output_menu_item("/status_queues.php", "Queues");
233
							output_menu_item("/status_rrd_graph.php", "RRD Graphs");
234
							output_menu_item("/status_services.php", "Services");
235
							output_menu_item("/diag_logs.php", "System Logs");
236
							output_menu_item("/status_graph.php?if=wan", "Traffic Graph");
237 cc908f39 Chris Buechler
							if($config['interfaces']['lan']) {
238
								/* no use for UPnP in single-interface deployments
239
								remove to reduce user confusion
240
								*/
241
								output_menu_item("/status_upnp.php", "UPnP");	
242
							}
243 7cf210f1 Ermal Lu?i
							$ifentries = get_configured_interface_with_descr();
244 ddd272d3 Ermal Luçi
							foreach ($ifentries as $ent => $entdesc) {
245
								if (is_array($config['interfaces'][$ent]['wireless']) &&
246
									preg_match($g['wireless_regex'], $config['interfaces'][$ent]['if']))
247
									$ifdescrs[$ent] = $entdesc;
248 9f53d3a8 Scott Ullrich
							}
249 7cf210f1 Ermal Lu?i
							if (count($ifdescrs) > 0)
250
								output_menu_item("/status_wireless.php", "Wireless");
251
							echo return_ext_menu("Status");
252
						?>
253 9f53d3a8 Scott Ullrich
						</ul>
254
					</li>
255 d86286ed Erik Kristensen
					<li class="lastdrop">
256 9f53d3a8 Scott Ullrich
						<div>Diagnostics</div>
257 d86286ed Erik Kristensen
						<ul id="diag" class="subdrop">
258 7cf210f1 Ermal Lu?i
						<?
259
							output_menu_item("/diag_arp.php", "ARP Tables");
260
							output_menu_item("/diag_backup.php", "Backup/Restore");
261
							output_menu_item("/exec.php", "Command Prompt");
262 145eba30 jim-p
							output_menu_item("/diag_dns.php", "DNS");
263 7cf210f1 Ermal Lu?i
							output_menu_item("/edit.php", "Edit File");
264
							output_menu_item("/diag_defaults.php", "Factory Defaults");
265 28949aa1 Scott Ullrich
							output_menu_item("/halt.php", "Halt System");						
266
							if($g['platform'] == "nanobsd")
267
								output_menu_item("/diag_nanobsd.php", "NanoBSD");
268 7cf210f1 Ermal Lu?i
							output_menu_item("/diag_ping.php", "Ping");
269
							output_menu_item("/diag_system_pftop.php", "pfTOP");
270
							output_menu_item("/reboot.php", "Reboot");
271
							output_menu_item("/diag_routes.php", "Routes");
272
							output_menu_item("/diag_dump_states.php", "States");
273
							output_menu_item("/diag_system_activity.php", "System Activity");
274
							output_menu_item("/diag_traceroute.php", "Traceroute");
275
							output_menu_item("/diag_packet_capture.php", "Packet Capture");
276
							echo return_ext_menu("Diagnostics");
277
							if (isset($config['system']['developer'])) {
278
								echo "<li><hr width=\"80%\"/></li>";
279
								output_menu_item("/restart_httpd.php", "Restart HTTPD");
280
							}
281
						?>
282 9f53d3a8 Scott Ullrich
						</ul>
283
					</li>
284
				</ul>
285
			</div>
286 dca32536 Scott Ullrich
287 9f53d3a8 Scott Ullrich
		</div> <!-- Left DIV -->
288 dca32536 Scott Ullrich
289 9f53d3a8 Scott Ullrich
		<div id="right">
290 dca32536 Scott Ullrich
291 5c9cc1de Scott Ullrich
<?php
292 45ee90ed Matthew Grooms
293 5c9cc1de Scott Ullrich
	/* display a top alert bar if need be */
294
	$need_alert_display = false;
295
	$found_notices = are_notices_pending();
296
	if($found_notices == true) {
297
		$notices = get_notices();
298
		if(!$notices) {
299
			$need_alert_display = true;
300 e444cd01 Scott Ullrich
			$display_text = print_notices() . "<br>";
301 dca32536 Scott Ullrich
		}
302 5c9cc1de Scott Ullrich
	}
303
	if($need_alert_display == true) {
304
                echo "<div style=\"background-color:#000000\" id=\"roundalert\">";
305
                echo "<table>";
306
		echo "<tr><td><font color=\"#ffffff\">";
307
		echo "&nbsp;&nbsp;<img align=\"middle\" src=\"/top_notification.gif\">&nbsp;&nbsp;&nbsp;";
308
		echo $display_text;
309
		echo "</td>";
310
		echo "</tr>";
311
		echo "</table>";
312
		echo "</div>";
313
	}
314 b8f82cd7 Scott Ullrich
315
function output_menu_item($url, $name) {
316 45ee90ed Matthew Grooms
	if (isAllowedPage($url))
317
		echo "<li><a href=\"{$url}\" class=\"navlnk\">{$name}</a></li>\n";
318 b8f82cd7 Scott Ullrich
}
319 19b331c1 Scott Ullrich
	
320
?>
321 dca32536 Scott Ullrich
322 19b331c1 Scott Ullrich
<p class="pgtitle"><?=genhtmltitle($pgtitle);?></font></p>
323 366e5d8c sullrich
324
<?php
325
	$pgtitle_output = true;
326 7cf210f1 Ermal Lu?i
?>