Project

General

Profile

Download (9.32 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
			<span class="container">
38
				<span class="left">webConfigurator</span>
39
				<span 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
				</span>
78
			</span>
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
							<li><a href="/vpn_pptp.php" class="navlnk">PPTP</a></li>
139
							<li><a href="/vpn_pppoe.php" class="navlnk">PPPoE</a></li>
140
							<?php echo return_ext_menu("VPN"); ?>
141
						</ul>
142
					</li>
143
					<li class="drop">
144
						<div>Status</div>
145
						<ul class="subdrop">
146
							<?php if (isset($config['captiveportal']['enable'])): ?>
147
							<li><a href="/status_captiveportal.php" class="navlnk">Captive portal</a></li>
148
							<?php endif; ?>
149
							<li><a href="/carp_status.php" class="navlnk">CARP (failover)</a></li>		
150
							<li><a href="/diag_dhcp_leases.php" class="navlnk">DHCP leases</a></li>
151
							<li><a href="/status_interfaces.php" class="navlnk">Interfaces</a></li>
152
							<li><a href="/diag_ipsec_sad.php" class="navlnk">IPsec</a></li>
153
							<?php if($g['platform'] == "pfSense"): ?>
154
							<li><a href="/diag_pkglogs.php" class="navlnk">Package logs</a></li>
155
							<?php endif ?>
156
							<li><a href="/status_queues.php" class="navlnk">Queues</a></li>
157
							<li><a href="/status_services.php" class="navlnk">Services</a></li>
158
							<li><a href="/index.php" class="navlnk">System</a></li>
159
							<li><a href="/diag_logs.php" class="navlnk">System logs</a></li>
160
							<li><a href="/status_graph.php" class="navlnk">Traffic graph</a></li>
161
							<?php $i = 0; $ifdescrs = array();
162
							if (is_array($config['interfaces']['wan']['wireless']) &&
163
									(strstr($config['interfaces']['wan']['if'], "wi") || strstr($config['interfaces']['wan']['if'], "ath")))
164
									$ifdescrs['wan'] = 'WAN';
165
									
166
							if (is_array($config['interfaces']['lan']['wireless']) &&
167
									(strstr($config['interfaces']['lan']['if'], "wi") || strstr($config['interfaces']['lan']['if'], "ath")))
168
									$ifdescrs['lan'] = 'LAN';
169
							
170
							for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
171
								if (is_array($config['interfaces']['opt' . $j]['wireless']) &&
172
									isset($config['interfaces']['opt' . $j]['enable']) &&
173
									(strstr($config['interfaces']['opt' . $j]['if'], "wi") || strstr($config['interfaces']['opt' . $j]['if'], "ath")))
174
									$ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
175
							}
176
							if (count($ifdescrs) > 0): ?>	      
177
							<li><a href="/status_wireless.php" class="navlnk">Wireless</a></li>
178
							<?php endif; ?>
179
							<?php echo return_ext_menu("Status"); ?>							
180
						</ul>
181
					</li>
182
					<li class="lastdrop">
183
						<div>Diagnostics</div>
184
						<ul id="diag" class="subdrop">
185
							<li><a href="/diag_backup.php" class="navlnk">Backup/Restore</a></li>
186
							<li><a href="/exec.php" class="navlnk">Command Prompt</a></li>
187
							<li><a href="/edit.php" class="navlnk">Edit File</a></li>
188
							<li><a href="/diag_defaults.php" class="navlnk">Factory defaults </a></li>
189
							<li><a href="/halt.php" class="navlnk">Halt system</a></li>
190
							<li><a href="/diag_ping.php" class="navlnk">Ping</a></li>
191
							<li><a href="/reboot.php" class="navlnk">Reboot system</a></li>
192
							<li><a href="/diag_dump_states.php" class="navlnk">States</a></li>
193
							<?php echo return_ext_menu("Diagnostics"); ?>
194
							<?php if(isset($config['system']['developer'])): ?>
195
							<li><hr width="80%"/></li>
196
							<li><a href="/restart_httpd.php" class="navlnk">Restart HTTPD</a></li>
197
							<?php endif ?>
198
						</ul>
199
					</li>
200
				</ul>
201
			</div>
202
		
203
		</div> <!-- Left DIV -->
204
		
205
		<div id="right">
206
	     
207

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