Project

General

Profile

Download (11.7 KB) Statistics
| Branch: | Tag: | Revision:
1 c6c150e9 Scott Ullrich
<?php
2 f0394bbb Scott Ullrich
3 cc6bafe0 Scott Ullrich
require_once("notices.inc");
4 b46bfcf5 Bill Marquette
/* $Id$ */
5 859329c8 Scott Ullrich
	function return_ext_menu($section) {
6 90e3bbc0 Colin Smith
		global $config;
7 c6c150e9 Scott Ullrich
		$htmltext = "";
8 90e3bbc0 Colin Smith
		if($config['installedpackages']['menu'] <> "") {
9
			foreach($config['installedpackages']['menu'] as $menuitem) {
10
				if($menuitem['section'] != $section) continue;
11
				if($menuitem['url'] <> "") {
12 656a2fea Seth Mos
				 	$addresswithport = getenv("HTTP_HOST");
13 e86a8e57 Scott Ullrich
					$colonpos = strpos($addresswithport, ":");
14 656a2fea Seth Mos
					if ($colonpos !== False){
15
						//my url is actually just the IP address of the pfsense box
16 e86a8e57 Scott Ullrich
						$myurl = substr($addresswithport, 0, $colonpos);
17 656a2fea Seth Mos
					}
18
					else
19
					{
20 e86a8e57 Scott Ullrich
						$myurl = $addresswithport;
21 656a2fea Seth Mos
					}
22 e86a8e57 Scott Ullrich
23 656a2fea Seth Mos
					$description = str_replace('$myurl', $myurl, $menuitem['url']);
24 90e3bbc0 Colin Smith
				} else {
25
					$description = '/pkg.php?xml=' . $menuitem['configfile'];
26
				}
27 9f53d3a8 Scott Ullrich
				$htmltext .= '<li><a href="' . $description . ' "class="navlnk">' . $menuitem['name'] . '</a></li>' . "\n";
28 c6c150e9 Scott Ullrich
			}
29
		}
30
		return $htmltext;
31
	}
32 65384707 Erik Kristensen
33
34
35
36
	/* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */
37
	if ($_REQUEST['noticeaction'] == 'acknowledge') {
38
		$notice_id = $_REQUEST['noticeid'];
39
		close_notice($notice_id);
40
	}
41
	/**********************************************/
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 dca32536 Scott Ullrich
						<script type="text/javascript" src="/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 9f53d3a8 Scott Ullrich
							<li><a href="/system_advanced.php" class="navlnk">Advanced</a></li>
123 98db4dd5 Scott Ullrich
							<li><a href="/system_firmware.php" class="navlnk">Firmware</a></li>
124 556ed559 Erik Kristensen
							<li><a href="/system.php" class="navlnk">General Setup</a></li>
125 fab7ff44 Bill Marquette
							<li><a href="/index.php?logout" class="navlnk">Logout</a></li>
126 65bad23b Scott Ullrich
						<?php if($g['platform'] == "pfSense"): ?>
127 9f53d3a8 Scott Ullrich
							<li><a href="/pkg_mgr.php" class="navlnk">Packages</a></li>
128 0831bc86 Scott Ullrich
						<?php endif; ?>
129 c4ac1c80 Scott Ullrich
							<li><a href="/wizard.php?xml=setup_wizard.xml" class="navlnk">Setup wizard</a></li>
130 9f53d3a8 Scott Ullrich
							<li><a href="/system_routes.php" class="navlnk">Static routes</a></li>
131 fab7ff44 Bill Marquette
							<li><a href="/system_usermanager.php" class="navlnk">User Manager</a></li>
132 9f53d3a8 Scott Ullrich
						</ul>
133
					</li>
134 d86286ed Erik Kristensen
					<li class="drop">
135
						<div>Interfaces</div>
136
						<ul class="subdrop">
137
							<?php if (!isset($config['system']['webgui']['noassigninterfaces'])): ?><li><a href="/interfaces_assign.php" class="navlnks">(assign)</a></li><?php endif; ?>
