Project

General

Profile

Download (10 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
require_once("notices.inc");
3
/* $Id$ */
4
	function return_ext_menu($section) {
5
		global $config;
6
		$htmltext = "";
7
		if($config['installedpackages']['menu'] <> "") {
8
			foreach($config['installedpackages']['menu'] as $menuitem) {
9
				if($menuitem['section'] != $section) continue;
10
				if($menuitem['url'] <> "") {
11
					$description = str_replace('$myurl', getenv("HTTP_HOST"), $menuitem['url']);
12
				} else {
13
					$description = '/pkg.php?xml=' . $menuitem['configfile'];
14
				}
15
				$htmltext .= '<li><a href="' . $description . ' "class="navlnk">' . $menuitem['name'] . '</a></li>' . "\n";
16
			}
17
		}
18
		return $htmltext;
19
	}
20

    
21

    
22

    
23

    
24
	/* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */
25
	if ($_REQUEST['noticeaction'] == 'acknowledge') {
26
		$notice_id = $_REQUEST['noticeid'];
27
		close_notice($notice_id);
28
	}
29
	/**********************************************/
30
?>
31

    
32
<div id="wrapper">
33

    
34
	<div id="header">
35
		<div id="header-left"><a href="index.php" id="status-link"><img src="/themes/<?= $g['theme']; ?>/images/transparent.gif" border="0"></img></a></div>
36
		<div id="header-right">
37
			<div class="container">
38
				<div class="left">webConfigurator</div>
39
				<div class="right">
40
<?
41
				if (are_notices_pending()) {
42
					$notices = get_notices();
43
					
44
					$requests=array();
45
					
46
					## Get Query Arguments from URL ###
47
					foreach ($_REQUEST as $key => $value) {
48
						if ($key != "PHPSESSID")
49
							$requests[] = $key.'='.$value;
50
					}
51
					if(is_array($requests))
52
						$request_string = implode("&", $requests);
53

    
54
					foreach ($notices as $key => $value) {
55
						$date = date("m-d-y H:i:s", $key);
56
						$noticemsg = str_replace("'", "", $value['notice']);
57
						$noticemsg = str_replace('"', "", $noticemsg);
58
						$noticemsg = str_replace("\n", "", $noticemsg);
59
						$noticemsg = str_replace("<p>", "", $noticemsg);
60
						$noticemsg = str_replace("<pre>", "", $noticemsg);
61
						$noticemsg = str_replace("</pre>", "", $noticemsg);
62
						$noticemsg = str_replace("</p>", "", $noticemsg);
63
						$noticemsg = str_replace("<br>", "", $noticemsg);
64
						$notice_msgs = '<a href="?noticeaction=acknowledge&noticeid=all">Acknowledge All</a> &nbsp;&nbsp;&nbsp;&nbsp;.:.&nbsp;&nbsp;&nbsp;&nbsp; ';
65
						if ($value['url']) {
66
							$notice_msgs .= $date.' - <a href="'.$url.'?'.$request_string.'&noticeaction=acknowledge&noticeid='.$key.'">['.$value['id'].']</a>';
67
						} else {
68
							$notice_msgs .= $date.' - <a href="?'.$request_string.'&noticeaction=acknowledge&noticeid='.$key.'">['.$value['id'].']'.$noticemsg.'</a>';
69
						}
70
						$notice_msgs .= " &nbsp;&nbsp;&nbsp;&nbsp;.:.&nbsp;&nbsp;&nbsp;&nbsp; ";
71
					}
72
?>
73
					<div id="alerts">
74
						<script type="text/javascript">
75
							var content='<div id="marquee-text"><?= $notice_msgs; ?></div>'
76
						</script>
77
						<script type="text/javascript" src="/ticker.js"></script>				
78
					</div>
79
<?
80
				} else {
81
?>
82
					<div id="hostname">
83
						<? print $config['system']['hostname'] . "." . $config['system']['domain']; ?>
84
					</div>
85
<?
86
				}
87
?>
88
				</div>
89
			</div>
90
		</div>
91
	</div> <!-- Header DIV -->
92
	<div id="content">
93
		<div id="left">
94
			<div id="navigation">
95
				<ul id="menu">
96
					<li class="firstdrop">
97
						<div>System</div>
98
						<ul class="subdrop">
99
							<li><a href="/system_advanced.php" class="navlnk">Advanced</a></li>
100
							<li><a href="/system_firmware.php" class="navlnk">Firmware</a></li>
101
							<li><a href="/system.php" class="navlnk">General Setup</a></li>
102
						<?php if($g['platform'] == "pfSense"): ?>
103
							<li><a href="/pkg_mgr.php" class="navlnk">Packages</a></li>
104
						<?php endif; ?>
105
							<li><a href="/wizard.php?xml=setup_wizard.xml" class="navlnk">Setup wizard</a></li>
106
							<li><a href="/system_routes.php" class="navlnk">Static routes</a></li>
107
						</ul>
108
					</li>
109
					<li class="drop">
110
						<div>Interfaces</div>
111
						<ul class="subdrop">
112
							<?php if (!isset($config['system']['webgui']['noassigninterfaces'])): ?><li><a href="/interfaces_assign.php" class="navlnks">(assign)</a></li><?php endif; ?>
113
							<li><a href="/interfaces_wan.php" class="navlnk">WAN</a></li>							
114
							<li><a href="/interfaces_lan.php" class="navlnk">LAN</a></li>
115
							<?php for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++): if (!isset($config['interfaces']['opt' . $i]['ovpn'])): ?>
