Project

General

Profile

Download (11.7 KB) Statistics
| Branch: | Tag: | Revision:
1 c6c150e9 Scott Ullrich
<?php
2 f0394bbb Scott Ullrich
3 b8f82cd7 Scott Ullrich
require_once("functions.inc");
4 b46bfcf5 Bill Marquette
/* $Id$ */
5 e86a8e57 Scott Ullrich
6 e93441e0 Scott Ullrich
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 90e3bbc0 Colin Smith
				}
23 e93441e0 Scott Ullrich
24
				$description = str_replace('$myurl', $myurl, $menuitem['url']);
25
			} else {
26
				$description = '/pkg.php?xml=' . $menuitem['configfile'];
27 c6c150e9 Scott Ullrich
			}
28 e93441e0 Scott Ullrich
			$htmltext .= '<li><a href="' . $description . ' "class="navlnk">' . $menuitem['name'] . '</a></li>' . "\n";
29 c6c150e9 Scott Ullrich
		}
30
	}
31 e93441e0 Scott Ullrich
	return $htmltext;
32
}
33 65384707 Erik Kristensen
34 e93441e0 Scott Ullrich
/* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */
35
if ($_REQUEST['noticeaction'] == 'acknowledge') {
36
	$notice_id = $_REQUEST['noticeid'];
37
	close_notice($notice_id);
38
}
39
/**********************************************/
40 65384707 Erik Kristensen
41 c6c150e9 Scott Ullrich
?>
42 12a00813 Erik Kristensen
43 9f53d3a8 Scott Ullrich
<div id="wrapper">
44
45
	<div id="header">
46 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>
47 9f53d3a8 Scott Ullrich
		<div id="header-right">
48 1df0159c Erik Kristensen
			<div class="container">
49
				<div class="left">webConfigurator</div>
50
				<div class="right">
51 64fcbfc8 Erik Kristensen
<?
52 b1cbbf24 Erik Kristensen
				if (are_notices_pending()) {
53
					$notices = get_notices();
54 dca32536 Scott Ullrich
55 a2046789 Scott Ullrich
					$requests=array();
56 dca32536 Scott Ullrich
57 a6fac06e Erik Kristensen
					## Get Query Arguments from URL ###
58
					foreach ($_REQUEST as $key => $value) {
59
						if ($key != "PHPSESSID")
60
							$requests[] = $key.'='.$value;
61
					}
62 a2046789 Scott Ullrich
					if(is_array($requests))
63
						$request_string = implode("&", $requests);
64 a6fac06e Erik Kristensen
65 35eef977 Scott Ullrich
					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 91d3d442 Scott Ullrich
							$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 35eef977 Scott Ullrich
							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 b1cbbf24 Erik Kristensen
						}
93
					}
94 64fcbfc8 Erik Kristensen
?>
95 b1cbbf24 Erik Kristensen
					<div id="alerts">
96
						<script type="text/javascript">
97
							var content='<div id="marquee-text"><?= $notice_msgs; ?></div>'
98
						</script>
99 dca32536 Scott Ullrich
						<script type="text/javascript" src="/ticker.js"></script>
100 b1cbbf24 Erik Kristensen
					</div>
101
<?
102
				} else {
103 612832ec Erik Kristensen
?>
104
					<div id="hostname">
105
						<? print $config['system']['hostname'] . "." . $config['system']['domain']; ?>
106
					</div>
107
<?
108 b1cbbf24 Erik Kristensen
				}
109
?>
110 1df0159c Erik Kristensen
				</div>
111
			</div>
112 9f53d3a8 Scott Ullrich
		</div>
113
	</div> <!-- Header DIV -->
114
	<div id="content">
115
		<div id="left">
116 2779b49b Scott Dale
			<div id="navigation" style="z-index:1000">
117 41058a8c Erik Kristensen
				<ul id="menu">
118 d86286ed Erik Kristensen
					<li class="firstdrop">
119 9f53d3a8 Scott Ullrich
						<div>System</div>
120 d86286ed Erik Kristensen
						<ul class="subdrop">
121 df81417f Matthew Grooms
							<?php
122
							output_menu_item("/system_advanced_admin.php", "Advanced");
123 b8f82cd7 Scott Ullrich
							output_menu_item("/system_firmware.php", "Firmware");
124
							output_menu_item("/system.php", "General Setup");
125 df81417f Matthew Grooms
							?>
