Project

General

Profile

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

    
211
<?php
212
	/* display a top alert bar if need be */
213
	$need_alert_display = false;
214
	$found_notices = are_notices_pending();
215
	if($found_notices == true) {
216
		$notices = get_notices();
217
		if(!$notices) {
218
			$need_alert_display = true;
219
			$display_text = print_notices() . "<br>";
220
		}			
221
	}
222
	if($need_alert_display == true) {
223
                echo "<div style=\"background-color:#000000\" id=\"roundalert\">";
224
                echo "<table>";
225
		echo "<tr><td><font color=\"#ffffff\">";
226
		echo "&nbsp;&nbsp;<img align=\"middle\" src=\"/top_notification.gif\">&nbsp;&nbsp;&nbsp;";
227
		echo $display_text;
228
		echo "</td>";
229
		echo "</tr>";
230
		echo "</table>";
231
		echo "</div>";
232
	}
233
	
234
?>
(29-29/144)