summaryrefslogtreecommitdiffstats
path: root/usr/local/www/fbegin.inc
blob: ac769291376a2ff5c29892739cbf544c1b773a47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<?php
require_once("notices.inc");
/* $Id$ */
	function return_ext_menu($section) {
		global $config;
		$htmltext = "";
		if($config['installedpackages']['menu'] <> "") {
			foreach($config['installedpackages']['menu'] as $menuitem) {
				if($menuitem['section'] != $section) continue;
				if($menuitem['url'] <> "") {
					$description = str_replace('$myurl', getenv("HTTP_HOST"), $menuitem['url']);
				} else {
					$description = '/pkg.php?xml=' . $menuitem['configfile'];
				}
				$htmltext .= '<li><a href="' . $description . ' "class="navlnk">' . $menuitem['name'] . '</a></li>' . "\n";
			}
		}
		return $htmltext;
	}




	/* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */
	if ($_REQUEST['noticeaction'] == 'acknowledge') {
		$notice_id = $_REQUEST['noticeid'];
		close_notice($notice_id);
	}
	/**********************************************/
?>

<div id="wrapper">

	<div id="header">
		<div id="header-left"></div>
		<div id="header-right">
			<span class="container">
				<span class="left">webConfigurator</span>
				<span class="right">
<?
				if (are_notices_pending()) {
					$notices = get_notices();
					foreach ($notices as $key => $value) {
						$date = date("m-d-y H:i:s", $key);
						$noticemsg = str_replace("'", "", $value['notice']);
						$noticemsg = str_replace('"', "", $noticemsg);
						$noticemsg = str_replace("\n", "", $noticemsg);
						$noticemsg = str_replace("<p>", "", $noticemsg);
						$noticemsg = str_replace("<pre>", "", $noticemsg);
						$noticemsg = str_replace("</pre>", "", $noticemsg);
						$noticemsg = str_replace("</p>", "", $noticemsg);
						$noticemsg = str_replace("<br>", "", $noticemsg);
						$notice_msgs = '<a href="?noticeaction=acknowledge&noticeid=all">Acknowledge All</a> &nbsp;&nbsp;&nbsp;&nbsp;.:.&nbsp;&nbsp;&nbsp;&nbsp; ';
						if ($value['url']) {
							$notice_msgs .= $date.' - <a href="'.$url.'?noticeaction=acknowledge&noticeid='.$key.'">['.$value['id'].']</a>';
						} else {
							$notice_msgs .= $date.' - <a href="?noticeaction=acknowledge&noticeid='.$key.'">['.$value['id'].']'.$noticemsg.'</a>';
						}
						$notice_msgs .= " &nbsp;&nbsp;&nbsp;&nbsp;.:.&nbsp;&nbsp;&nbsp;&nbsp; ";
					}
?>
					<div id="alerts">
						<script type="text/javascript">
							var content='<div id="marquee-text"><?= $notice_msgs; ?></div>'
						</script>
						<script type="text/javascript" src="/ticker.js"></script>				
					</div>
<?
				} else {
?>
					<div id="hostname">
						<? print $config['system']['hostname'] . "." . $config['system']['domain']; ?>
					</div>
<?
				}