126 65bad23b Scott Ullrich
						<?php if($g['platform'] == "pfSense"): ?>
127 df81417f Matthew Grooms
							<?=output_menu_item("/pkg_mgr.php", "Packages");?>
128 0831bc86 Scott Ullrich
						<?php endif; ?>
129 b8f82cd7 Scott Ullrich
							<?=output_menu_item("/wizard.php?xml=setup_wizard.xml", "Setup Wizard");?>
130
							<?=output_menu_item("/system_gateways.php", "Routing");?>
131 d799787e Matthew Grooms
							<?=output_menu_item("/system_camanager.php", "Cert Manager");?>	
132 df81417f Matthew Grooms
							<?=output_menu_item("/system_usermanager.php", "User Manager");?>
133
							<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 b8f82cd7 Scott Ullrich
							<?php if (!isset($config['system']['webgui']['noassigninterfaces'])): ?>
140
							<?=output_menu_item("/interfaces_assign.php", "(assign)");?>								
141
							<?php endif; ?>
142 4476d447 Ermal Luçi
							<?php $opts = get_configured_interface_with_descr(false, true); 
143 b6db9217 Ermal Luçi
							foreach ($opts as $oif => $odescr): 
144
								if (!isset($config['interfaces'][$oif]['ovpn'])): ?>
145 732cabc5 Scott Ullrich
							<?=output_menu_item("/interfaces.php?if={$oif}", htmlspecialchars($odescr))?>
146 b6db9217 Ermal Luçi
							<?php endif; endforeach; ?>
147 dca32536 Scott Ullrich
							<?php echo return_ext_menu("Interfaces"); ?>
148 9f53d3a8 Scott Ullrich
						</ul>
149
					</li>
150 81a6f5ea Scott Ullrich
<?php
151
        if($config['system']['shapertype'] <> "m0n0")
152
          $shaper = "firewall_shaper.php";
153
        else
154
          $shaper = "m0n0/firewall_shaper.php";
155
?>
156 d86286ed Erik Kristensen
					<li class="drop">
157 9f53d3a8 Scott Ullrich
						<div>Firewall</div>
158 d86286ed Erik Kristensen
						<ul class="subdrop">
159 b8f82cd7 Scott Ullrich
							<?=output_menu_item("/firewall_aliases.php", "Aliases");?>	
160 74e44a2e Chris Buechler
							<?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 b8f82cd7 Scott Ullrich
							<?=output_menu_item("/firewall_rules.php", "Rules");?>	
169
							<?=output_menu_item("/firewall_schedule.php", "Schedules");?>	
170 f97e2dab Chris Buechler
							<?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 f33aa6ce Scott Ullrich
							?>	
179 b8f82cd7 Scott Ullrich
							<?=output_menu_item("/firewall_virtual_ip.php", "Virtual IPs");?>	
180 9f53d3a8 Scott Ullrich
							<?php echo return_ext_menu("Firewall"); ?>
181
						</ul>
182
					</li>
183 d86286ed Erik Kristensen
					<li class="drop">
184 9f53d3a8 Scott Ullrich
						<div>Services</div>
185 d86286ed Erik Kristensen
						<ul class="subdrop">
186 b8f82cd7 Scott Ullrich
							<?=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 f97e2dab Chris Buechler
							<?=output_menu_item("/services_dyndns.php", "Dynamic DNS");?>
191 b8f82cd7 Scott Ullrich
							<?=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 f97e2dab Chris Buechler
							<?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 b8f82cd7 Scott Ullrich
							<?=output_menu_item("/pkg_edit.php?xml=openntpd.xml&id=0", "OpenNTPD");?>	
205
							<?=output_menu_item("/services_wol.php", "Wake on LAN");?>	
206 9f53d3a8 Scott Ullrich
							<?php echo return_ext_menu("Services"); ?>
207
						</ul>
208
					</li>
209 d86286ed Erik Kristensen
					<li class="drop">
210 9f53d3a8 Scott Ullrich
						<div>VPN</div>
211 d86286ed Erik Kristensen
						<ul class="subdrop">
212 348327b7 Chris Buechler
							<?=output_menu_item("/vpn_ipsec.php", "IPsec");?>
213 d799787e Matthew Grooms
							<?=output_menu_item("/vpn_openvpn_server.php", "OpenVPN");?>
214 b8f82cd7 Scott Ullrich
							<?=output_menu_item("/vpn_pptp.php", "PPTP");?>
