Project

General

Profile

Download (9.82 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"></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_check.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="/system_routes.php" class="navlnk">Static routes</a></li>
106
						</ul>
107
					</li>
108
					<li class="drop">
109
						<div>Interfaces</div>
110
						<ul class="subdrop">
111
							<?php if (!isset($config['system']['webgui']['noassigninterfaces'])): ?><li><a href="/interfaces_assign.php" class="navlnks">(assign)</a></li><?php endif; ?>
112
							<li><a href="/interfaces_wan.php" class="navlnk">WAN</a></li>							
113
							<li><a href="/interfaces_lan.php" class="navlnk">LAN</a></li>
114
							<?php for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++): if (!isset($config['interfaces']['opt' . $i]['ovpn'])): ?>
115
							<li><a href="/interfaces_opt.php?index=<?=$i;?>" class="navlnk"><?=htmlspecialchars($config['interfaces']['opt' . $i]['descr']);?></a></li>
116
							<?php endif; endfor; ?>
117
							<?php echo return_ext_menu("Interfaces"); ?>							
118
						</ul>
119
					</li>
120
					<li class="drop">
121
						<div>Firewall</div>
122
						<ul class="subdrop">
123
							<li><a href="/firewall_aliases.php" class="navlnk">Aliases</a></li>
124
							<li><a href="/firewall_nat.php" class="navlnk">NAT</a></li>
125
							<li><a href="/firewall_rules.php" class="navlnk">Rules</a></li>              
126
							<li><a href="/firewall_shaper.php" class="navlnk">Traffic Shaper</a></li>
127
							<li><a href="/firewall_virtual_ip.php" class="navlnk">Virtual IPs</a></li>
128
							<?php echo return_ext_menu("Firewall"); ?>
129
						</ul>
130
					</li>
131
					<li class="drop">
132
						<div>Services</div>
133
						<ul class="subdrop">
134
							<li><a href="/services_captiveportal.php" class="navlnk">Captive portal</a></li>
135
							<li><a href="/services_dnsmasq.php" class="navlnk">DNS forwarder</a></li>
136
							<li><a href="/services_dhcp_relay.php" class="navlnk">DHCP relay</a></li>
137
							<li><a href="/services_dhcp.php" class="navlnk">DHCP server</a></li>
138
							<li><a href="/services_dyndns.php" class="navlnk">Dynamic DNS</a></li>
139
							<li><a href="/load_balancer_pool.php" class="navlnk">Load Balancer</a></li>
140
							<li><a href="/services_snmp.php" class="navlnk">SNMP</a></li>
141
							<li><a href="/services_wol.php" class="navlnk">Wake on LAN</a></li>
142
							<?php echo return_ext_menu("Services"); ?>
143
						</ul>
144
					</li>
145
					<li class="drop">
146
						<div>VPN</div>
147
						<ul class="subdrop">
148
							<li><a href="/vpn_ipsec.php" class="navlnk">IPsec</a></li>
149
							<?php
150
								if(isset($config['system']['developer'])) {
151
									echo "<li><a href=\"/vpn_openvpn.php\" class=\"navlnk\">OpenVPN</a></li>";
152
								}
153
							?>
154
							<li><a href="/vpn_pptp.php" class="navlnk">PPTP</a></li>
155
							<li><a href="/vpn_pppoe.php" class="navlnk">PPPoE</a></li>
156
							<?php echo return_ext_menu("VPN"); ?>
157
						</ul>
158
					</li>
159
					<li class="drop">
160
						<div>Status</div>
161
						<ul class="subdrop">
162
							<?php if (isset($config['captiveportal']['enable'])): ?>
163
							<li><a href="/status_captiveportal.php" class="navlnk">Captive portal</a></li>
164
							<?php endif; ?>
165
							<li><a href="/carp_status.php" class="navlnk">CARP (failover)</a></li>		
166
							<li><a href="/diag_dhcp_leases.php" class="navlnk">DHCP leases</a></li>
167
							<li><a href="/status_interfaces.php" class="navlnk">Interfaces</a></li>
168
							<li><a href="/diag_ipsec_sad.php" class="navlnk">IPsec</a></li>
169
							<?php if($g['platform'] == "pfSense"): ?>
170
							<li><a href="/diag_pkglogs.php" class="navlnk">Package logs</a></li>
171
							<?php endif ?>
172
							<li><a href="/status_queues.php" class="navlnk">Queues</a></li>
173
							<li><a href="/status_services.php" class="navlnk">Services</a></li>
174
							<li><a href="/index.php" class="navlnk">System</a></li>
175
							<li><a href="/diag_logs.php" class="navlnk">System logs</a></li>
176
							<li><a href="/status_graph.php" class="navlnk">Traffic graph</a></li>
177
							<?php $i = 0; $ifdescrs = array();
178
							if (is_array($config['interfaces']['wan']['wireless']) &&
179
								preg_match($g['wireless_regex'], $config['interfaces']['wan']['if']))
180
									$ifdescrs['wan'] = 'WAN';									
181
							if (is_array($config['interfaces']['lan']['wireless']) &&
182
								preg_match($g['wireless_regex'], $config['interfaces']['lan']['if']))
183
									$ifdescrs['lan'] = 'LAN';
184
							for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
185
								if (is_array($config['interfaces']['opt' . $j]['wireless']) &&
186
									isset($config['interfaces']['opt' . $j]['enable']) &&
187
									 preg_match($g['wireless_regex'], $config['interfaces']['opt' . $j]['if']))
188
										$ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
189
							}
190
							if (count($ifdescrs) > 0): ?>	      
191
							<li><a href="/status_wireless.php" class="navlnk">Wireless</a></li>
192
							<?php endif; ?>
193
							<?php echo return_ext_menu("Status"); ?>							
194
						</ul>
195
					</li>
196
					<li class="lastdrop">
197
						<div>Diagnostics</div>
198
						<ul id="diag" class="subdrop">
199
							<li><a href="/diag_arp.php" class="navlnk">ARP Tables</a></li>
200
							<li><a href="/diag_backup.php" class="navlnk">Backup/Restore</a></li>
201
							<li><a href="/exec.php" class="navlnk">Command Prompt</a></li>
202
							<li><a href="/edit.php" class="navlnk">Edit File</a></li>
203
							<li><a href="/diag_defaults.php" class="navlnk">Factory defaults </a></li>
204
							<li><a href="/halt.php" class="navlnk">Halt system</a></li>
205
							<li><a href="/diag_ping.php" class="navlnk">Ping</a></li>
206
							<li><a href="/reboot.php" class="navlnk">Reboot system</a></li>
207
							<li><a href="/diag_dump_states.php" class="navlnk">States</a></li>
208
							<li><a href="/diag_traceroute.php" class="navlnk">Traceroute</a></li>
209
							<?php echo return_ext_menu("Diagnostics"); ?>
210
							<?php if(isset($config['system']['developer'])): ?>
211
							<li><hr width="80%"/></li>
212
							<li><a href="/restart_httpd.php" class="navlnk">Restart HTTPD</a></li>
213
							<?php endif ?>
214
						</ul>
215
					</li>
216
				</ul>
217
			</div>
218
		
219
		</div> <!-- Left DIV -->
220
		
221
		<div id="right">
222
	     
223

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