138 dca32536 Scott Ullrich
							<li><a href="/interfaces_wan.php" class="navlnk">WAN</a></li>
139 9f53d3a8 Scott Ullrich
							<li><a href="/interfaces_lan.php" class="navlnk">LAN</a></li>
140
							<?php for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++): if (!isset($config['interfaces']['opt' . $i]['ovpn'])): ?>
141
							<li><a href="/interfaces_opt.php?index=<?=$i;?>" class="navlnk"><?=htmlspecialchars($config['interfaces']['opt' . $i]['descr']);?></a></li>
142
							<?php endif; endfor; ?>
143 dca32536 Scott Ullrich
							<?php echo return_ext_menu("Interfaces"); ?>
144 9f53d3a8 Scott Ullrich
						</ul>
145
					</li>
146 81a6f5ea Scott Ullrich
<?php
147
        if($config['system']['shapertype'] <> "m0n0")
148
          $shaper = "firewall_shaper.php";
149
        else
150
          $shaper = "m0n0/firewall_shaper.php";
151
?>
152 d86286ed Erik Kristensen
					<li class="drop">
153 9f53d3a8 Scott Ullrich
						<div>Firewall</div>
154 d86286ed Erik Kristensen
						<ul class="subdrop">
155 9f53d3a8 Scott Ullrich
							<li><a href="/firewall_aliases.php" class="navlnk">Aliases</a></li>
156
							<li><a href="/firewall_nat.php" class="navlnk">NAT</a></li>
157 dca32536 Scott Ullrich
							<li><a href="/firewall_rules.php" class="navlnk">Rules</a></li>
158 0711d73f Scott Ullrich
							<li><a href="/firewall_schedule.php" class="navlnk">Schedules</a></li>
159 401432ac Scott Ullrich
							<li><a href="<?=$shaper?>" class="navlnk">Traffic Shaper</a></li>
160 9f53d3a8 Scott Ullrich
							<li><a href="/firewall_virtual_ip.php" class="navlnk">Virtual IPs</a></li>
161
							<?php echo return_ext_menu("Firewall"); ?>
162
						</ul>
163
					</li>
164 d86286ed Erik Kristensen
					<li class="drop">
165 9f53d3a8 Scott Ullrich
						<div>Services</div>
166 d86286ed Erik Kristensen
						<ul class="subdrop">
167 9f53d3a8 Scott Ullrich
							<li><a href="/services_captiveportal.php" class="navlnk">Captive portal</a></li>
168
							<li><a href="/services_dnsmasq.php" class="navlnk">DNS forwarder</a></li>
169
							<li><a href="/services_dhcp_relay.php" class="navlnk">DHCP relay</a></li>
170
							<li><a href="/services_dhcp.php" class="navlnk">DHCP server</a></li>
171
							<li><a href="/services_dyndns.php" class="navlnk">Dynamic DNS</a></li>
172 7fb2f3f7 Bill Marquette
							<li><a href="/load_balancer_pool.php" class="navlnk">Load Balancer</a></li>
173 8061dc59 Scott Ullrich
							<li><a href="/pkg_edit.php?xml=olsrd.xml&id=0" class="navlnk">OLSR</a></li>
174 4637143a Bill Marquette
							<li><a href="/pkg_edit.php?xml=routed/routed.xml&id=0" class="navlnk">RIP</a></li>
175 9f53d3a8 Scott Ullrich
							<li><a href="/services_snmp.php" class="navlnk">SNMP</a></li>
176 422e039b Scott Ullrich
							<li><a href="/status_upnp.php" class="navlnk">MiniUPnPd</a></li>
177 e86a8e57 Scott Ullrich
							<li><a href="/pkg_edit.php?xml=openntpd.xml&id=0" class="navlnk">OpenNTPD</a></li>
178 9f53d3a8 Scott Ullrich
							<li><a href="/services_wol.php" class="navlnk">Wake on LAN</a></li>
179
							<?php echo return_ext_menu("Services"); ?>
180
						</ul>
181
					</li>
182 d86286ed Erik Kristensen
					<li class="drop">
183 9f53d3a8 Scott Ullrich
						<div>VPN</div>