?>
				</span>
			</span>
		</div>
	</div> <!-- Header DIV -->
	<div id="content">
		<div id="left">
			<div id="navigation">
				<ul id="menu">
					<li class="firstdrop">
						<div>System</div>
						<ul class="subdrop">
							<li><a href="/system_advanced.php" class="navlnk">Advanced</a></li>
							<li><a href="/system_firmware_check.php" class="navlnk">Firmware</a></li>
							<li><a href="/system.php" class="navlnk">General Setup</a></li>
						<?php if($g['platform'] == "pfSense"): ?>
							<li><a href="/pkg_mgr.php" class="navlnk">Packages</a></li>
						<?php endif ?>
							<li><a href="/system_routes.php" class="navlnk">Static routes</a></li>
						</ul>
					</li>
					<li class="drop">
						<div>Interfaces</div>
						<ul class="subdrop">
							<?php if (!isset($config['system']['webgui']['noassigninterfaces'])): ?><li><a href="/interfaces_assign.php" class="navlnks">(assign)</a></li><?php endif; ?>
							<li><a href="/interfaces_wan.php" class="navlnk">WAN</a></li>							
							<li><a href="/interfaces_lan.php" class="navlnk">LAN</a></li>
							<?php for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++): if (!isset($config['interfaces']['opt' . $i]['ovpn'])): ?>
							<li><a href="/interfaces_opt.php?index=<?=$i;?>" class="navlnk"><?=htmlspecialchars($config['interfaces']['opt' . $i]['descr']);?></a></li>
							<?php endif; endfor; ?>
							<?php echo return_ext_menu("Interfaces"); ?>							
						</ul>
					</li>
					<li class="drop">
						<div>Firewall</div>
						<ul class="subdrop">
							<li><a href="/firewall_aliases.php" class="navlnk">Aliases</a></li>
							<li><a href="/firewall_nat.php" class="navlnk">NAT</a></li>
							<li><a href="/firewall_rules.php" class="navlnk">Rules</a></li>              
							<li><a href="/firewall_shaper.php" class="navlnk">Traffic Shaper</a></li>
							<li><a href="/firewall_virtual_ip.php" class="navlnk">Virtual IPs</a></li>
							<?php echo return_ext_menu("Firewall"); ?>
						</ul>
					</li>
					<li class="drop">
						<div>Services</div>
						<ul class="subdrop">
							<li><a href="/services_captiveportal.php" class="navlnk">Captive portal</a></li>
							<li><a href="/services_dnsmasq.php" class="navlnk">DNS forwarder</a></li>
							<li><a href="/services_dhcp_relay.php" class="navlnk">DHCP relay</a></li>
							<li><a href="/services_dhcp.php" class="navlnk">DHCP server</a></li>
							<li><a href="/services_dyndns.php" class="navlnk">Dynamic DNS</a></li>
							<li><a href="/load_balancer_pool.php" class="navlnk">Load Balancer</a></li>
							<li><a href="/services_snmp.php" class="navlnk">SNMP</a></li>
							<li><a href="/services_wol.php" class="navlnk">Wake on LAN</a></li>
							<?php echo return_ext_menu("Services"); ?>
						</ul>
					</li>
					<li class="drop">
						<div>VPN</div>
						<ul class="subdrop">
							<li><a href="/vpn_ipsec.php" class="navlnk">IPsec</a></li>
							<li><a href="/vpn_pptp.php" class="navlnk">PPTP</a></li>
							<li><a href="/vpn_pppoe.php" class="navlnk">PPPoE</a></li>
							<?php echo return_ext_menu("VPN"); ?>
						</ul>
					</li>
					<li class="drop">
						<div>Status</div>
						<ul class="subdrop">
							<?php if (isset($config['captiveportal']['enable'])): ?>
							<li><a href="/status_captiveportal.php" class="navlnk">Captive portal</a></li>
							<?php endif; ?>
							<li><a href="/carp_status.php" class="navlnk">CARP (failover)</a></li>		
							<li><a href="/diag_dhcp_leases.php" class="navlnk">DHCP leases</a></li>
							<li><a href="/status_interfaces.php" class="navlnk">Interfaces</a></li>
							<li><a href="/diag_ipsec_sad.php" class="navlnk">IPsec</a></li>
							<?php if($g['platform'] == "pfSense"): ?>
							<li><a href="/diag_pkglogs.php" class="navlnk">Package logs</a></li>
							<?php endif ?>
							<li><a href="/status_queues.php" class="navlnk">Queues</a></li>
							<li><a href="/status_services.php" class="navlnk">Services</a></li>
							<li><a href="/index.php" class="navlnk">System</a></li>
							<li><a href="/diag_logs.php" class="navlnk">System logs</a></li>
							<li><a href="/status_graph.php" class="navlnk">Traffic graph</a></li>
							<?php $i = 0; $ifdescrs = array();
							if (is_array($config['interfaces']['wan']['wireless']) &&
									(strstr($config['interfaces']['wan']['if'], "wi") || strstr($config['interfaces']['wan']['if'], "ath")))
									$ifdescrs['wan'] = 'WAN';
									
							if (is_array($config['interfaces']['lan']['wireless']) &&
									(strstr($config['interfaces']['lan']['if'], "wi") || strstr($config['interfaces']['lan']['if'], "ath")))
									$ifdescrs['lan'] = 'LAN';
							
							for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
								if (is_array($config['interfaces']['opt' . $j]['wireless']) &&
									isset($config['interfaces']['opt' . $j]['enable']) &&
									(strstr($config['interfaces']['opt' . $j]['if'], "wi") || strstr($config['interfaces']['opt' . $j]['if'], "ath")))
									$ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
							}
							if (count($ifdescrs) > 0): ?>	      
							<li><a href="/status_wireless.php" class="navlnk">Wireless</a></li>
							<?php endif; ?>
							<?php echo return_ext_menu("Status"); ?>							
						</ul>
					</li>
					<li class="lastdrop">
						<div>Diagnostics</div>
						<ul id="diag" class="subdrop">
							<li><a href="/diag_backup.php" class="navlnk">Backup/Restore</a></li>
							<li><a href="/exec.php" class="navlnk">Command Prompt</a></li>
							<li><a href="/edit.php" class="navlnk">Edit File</a></li>
							<li><a href="/diag_defaults.php" class="navlnk">Factory defaults </a></li>
							<li><a href="/halt.php" class="navlnk">Halt system</a></li>
							<li><a href="/diag_ping.php" class="navlnk">Ping</a></li>
							<li><a href="/reboot.php" class="navlnk">Reboot system</a></li>
							<li><a href="/diag_dump_states.php" class="navlnk">States</a></li>
							<?php echo return_ext_menu("Diagnostics"); ?>
							<?php if(isset($config['system']['developer'])): ?>
							<li><hr width="80%"/></li>
							<li><a href="/restart_httpd.php" class="navlnk">Restart HTTPD</a></li>
							<?php endif ?>
						</ul>
					</li>
				</ul>
			</div>
		
		</div> <!-- Left DIV -->
		
		<div id="right">
	     

<?php
	/* display a top alert bar if need be */
	$need_alert_display = false;
	$found_notices = are_notices_pending();
	if($found_notices == true) {
		$notices = get_notices();
		if(!$notices) {
			$need_alert_display = true;
			$display_text = print_notices() . "<br>";
		}			
	}
	if($need_alert_display == true) {
                echo "<div style=\"background-color:#000000\" id=\"roundalert\">";
                echo "<table>";
		echo "<tr><td><font color=\"#ffffff\">";
		echo "&nbsp;&nbsp;<img align=\"middle\" src=\"/top_notification.gif\">&nbsp;&nbsp;&nbsp;";
		echo $display_text;
		echo "</td>";
		echo "</tr>";
		echo "</table>";
		echo "</div>";
	}
	
?>
OpenPOWER on IntegriCloud