116
							<li><a href="/interfaces_opt.php?index=<?=$i;?>" class="navlnk"><?=htmlspecialchars($config['interfaces']['opt' . $i]['descr']);?></a></li>
117
							<?php endif; endfor; ?>
118
							<?php echo return_ext_menu("Interfaces"); ?>							
119
						</ul>
120
					</li>
121
					<li class="drop">
122
						<div>Firewall</div>
123
						<ul class="subdrop">
124
							<li><a href="/firewall_aliases.php" class="navlnk">Aliases</a></li>
125
							<li><a href="/firewall_nat.php" class="navlnk">NAT</a></li>
126
							<li><a href="/firewall_rules.php" class="navlnk">Rules</a></li>              
127
							<li><a href="/firewall_shaper.php" class="navlnk">Traffic Shaper</a></li>
128
							<li><a href="/firewall_virtual_ip.php" class="navlnk">Virtual IPs</a></li>
129
							<?php echo return_ext_menu("Firewall"); ?>
130
						</ul>
131
					</li>
132
					<li class="drop">
133
						<div>Services</div>
134
						<ul class="subdrop">
135
							<li><a href="/services_captiveportal.php" class="navlnk">Captive portal</a></li>
136
							<li><a href="/services_dnsmasq.php" class="navlnk">DNS forwarder</a></li>
137
							<li><a href="/services_dhcp_relay.php" class="navlnk">DHCP relay</a></li>
138
							<li><a href="/services_dhcp.php" class="navlnk">DHCP server</a></li>
139
							<li><a href="/services_dyndns.php" class="navlnk">Dynamic DNS</a></li>
140
							<li><a href="/load_balancer_pool.php" class="navlnk">Load Balancer</a></li>
141
							<li><a href="/services_snmp.php" class="navlnk">SNMP</a></li>
142
							<li><a href="/services_wol.php" class="navlnk">Wake on LAN</a></li>
143
							<?php echo return_ext_menu("Services"); ?>
144
						</ul>
145
					</li>
146
					<li class="drop">
147
						<div>VPN</div>
148
						<ul class="subdrop">
149
							<li><a href="/vpn_ipsec.php" class="navlnk">IPsec</a></li>
150
							<?php
151
								if(isset($config['system']['developer'])) {
152
									echo "<li><a href=\"/vpn_openvpn.php\" class=\"navlnk\">OpenVPN</a></li>";
153
								}
154
							?>
155
							<li><a href="/vpn_pptp.php" class="navlnk">PPTP</a></li>
156
							<li><a href="/vpn_pppoe.php" class="navlnk">PPPoE</a></li>
157
							<?php echo return_ext_menu("VPN"); ?>
158
						</ul>
159
					</li>
160
					<li class="drop">
161
						<div>Status</div>
162
						<ul class="subdrop">
163
							<?php if (isset($config['captiveportal']['enable'])): ?>
164
							<li><a href="/status_captiveportal.php" class="navlnk">Captive portal</a></li>
165
							<?php endif; ?>
166
							<li><a href="/carp_status.php" class="navlnk">CARP (failover)</a></li>		
167
							<li><a href="/diag_dhcp_leases.php" class="navlnk">DHCP leases</a></li>