184 d86286ed Erik Kristensen
						<ul class="subdrop">
185 9f53d3a8 Scott Ullrich
							<li><a href="/vpn_ipsec.php" class="navlnk">IPsec</a></li>
186 89faa53a Scott Ullrich
							<li><a href="/pkg.php?xml=openvpn.xml" class="navlnk">OpenVPN</a></li>
187 1cbdc581 Scott Ullrich
							<li><a href="/vpn_pppoe.php" class="navlnk">PPPoE</a></li>
188 9f53d3a8 Scott Ullrich
							<li><a href="/vpn_pptp.php" class="navlnk">PPTP</a></li>
189
							<?php echo return_ext_menu("VPN"); ?>
190
						</ul>
191
					</li>
192 d86286ed Erik Kristensen
					<li class="drop">
193 9f53d3a8 Scott Ullrich
						<div>Status</div>
194 d86286ed Erik Kristensen
						<ul class="subdrop">
195 9f53d3a8 Scott Ullrich
							<?php if (isset($config['captiveportal']['enable'])): ?>
196
							<li><a href="/status_captiveportal.php" class="navlnk">Captive portal</a></li>
197
							<?php endif; ?>
198 dca32536 Scott Ullrich
							<li><a href="/carp_status.php" class="navlnk">CARP (failover)</a></li>
199 9f53d3a8 Scott Ullrich
							<li><a href="/diag_dhcp_leases.php" class="navlnk">DHCP leases</a></li>
200 0ffb12ae Scott Ullrich
							<li><a href="/status_filter_reload.php" class="navlnk">Filter Reload Status</a></li>
201 9f53d3a8 Scott Ullrich
							<li><a href="/status_interfaces.php" class="navlnk">Interfaces</a></li>
202
							<li><a href="/diag_ipsec_sad.php" class="navlnk">IPsec</a></li>
203 784c448c Scott Ullrich
							<li><a href="/status_slbd_pool.php" class="navlnk">Load Balancer</a></li>
204 50ff5462 Scott Ullrich
							<?php if($g['platform'] == "pfSense"): ?>
205 9f53d3a8 Scott Ullrich
							<li><a href="/diag_pkglogs.php" class="navlnk">Package logs</a></li>
206 0831bc86 Scott Ullrich
							<?php endif; ?>
207 9f53d3a8 Scott Ullrich
							<li><a href="/status_queues.php" class="navlnk">Queues</a></li>
208 1678cd9e Seth Mos
							<li><a href="/status_rrd_graph.php" class="navlnk">RRD Graphs</a></li>
209 9f53d3a8 Scott Ullrich
							<li><a href="/status_services.php" class="navlnk">Services</a></li>
210
							<li><a href="/index.php" class="navlnk">System</a></li>
211
							<li><a href="/diag_logs.php" class="navlnk">System logs</a></li>
212 10bfec0a Scott Ullrich
							<li><a href="/status_graph.php?if=wan" class="navlnk">Traffic graph</a></li>
213 f9c17c3e Seth Mos
							<li><a href="/status_upnp.php" class="navlnk">UPnP</a></li>
214 9f53d3a8 Scott Ullrich
							<?php $i = 0; $ifdescrs = array();
215
							if (is_array($config['interfaces']['wan']['wireless']) &&
216 187be289 Scott Ullrich
								preg_match($g['wireless_regex'], $config['interfaces']['wan']['if']))
217 dca32536 Scott Ullrich
									$ifdescrs['wan'] = 'WAN';
218 9f53d3a8 Scott Ullrich
							if (is_array($config['interfaces']['lan']['wireless']) &&
219 4776ee17 Scott Ullrich
								preg_match($g['wireless_regex'], $config['interfaces']['lan']['if']))
220 9f53d3a8 Scott Ullrich
									$ifdescrs['lan'] = 'LAN';
221
							for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
222
								if (is_array($config['interfaces']['opt' . $j]['wireless']) &&
223
									isset($config['interfaces']['opt' . $j]['enable']) &&
224 4776ee17 Scott Ullrich
									 preg_match($g['wireless_regex'], $config['interfaces']['opt' . $j]['if']))