215 9f53d3a8 Scott Ullrich
							<?php echo return_ext_menu("VPN"); ?>
216
						</ul>
217
					</li>
218 d86286ed Erik Kristensen
					<li class="drop">
219 9f53d3a8 Scott Ullrich
						<div>Status</div>
220 d86286ed Erik Kristensen
						<ul class="subdrop">
221 9f53d3a8 Scott Ullrich
							<?php if (isset($config['captiveportal']['enable'])): ?>
222 b8f82cd7 Scott Ullrich
							<?=output_menu_item("/status_captiveportal.php", "Captive Portal");?>
223 9f53d3a8 Scott Ullrich
							<?php endif; ?>
224 b8f82cd7 Scott Ullrich
							<?=output_menu_item("/carp_status.php", "CARP (failover)");?>
225
							<?=output_menu_item("/index.php", "Dashboard");?>
226 c67a0d18 Seth Mos
							<?=output_menu_item("/status_gateways.php", "Gateways");?>
227 b8f82cd7 Scott Ullrich
							<?=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 348327b7 Chris Buechler
							<?=output_menu_item("/diag_ipsec.php", "IPsec");?>
231 b8f82cd7 Scott Ullrich
							<?=output_menu_item("/status_slbd_pool.php", "Load Balancer");?>
232 63084885 Matthew Grooms
							<?=output_menu_item("/status_openvpn.php", "OpenVPN");?>
233 50ff5462 Scott Ullrich
							<?php if($g['platform'] == "pfSense"): ?>
234 b8f82cd7 Scott Ullrich
							<?=output_menu_item("/diag_pkglogs.php", "Package Logs");?>
235 0831bc86 Scott Ullrich
							<?php endif; ?>
236 b8f82cd7 Scott Ullrich
							<?=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 cc908f39 Chris Buechler
							<?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 ddd272d3 Ermal Luçi
							<?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 9f53d3a8 Scott Ullrich
							}
255 dca32536 Scott Ullrich
							if (count($ifdescrs) > 0): ?>
256 b8f82cd7 Scott Ullrich
							<?=output_menu_item("/status_wireless.php", "Wireless");?>
257 9f53d3a8 Scott Ullrich
							<?php endif; ?>
258 dca32536 Scott Ullrich
							<?php echo return_ext_menu("Status"); ?>
259 9f53d3a8 Scott Ullrich
						</ul>
260
					</li>
261 d86286ed Erik Kristensen
					<li class="lastdrop">
262 9f53d3a8 Scott Ullrich
						<div>Diagnostics</div>
263 d86286ed Erik Kristensen
						<ul id="diag" class="subdrop">
264 b8f82cd7 Scott Ullrich
							<?=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 9f53d3a8 Scott Ullrich
							<?php echo return_ext_menu("Diagnostics"); ?>
277 3a078222 Erik Kristensen
							<?php if(isset($config['system']['developer'])): ?>
278
							<li><hr width="80%"/></li>
279 b8f82cd7 Scott Ullrich
							<?=output_menu_item("/restart_httpd.php", "Restart HTTPD");?>							
280 0831bc86 Scott Ullrich
							<?php endif; ?>
281 9f53d3a8 Scott Ullrich
						</ul>
282
					</li>
283
				</ul>
284
			</div>
285 dca32536 Scott Ullrich
286 9f53d3a8 Scott Ullrich
		</div> <!-- Left DIV -->
287 dca32536 Scott Ullrich
288 9f53d3a8 Scott Ullrich
		<div id="right">
289 dca32536 Scott Ullrich
290 5c9cc1de Scott Ullrich
<?php
291 45ee90ed Matthew Grooms
292 5c9cc1de Scott Ullrich
	/* 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 e444cd01 Scott Ullrich
			$display_text = print_notices() . "<br>";
300 dca32536 Scott Ullrich
		}
301 5c9cc1de Scott Ullrich
	}
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 b8f82cd7 Scott Ullrich
314
function output_menu_item($url, $name) {
315 45ee90ed Matthew Grooms
	if (isAllowedPage($url))
316
		echo "<li><a href=\"{$url}\" class=\"navlnk\">{$name}</a></li>\n";
317 b8f82cd7 Scott Ullrich
}
318 19b331c1 Scott Ullrich
	
319
?>
320 dca32536 Scott Ullrich
321 19b331c1 Scott Ullrich
<p class="pgtitle"><?=genhtmltitle($pgtitle);?></font></p>