168
							<li><a href="/status_interfaces.php" class="navlnk">Interfaces</a></li>
169
							<li><a href="/diag_ipsec_sad.php" class="navlnk">IPsec</a></li>
170
							<?php if($g['platform'] == "pfSense"): ?>
171
							<li><a href="/diag_pkglogs.php" class="navlnk">Package logs</a></li>
172
							<?php endif; ?>
173
							<li><a href="/status_queues.php" class="navlnk">Queues</a></li>
174
							<li><a href="/status_services.php" class="navlnk">Services</a></li>
175
							<li><a href="/index.php" class="navlnk">System</a></li>
176
							<li><a href="/diag_logs.php" class="navlnk">System logs</a></li>
177
							<li><a href="/status_graph.php" class="navlnk">Traffic graph</a></li>
178
							<?php $i = 0; $ifdescrs = array();
179
							if (is_array($config['interfaces']['wan']['wireless']) &&
180
								preg_match($g['wireless_regex'], $config['interfaces']['wan']['if']))
181
									$ifdescrs['wan'] = 'WAN';									
182
							if (is_array($config['interfaces']['lan']['wireless']) &&
183
								preg_match($g['wireless_regex'], $config['interfaces']['lan']['if']))
184
									$ifdescrs['lan'] = 'LAN';
185
							for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
186
								if (is_array($config['interfaces']['opt' . $j]['wireless']) &&
187
									isset($config['interfaces']['opt' . $j]['enable']) &&
188
									 preg_match($g['wireless_regex'], $config['interfaces']['opt' . $j]['if']))
189
										$ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
190
							}
191
							if (count($ifdescrs) > 0): ?>	      
192
							<li><a href="/status_wireless.php" class="navlnk">Wireless</a></li>
193
							<?php endif; ?>
194
							<?php echo return_ext_menu("Status"); ?>							
195
						</ul>
196
					</li>
197
					<li class="lastdrop">
198
						<div>Diagnostics</div>
199
						<ul id="diag" class="subdrop">
200
							<li><a href="/diag_arp.php" class="navlnk">ARP Tables</a></li>
201
							<li><a href="/diag_backup.php" class="navlnk">Backup/Restore</a></li>
202
							<li><a href="/exec.php" class="navlnk">Command Prompt</a></li>
203
							<li><a href="/edit.php" class="navlnk">Edit File</a></li>
204
							<li><a href="/diag_defaults.php" class="navlnk">Factory defaults </a></li>
205
							<li><a href="/halt.php" class="navlnk">Halt system</a></li>
206
							<li><a href="/diag_ping.php" class="navlnk">Ping</a></li>
207
							<li><a href="/reboot.php" class="navlnk">Reboot system</a></li>
208
							<li><a href="/diag_dump_states.php" class="navlnk">States</a></li>
209
							<li><a href="/diag_traceroute.php" class="navlnk">Traceroute</a></li>
210
							<?php echo return_ext_menu("Diagnostics"); ?>
211
							<?php if(isset($config['system']['developer'])): ?>
212
							<li><hr width="80%"/></li>
213
							<li><a href="/restart_httpd.php" class="navlnk">Restart HTTPD</a></li>
214
							<?php endif; ?>
215
						</ul>
216
					</li>
217
				</ul>
218
			</div>
219
		
220
		</div> <!-- Left DIV -->
221
		
222
		<div id="right">
223
	     
224

    
225
<?php
226
	/* display a top alert bar if need be */
227
	$need_alert_display = false;
228
	$found_notices = are_notices_pending();
229
	if($found_notices == true) {
230
		$notices = get_notices();
231
		if(!$notices) {
232
			$need_alert_display = true;
233
			$display_text = print_notices() . "<br>";
234
		}			
235
	}
236
	if($need_alert_display == true) {
237
                echo "<div style=\"background-color:#000000\" id=\"roundalert\">";
238
                echo "<table>";
239
		echo "<tr><td><font color=\"#ffffff\">";
240
		echo "&nbsp;&nbsp;<img align=\"middle\" src=\"/top_notification.gif\">&nbsp;&nbsp;&nbsp;";
241
		echo $display_text;
242
		echo "</td>";
243
		echo "</tr>";
244
		echo "</table>";
245
		echo "</div>";
246
	}
247
	
248
?>
(31-31/155)