1 |
c6c150e9
|
Scott Ullrich
|
<?php
|
2 |
cc6bafe0
|
Scott Ullrich
|
require_once("notices.inc");
|
3 |
b46bfcf5
|
Bill Marquette
|
/* $Id$ */
|
4 |
859329c8
|
Scott Ullrich
|
function return_ext_menu($section) {
|
5 |
90e3bbc0
|
Colin Smith
|
global $config;
|
6 |
c6c150e9
|
Scott Ullrich
|
$htmltext = "";
|
7 |
90e3bbc0
|
Colin Smith
|
if($config['installedpackages']['menu'] <> "") {
|
8 |
|
|
foreach($config['installedpackages']['menu'] as $menuitem) {
|
9 |
|
|
if($menuitem['section'] != $section) continue;
|
10 |
|
|
if($menuitem['url'] <> "") {
|
11 |
2acda758
|
Colin Smith
|
$description = str_replace('$myurl', getenv("HTTP_HOST"), $menuitem['url']);
|
12 |
90e3bbc0
|
Colin Smith
|
} else {
|
13 |
|
|
$description = '/pkg.php?xml=' . $menuitem['configfile'];
|
14 |
|
|
}
|
15 |
9f53d3a8
|
Scott Ullrich
|
$htmltext .= '<li><a href="' . $description . ' "class="navlnk">' . $menuitem['name'] . '</a></li>' . "\n";
|
16 |
c6c150e9
|
Scott Ullrich
|
}
|
17 |
|
|
}
|
18 |
|
|
return $htmltext;
|
19 |
|
|
}
|
20 |
65384707
|
Erik Kristensen
|
|
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 |
c6c150e9
|
Scott Ullrich
|
?>
|
31 |
12a00813
|
Erik Kristensen
|
|
32 |
9f53d3a8
|
Scott Ullrich
|
<div id="wrapper">
|
33 |
|
|
|
34 |
|
|
<div id="header">
|
35 |
|
|
<div id="header-left"></div>
|
36 |
|
|
<div id="header-right">
|
37 |
1df0159c
|
Erik Kristensen
|
<div class="container">
|
38 |
|
|
<div class="left">webConfigurator</div>
|
39 |
|
|
<div class="right">
|
40 |
64fcbfc8
|
Erik Kristensen
|
<?
|
41 |
b1cbbf24
|
Erik Kristensen
|
if (are_notices_pending()) {
|
42 |
|
|
$notices = get_notices();
|
43 |
|
|
foreach ($notices as $key => $value) {
|
44 |
b8a3e66f
|
Erik Kristensen
|
$date = date("m-d-y H:i:s", $key);
|
45 |
53c4e9aa
|
Erik Kristensen
|
$noticemsg = str_replace("'", "", $value['notice']);
|
46 |
|
|
$noticemsg = str_replace('"', "", $noticemsg);
|
47 |
|
|
$noticemsg = str_replace("\n", "", $noticemsg);
|
48 |
523d8cca
|
Erik Kristensen
|
$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 |
612832ec
|
Erik Kristensen
|
$notice_msgs = '<a href="?noticeaction=acknowledge¬iceid=all">Acknowledge All</a> .:. ';
|
54 |
b1cbbf24
|
Erik Kristensen
|
if ($value['url']) {
|
55 |
65384707
|
Erik Kristensen
|
$notice_msgs .= $date.' - <a href="'.$url.'?noticeaction=acknowledge¬iceid='.$key.'">['.$value['id'].']</a>';
|
56 |
b1cbbf24
|
Erik Kristensen
|
} else {
|
57 |
53c4e9aa
|
Erik Kristensen
|
$notice_msgs .= $date.' - <a href="?noticeaction=acknowledge¬iceid='.$key.'">['.$value['id'].']'.$noticemsg.'</a>';
|
58 |
b1cbbf24
|
Erik Kristensen
|
}
|
59 |
|
|
$notice_msgs .= " .:. ";
|
60 |
|
|
}
|
61 |
64fcbfc8
|
Erik Kristensen
|
?>
|
62 |
b1cbbf24
|
Erik Kristensen
|
<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 |
612832ec
|
Erik Kristensen
|
?>
|
71 |
|
|
<div id="hostname">
|
72 |
|
|
<? print $config['system']['hostname'] . "." . $config['system']['domain']; ?>
|
73 |
|
|
</div>
|
74 |
|
|
<?
|
75 |
b1cbbf24
|
Erik Kristensen
|
}
|
76 |
|
|
?>
|
77 |
1df0159c
|
Erik Kristensen
|
</div>
|
78 |
|
|
</div>
|
79 |
9f53d3a8
|
Scott Ullrich
|
</div>
|
80 |
|
|
</div> <!-- Header DIV -->
|
81 |
|
|
<div id="content">
|
82 |
|
|
<div id="left">
|
83 |
|
|
<div id="navigation">
|
84 |
41058a8c
|
Erik Kristensen
|
<ul id="menu">
|
85 |
d86286ed
|
Erik Kristensen
|
<li class="firstdrop">
|
86 |
9f53d3a8
|
Scott Ullrich
|
<div>System</div>
|
87 |
d86286ed
|
Erik Kristensen
|
<ul class="subdrop">
|
88 |
9f53d3a8
|
Scott Ullrich
|
<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 |
556ed559
|
Erik Kristensen
|
<li><a href="/system.php" class="navlnk">General Setup</a></li>
|
91 |
65bad23b
|
Scott Ullrich
|
<?php if($g['platform'] == "pfSense"): ?>
|
92 |
9f53d3a8
|
Scott Ullrich
|
<li><a href="/pkg_mgr.php" class="navlnk">Packages</a></li>
|
93 |
65bad23b
|
Scott Ullrich
|
<?php endif ?>
|
94 |
9f53d3a8
|
Scott Ullrich
|
<li><a href="/system_routes.php" class="navlnk">Static routes</a></li>
|
95 |
|
|
</ul>
|
96 |
|
|
</li>
|
97 |
d86286ed
|
Erik Kristensen
|
<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 |
9f53d3a8
|
Scott Ullrich
|
<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 |
d86286ed
|
Erik Kristensen
|
<li class="drop">
|
110 |
9f53d3a8
|
Scott Ullrich
|
<div>Firewall</div>
|
111 |
d86286ed
|
Erik Kristensen
|
<ul class="subdrop">
|
112 |
9f53d3a8
|
Scott Ullrich
|
<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 |
d86286ed
|
Erik Kristensen
|
<li class="drop">
|
121 |
9f53d3a8
|
Scott Ullrich
|
<div>Services</div>
|
122 |
d86286ed
|
Erik Kristensen
|
<ul class="subdrop">
|
123 |
9f53d3a8
|
Scott Ullrich
|
<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 |
7fb2f3f7
|
Bill Marquette
|
<li><a href="/load_balancer_pool.php" class="navlnk">Load Balancer</a></li>
|
129 |
9f53d3a8
|
Scott Ullrich
|
<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 |
d86286ed
|
Erik Kristensen
|
<li class="drop">
|
135 |
9f53d3a8
|
Scott Ullrich
|
<div>VPN</div>
|
136 |
d86286ed
|
Erik Kristensen
|
<ul class="subdrop">
|
137 |
9f53d3a8
|
Scott Ullrich
|
<li><a href="/vpn_ipsec.php" class="navlnk">IPsec</a></li>
|
138 |
51383570
|
Scott Ullrich
|
<?php
|
139 |
|
|
if(isset($config['system']['developer'])) {
|
140 |
|
|
echo "<li><a href=\"/vpn_openvpn.php\" class=\"navlnk\">OpenVPN</a></li>";
|
141 |
|
|
}
|
142 |
|
|
?>
|
143 |
9f53d3a8
|
Scott Ullrich
|
<li><a href="/vpn_pptp.php" class="navlnk">PPTP</a></li>
|
144 |
27031702
|
Scott Ullrich
|
<li><a href="/vpn_pppoe.php" class="navlnk">PPPoE</a></li>
|
145 |
9f53d3a8
|
Scott Ullrich
|
<?php echo return_ext_menu("VPN"); ?>
|
146 |
|
|
</ul>
|
147 |
|
|
</li>
|
148 |
d86286ed
|
Erik Kristensen
|
<li class="drop">
|
149 |
9f53d3a8
|
Scott Ullrich
|
<div>Status</div>
|
150 |
d86286ed
|
Erik Kristensen
|
<ul class="subdrop">
|
151 |
9f53d3a8
|
Scott Ullrich
|
<?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 |
50ff5462
|
Scott Ullrich
|
<?php if($g['platform'] == "pfSense"): ?>
|
159 |
9f53d3a8
|
Scott Ullrich
|
<li><a href="/diag_pkglogs.php" class="navlnk">Package logs</a></li>
|
160 |
50ff5462
|
Scott Ullrich
|
<?php endif ?>
|
161 |
9f53d3a8
|
Scott Ullrich
|
<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 |
187be289
|
Scott Ullrich
|
preg_match($g['wireless_regex'], $config['interfaces']['wan']['if']))
|
169 |
|
|
$ifdescrs['wan'] = 'WAN';
|
170 |
9f53d3a8
|
Scott Ullrich
|
if (is_array($config['interfaces']['lan']['wireless']) &&
|
171 |
4776ee17
|
Scott Ullrich
|
preg_match($g['wireless_regex'], $config['interfaces']['lan']['if']))
|
172 |
9f53d3a8
|
Scott Ullrich
|
$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 |
4776ee17
|
Scott Ullrich
|
preg_match($g['wireless_regex'], $config['interfaces']['opt' . $j]['if']))
|
177 |
|
|
$ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
|
178 |
9f53d3a8
|
Scott Ullrich
|
}
|
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 |
d86286ed
|
Erik Kristensen
|
<li class="lastdrop">
|
186 |
9f53d3a8
|
Scott Ullrich
|
<div>Diagnostics</div>
|
187 |
d86286ed
|
Erik Kristensen
|
<ul id="diag" class="subdrop">
|
188 |
a921dafa
|
Scott Ullrich
|
<li><a href="/diag_arp.php" class="navlnk">ARP Tables</a></li>
|
189 |
9f53d3a8
|
Scott Ullrich
|
<li><a href="/diag_backup.php" class="navlnk">Backup/Restore</a></li>
|
190 |
|
|
<li><a href="/exec.php" class="navlnk">Command Prompt</a></li>
|
191 |
|
|
<li><a href="/edit.php" class="navlnk">Edit File</a></li>
|
192 |
|
|
<li><a href="/diag_defaults.php" class="navlnk">Factory defaults </a></li>
|
193 |
|
|
<li><a href="/halt.php" class="navlnk">Halt system</a></li>
|
194 |
|
|
<li><a href="/diag_ping.php" class="navlnk">Ping</a></li>
|
195 |
|
|
<li><a href="/reboot.php" class="navlnk">Reboot system</a></li>
|
196 |
|
|
<li><a href="/diag_dump_states.php" class="navlnk">States</a></li>
|
197 |
a921dafa
|
Scott Ullrich
|
<li><a href="/diag_traceroute.php" class="navlnk">Traceroute</a></li>
|
198 |
9f53d3a8
|
Scott Ullrich
|
<?php echo return_ext_menu("Diagnostics"); ?>
|
199 |
3a078222
|
Erik Kristensen
|
<?php if(isset($config['system']['developer'])): ?>
|
200 |
|
|
<li><hr width="80%"/></li>
|
201 |
|
|
<li><a href="/restart_httpd.php" class="navlnk">Restart HTTPD</a></li>
|
202 |
|
|
<?php endif ?>
|
203 |
9f53d3a8
|
Scott Ullrich
|
</ul>
|
204 |
|
|
</li>
|
205 |
|
|
</ul>
|
206 |
|
|
</div>
|
207 |
85eb07c3
|
Scott Ullrich
|
|
208 |
9f53d3a8
|
Scott Ullrich
|
</div> <!-- Left DIV -->
|
209 |
|
|
|
210 |
|
|
<div id="right">
|
211 |
|
|
|
212 |
5c9cc1de
|
Scott Ullrich
|
|
213 |
|
|
<?php
|
214 |
|
|
/* display a top alert bar if need be */
|
215 |
|
|
$need_alert_display = false;
|
216 |
|
|
$found_notices = are_notices_pending();
|
217 |
|
|
if($found_notices == true) {
|
218 |
|
|
$notices = get_notices();
|
219 |
|
|
if(!$notices) {
|
220 |
|
|
$need_alert_display = true;
|
221 |
e444cd01
|
Scott Ullrich
|
$display_text = print_notices() . "<br>";
|
222 |
5c9cc1de
|
Scott Ullrich
|
}
|
223 |
|
|
}
|
224 |
|
|
if($need_alert_display == true) {
|
225 |
|
|
echo "<div style=\"background-color:#000000\" id=\"roundalert\">";
|
226 |
|
|
echo "<table>";
|
227 |
|
|
echo "<tr><td><font color=\"#ffffff\">";
|
228 |
|
|
echo " <img align=\"middle\" src=\"/top_notification.gif\"> ";
|
229 |
|
|
echo $display_text;
|
230 |
|
|
echo "</td>";
|
231 |
|
|
echo "</tr>";
|
232 |
|
|
echo "</table>";
|
233 |
|
|
echo "</div>";
|
234 |
|
|
}
|
235 |
|
|
|
236 |
1425e067
|
Bill Marquette
|
?>
|