225
										$ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
226 9f53d3a8 Scott Ullrich
							}
227 dca32536 Scott Ullrich
							if (count($ifdescrs) > 0): ?>
228 9f53d3a8 Scott Ullrich
							<li><a href="/status_wireless.php" class="navlnk">Wireless</a></li>
229
							<?php endif; ?>
230 dca32536 Scott Ullrich
							<?php echo return_ext_menu("Status"); ?>
231 9f53d3a8 Scott Ullrich
						</ul>
232
					</li>
233 d86286ed Erik Kristensen
					<li class="lastdrop">
234 9f53d3a8 Scott Ullrich
						<div>Diagnostics</div>
235 d86286ed Erik Kristensen
						<ul id="diag" class="subdrop">
236 a921dafa Scott Ullrich
							<li><a href="/diag_arp.php" class="navlnk">ARP Tables</a></li>
237 9f53d3a8 Scott Ullrich
							<li><a href="/diag_backup.php" class="navlnk">Backup/Restore</a></li>
238
							<li><a href="/exec.php" class="navlnk">Command Prompt</a></li>
239
							<li><a href="/edit.php" class="navlnk">Edit File</a></li>
240
							<li><a href="/diag_defaults.php" class="navlnk">Factory defaults </a></li>
241
							<li><a href="/halt.php" class="navlnk">Halt system</a></li>
242
							<li><a href="/diag_ping.php" class="navlnk">Ping</a></li>
243
							<li><a href="/reboot.php" class="navlnk">Reboot system</a></li>
244 0eacb3b2 Scott Ullrich
							<li><a href="/diag_routes.php" class="navlnk">Routes</a></li>
245 9f53d3a8 Scott Ullrich
							<li><a href="/diag_dump_states.php" class="navlnk">States</a></li>
246 a921dafa Scott Ullrich
							<li><a href="/diag_traceroute.php" class="navlnk">Traceroute</a></li>
247 ab6a5cfc Scott Ullrich
							<li><a href="/diag_packet_capture.php" class="navlnk">Packet Capture</a></li>
248 9f53d3a8 Scott Ullrich
							<?php echo return_ext_menu("Diagnostics"); ?>
249 3a078222 Erik Kristensen
							<?php if(isset($config['system']['developer'])): ?>
250
							<li><hr width="80%"/></li>
251
							<li><a href="/restart_httpd.php" class="navlnk">Restart HTTPD</a></li>
252 0831bc86 Scott Ullrich
							<?php endif; ?>
253 9f53d3a8 Scott Ullrich
						</ul>
254
					</li>
255
				</ul>
256
			</div>
257 dca32536 Scott Ullrich
258 9f53d3a8 Scott Ullrich
		</div> <!-- Left DIV -->
259 dca32536 Scott Ullrich
260 9f53d3a8 Scott Ullrich
		<div id="right">
261 dca32536 Scott Ullrich
262 5c9cc1de Scott Ullrich
263
<?php
264
	/* display a top alert bar if need be */
265
	$need_alert_display = false;
266
	$found_notices = are_notices_pending();
267
	if($found_notices == true) {
268
		$notices = get_notices();
269
		if(!$notices) {
270
			$need_alert_display = true;
271 e444cd01 Scott Ullrich
			$display_text = print_notices() . "<br>";
272 dca32536 Scott Ullrich
		}
273 5c9cc1de Scott Ullrich
	}
274
	if($need_alert_display == true) {
275
                echo "<div style=\"background-color:#000000\" id=\"roundalert\">";
276
                echo "<table>";
277
		echo "<tr><td><font color=\"#ffffff\">";
278
		echo "&nbsp;&nbsp;<img align=\"middle\" src=\"/top_notification.gif\">&nbsp;&nbsp;&nbsp;";
279
		echo $display_text;
280
		echo "</td>";
281
		echo "</tr>";
282
		echo "</table>";
283
		echo "</div>";
284
	}
285 dca32536 Scott Ullrich
286 fab7ff44 Bill Marquette
?>