Project

General

Profile

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

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

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

    
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
?>
43

    
44
<div id="wrapper">
45

    
46
	<div id="header">
47
		<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
		<div id="header-right">
49
			<div class="container">
50
				<div class="left">webConfigurator</div>
51
				<div class="right">
52
<?
53
				if (are_notices_pending()) {
54
					$notices = get_notices();
55

    
56
					$requests=array();
57

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

    
66
					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
							$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
							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
						}
94
					}
95
?>
96
					<div id="alerts">
97
						<script type="text/javascript">
98
							var content='<div id="marquee-text"><?= $notice_msgs; ?></div>'
99
						</script>
100
						<script type="text/javascript" src="/ticker.js"></script>
101
					</div>
102
<?
103
				} else {
104
?>
105
					<div id="hostname">
106
						<? print $config['system']['hostname'] . "." . $config['system']['domain']; ?>
107
					</div>
108
<?
109
				}
110
?>
111
				</div>
112
			</div>
113
		</div>
114
	</div> <!-- Header DIV -->
115
	<div id="content">
116
		<div id="left">
117
			<div id="navigation" style="z-index:1000">
118
				<ul id="menu">
119
					<li class="firstdrop">
120
						<div>System</div>
121
						<ul class="subdrop">
122
							<li><a href="/system_advanced.php" class="navlnk">Advanced</a></li>
123
							<li><a href="/system_firmware.php" class="navlnk">Firmware</a></li>
124
							<li><a href="/system.php" class="navlnk">General Setup</a></li>
125
							<li><a href="/index.php?logout" class="navlnk">Logout</a></li>
126
						<?php if($g['platform'] == "pfSense"): ?>
127
							<li><a href="/pkg_mgr.php" class="navlnk">Packages</a></li>
128
						<?php endif; ?>
129
							<li><a href="/wizard.php?xml=setup_wizard.xml" class="navlnk">Setup wizard</a></li>
130
							<li><a href="/system_routes.php" class="navlnk">Static routes</a></li>
131
							<li><a href="/system_usermanager.php" class="navlnk">User Manager</a></li>
132
						</ul>
133
					</li>
134
					<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
							<li><a href="/interfaces_wan.php" class="navlnk">WAN</a></li>
139
							<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
							<?php echo return_ext_menu("Interfaces"); ?>
144
						</ul>
145
					</li>
146
<?php
147
        if($config['system']['shapertype'] <> "m0n0")
148
          $shaper = "firewall_shaper.php";
149
        else
150
          $shaper = "m0n0/firewall_shaper.php";
151
?>
152
					<li class="drop">
153
						<div>Firewall</div>
154
						<ul class="subdrop">
155
							<li><a href="/firewall_aliases.php" class="navlnk">Aliases</a></li>
156
							<li><a href="/firewall_nat.php" class="navlnk">NAT</a></li>
157
							<li><a href="/firewall_rules.php" class="navlnk">Rules</a></li>
158
							<li><a href="/firewall_schedule.php" class="navlnk">Schedules</a></li>
159
							<li><a href="<?=$shaper?>" class="navlnk">Traffic Shaper</a></li>
160
							<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
					<li class="drop">
165
						<div>Services</div>
166
						<ul class="subdrop">
167
							<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
							<li><a href="/load_balancer_pool.php" class="navlnk">Load Balancer</a></li>
173
							<li><a href="/pkg_edit.php?xml=olsrd.xml&id=0" class="navlnk">OLSR</a></li>
174
							<li><a href="/pkg_edit.php?xml=routed/routed.xml&id=0" class="navlnk">RIP</a></li>
175
							<li><a href="/services_snmp.php" class="navlnk">SNMP</a></li>
176
							<li><a href="/status_upnp.php" class="navlnk">MiniUPnPd</a></li>
177
							<li><a href="/pkg_edit.php?xml=openntpd.xml&id=0" class="navlnk">OpenNTPD</a></li>
178
							<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
					<li class="drop">
183
						<div>VPN</div>
184
						<ul class="subdrop">
185
							<li><a href="/vpn_ipsec.php" class="navlnk">IPsec</a></li>
186
							<li><a href="/pkg.php?xml=openvpn.xml" class="navlnk">OpenVPN</a></li>
187
							<li><a href="/vpn_pppoe.php" class="navlnk">PPPoE</a></li>
188
							<li><a href="/vpn_pptp.php" class="navlnk">PPTP</a></li>
189
							<?php echo return_ext_menu("VPN"); ?>
190
						</ul>
191
					</li>
192
					<li class="drop">
193
						<div>Status</div>
194
						<ul class="subdrop">
195
							<?php if (isset($config['captiveportal']['enable'])): ?>
196
							<li><a href="/status_captiveportal.php" class="navlnk">Captive portal</a></li>
197
							<?php endif; ?>
198
							<li><a href="/carp_status.php" class="navlnk">CARP (failover)</a></li>
199
							<li><a href="/diag_dhcp_leases.php" class="navlnk">DHCP leases</a></li>
200
							<li><a href="/status_filter_reload.php" class="navlnk">Filter Reload Status</a></li>
201
							<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
							<li><a href="/status_slbd_pool.php" class="navlnk">Load Balancer</a></li>
204
							<?php if($g['platform'] == "pfSense"): ?>
205
							<li><a href="/diag_pkglogs.php" class="navlnk">Package logs</a></li>
206
							<?php endif; ?>
207
							<li><a href="/status_queues.php" class="navlnk">Queues</a></li>
208
							<li><a href="/status_rrd_graph.php" class="navlnk">RRD Graphs</a></li>
209
							<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
							<li><a href="/status_graph.php?if=wan" class="navlnk">Traffic graph</a></li>
213
							<li><a href="/status_upnp.php" class="navlnk">UPnP</a></li>
214
							<?php $i = 0; $ifdescrs = array();
215
							if (is_array($config['interfaces']['wan']['wireless']) &&
216
								preg_match($g['wireless_regex'], $config['interfaces']['wan']['if']))
217
									$ifdescrs['wan'] = 'WAN';
218
							if (is_array($config['interfaces']['lan']['wireless']) &&
219
								preg_match($g['wireless_regex'], $config['interfaces']['lan']['if']))
220
									$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
									 preg_match($g['wireless_regex'], $config['interfaces']['opt' . $j]['if']))
225
										$ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
226
							}
227
							if (count($ifdescrs) > 0): ?>
228
							<li><a href="/status_wireless.php" class="navlnk">Wireless</a></li>
229
							<?php endif; ?>
230
							<?php echo return_ext_menu("Status"); ?>
231
						</ul>
232
					</li>
233
					<li class="lastdrop">
234
						<div>Diagnostics</div>
235
						<ul id="diag" class="subdrop">
236
							<li><a href="/diag_arp.php" class="navlnk">ARP Tables</a></li>
237
							<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
							<li><a href="/diag_routes.php" class="navlnk">Routes</a></li>
245
							<li><a href="/diag_dump_states.php" class="navlnk">States</a></li>
246
							<li><a href="/diag_traceroute.php" class="navlnk">Traceroute</a></li>
247
							<li><a href="/diag_packet_capture.php" class="navlnk">Packet Capture</a></li>
248
							<?php echo return_ext_menu("Diagnostics"); ?>
249
							<?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
							<?php endif; ?>
253
						</ul>
254
					</li>
255
				</ul>
256
			</div>
257

    
258
		</div> <!-- Left DIV -->
259

    
260
		<div id="right">
261

    
262

    
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
			$display_text = print_notices() . "<br>";
272
		}
273
	}
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

    
286
?>
(36-36/175)