1 |
56c100ab
|
Erik Fonnesbeck
|
<?php
|
2 |
c5d81585
|
Renato Botelho
|
/*
|
3 |
|
|
* head.inc
|
4 |
d7218f77
|
Stephen Beaver
|
*
|
5 |
c5d81585
|
Renato Botelho
|
* part of pfSense (https://www.pfsense.org)
|
6 |
38809d47
|
Renato Botelho do Couto
|
* Copyright (c) 2004-2013 BSD Perimeter
|
7 |
|
|
* Copyright (c) 2013-2016 Electric Sheep Fencing
|
8 |
402c98a2
|
Reid Linnemann
|
* Copyright (c) 2014-2023 Rubicon Communications, LLC (Netgate)
|
9 |
c5d81585
|
Renato Botelho
|
* All rights reserved.
|
10 |
d7218f77
|
Stephen Beaver
|
*
|
11 |
b12ea3fb
|
Renato Botelho
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
12 |
|
|
* you may not use this file except in compliance with the License.
|
13 |
|
|
* You may obtain a copy of the License at
|
14 |
d7218f77
|
Stephen Beaver
|
*
|
15 |
b12ea3fb
|
Renato Botelho
|
* http://www.apache.org/licenses/LICENSE-2.0
|
16 |
d7218f77
|
Stephen Beaver
|
*
|
17 |
b12ea3fb
|
Renato Botelho
|
* Unless required by applicable law or agreed to in writing, software
|
18 |
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
19 |
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
20 |
|
|
* See the License for the specific language governing permissions and
|
21 |
|
|
* limitations under the License.
|
22 |
d7218f77
|
Stephen Beaver
|
*/
|
23 |
888c3c1b
|
Stephen Beaver
|
|
24 |
31f03b6c
|
Sjon Hortensius
|
require_once("globals.inc");
|
25 |
|
|
require_once("functions.inc");
|
26 |
|
|
require_once("shortcuts.inc");
|
27 |
|
|
require_once("service-utils.inc");
|
28 |
8d3f3e34
|
Stephen Beaver
|
require_once('notices.inc');
|
29 |
31f03b6c
|
Sjon Hortensius
|
|
30 |
9801e938
|
Sjon Hortensius
|
header('Content-Type: text/html; charset=utf-8');
|
31 |
|
|
|
32 |
ecffb0bb
|
Phil Davis
|
$pagetitle = gentitle($pgtitle);
|
33 |
8ad8e9ab
|
Phil Davis
|
$system_url = $config['system']['hostname'] . "." . $config['system']['domain'];
|
34 |
56c100ab
|
Erik Fonnesbeck
|
|
35 |
8bab524e
|
Phil Davis
|
if ($user_settings['webgui']['pagenamefirst']) {
|
36 |
8ad8e9ab
|
Phil Davis
|
$tabtitle = $pagetitle . " - " . htmlspecialchars($system_url);
|
37 |
e259607f
|
Thane Gill
|
} else {
|
38 |
8ad8e9ab
|
Phil Davis
|
$tabtitle = htmlspecialchars($system_url) . " - " . $pagetitle;
|
39 |
e259607f
|
Thane Gill
|
}
|
40 |
60571782
|
Stephen Beaver
|
|
41 |
9d1be24e
|
Jared Dillard
|
$cssfile = "/css/pfSense.css";
|
42 |
60571782
|
Stephen Beaver
|
|
43 |
8bab524e
|
Phil Davis
|
if (isset($user_settings['webgui']['webguicss'])) {
|
44 |
|
|
if (file_exists("/usr/local/www/css/" . $user_settings['webgui']['webguicss'])) {
|
45 |
|
|
$cssfile = "/css/" . $user_settings['webgui']['webguicss'];
|
46 |
60571782
|
Stephen Beaver
|
}
|
47 |
|
|
}
|
48 |
|
|
|
49 |
e6367325
|
Phil Davis
|
// set default columns to two if unset
|
50 |
aa82505e
|
Phil Davis
|
if (!isset($config['system']['webgui']['dashboardcolumns'])) {
|
51 |
477db933
|
Jared Dillard
|
$config['system']['webgui']['dashboardcolumns'] = 2;
|
52 |
|
|
}
|
53 |
|
|
|
54 |
56c100ab
|
Erik Fonnesbeck
|
?>
|
55 |
1180e4f0
|
Sjon Hortensius
|
<!DOCTYPE html>
|
56 |
|
|
<html lang="en">
|
57 |
56c100ab
|
Erik Fonnesbeck
|
<head>
|
58 |
d41aeafc
|
Stephen Beaver
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
59 |
e7d63f56
|
Jared Dillard
|
|
60 |
6620d630
|
Steve Beaver
|
<link rel="apple-touch-icon-precomposed" href="/apple-touch/apple-touch-icon-iphone-60x60-precomposed.png">
|
61 |
|
|
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="/apple-touch/apple-touch-icon-ipad-76x76-precomposed.png">
|
62 |
|
|
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/apple-touch/apple-touch-icon-iphone-retina-120x120-precomposed.png">
|
63 |
|
|
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch/apple-touch-icon-ipad-retina-152x152-precomposed.png">
|
64 |
e7d63f56
|
Jared Dillard
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
65 |
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
66 |
|
|
<link rel="manifest" href="/manifest.json">
|
67 |
|
|
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
|
68 |
|
|
<meta name="theme-color" content="#ffffff">
|
69 |
|
|
|
70 |
fb435045
|
Jared Dillard
|
<link rel="stylesheet" href="/vendor/font-awesome/css/all.min.css?v=<?=filemtime('/usr/local/www/vendor/font-awesome/css/all.min.css')?>">
|
71 |
|
|
<link rel="stylesheet" href="/vendor/font-awesome/css/v4-shims.css?v=<?=filemtime('/usr/local/www/vendor/font-awesome/css/v4-shims.css')?>">
|
72 |
09ba8bb7
|
Steve Beaver
|
<link rel="stylesheet" href="/vendor/sortable/sortable-theme-bootstrap.css?v=<?=filemtime('/usr/local/www/vendor/sortable/sortable-theme-bootstrap.css')?>">
|
73 |
775e9055
|
Christian McDonald
|
<link rel="stylesheet" href="/vendor/jquery-treegrid/css/jquery.treegrid.css?v=<?=filemtime('/usr/local/www/vendor/jquery-treegrid/css/jquery.treegrid.css')?>">
|
74 |
09ba8bb7
|
Steve Beaver
|
<link rel="stylesheet" href="<?=$cssfile?>?v=<?=filemtime('/usr/local/www/' . $cssfile)?>" />
|
75 |
|
|
|
76 |
e259607f
|
Thane Gill
|
<title><?=$tabtitle?></title>
|
77 |
8fd9052f
|
Colin Fleming
|
<script type="text/javascript">
|
78 |
|
|
//<![CDATA[
|
79 |
|
|
var events = events || [];
|
80 |
|
|
//]]>
|
81 |
|
|
</script>
|
82 |
1180e4f0
|
Sjon Hortensius
|
</head>
|
83 |
8d3f3e34
|
Stephen Beaver
|
|
84 |
31f03b6c
|
Sjon Hortensius
|
<?php
|
85 |
|
|
|
86 |
e259607f
|
Thane Gill
|
/* Determine automated help URL. Should output the page name and parameters
|
87 |
|
|
separately */
|
88 |
31f03b6c
|
Sjon Hortensius
|
$uri_split = "";
|
89 |
|
|
preg_match("/\/(.*)\?(.*)/", $_SERVER["REQUEST_URI"], $uri_split);
|
90 |
|
|
|
91 |
|
|
/* If there was no match, there were no parameters, just grab the filename
|
92 |
|
|
Otherwise, use the matched filename from above. */
|
93 |
|
|
if (empty($uri_split[0])) {
|
94 |
|
|
$pagename = ltrim($_SERVER["REQUEST_URI"], '/');
|
95 |
|
|
} else {
|
96 |
|
|
$pagename = $uri_split[1];
|
97 |
|
|
}
|
98 |
239b5161
|
Stephen Beaver
|
|
99 |
31f03b6c
|
Sjon Hortensius
|
/* If the page name is still empty, the user must have requested / (index.php) */
|
100 |
|
|
if (empty($pagename)) {
|
101 |
|
|
$pagename = "index.php";
|
102 |
|
|
}
|
103 |
|
|
|
104 |
|
|
/* If the filename is pkg_edit.php or wizard.php, reparse looking
|
105 |
|
|
for the .xml filename */
|
106 |
|
|
if (($pagename == "pkg.php") || ($pagename == "pkg_edit.php") || ($pagename == "wizard.php")) {
|
107 |
|
|
$param_split = explode('&', $uri_split[2]);
|
108 |
|
|
foreach ($param_split as $param) {
|
109 |
|
|
if (substr($param, 0, 4) == "xml=") {
|
110 |
|
|
$xmlfile = explode('=', $param);
|
111 |
|
|
$pagename = $xmlfile[1];
|
112 |
|
|
}
|
113 |
|
|
}
|
114 |
f11871ca
|
Phil Davis
|
} else if ($pagename == "status_logs.php") {
|
115 |
|
|
$param_split = explode('&', $uri_split[2]);
|
116 |
|
|
foreach ($param_split as $param) {
|
117 |
|
|
if (substr($param, 0, 8) == "logfile=") {
|
118 |
|
|
$logtype = explode('=', $param);
|
119 |
|
|
$pagename .= '-' . $logtype[1];
|
120 |
|
|
}
|
121 |
|
|
}
|
122 |
31f03b6c
|
Sjon Hortensius
|
}
|
123 |
|
|
|
124 |
567d7fd6
|
Stephen Beaver
|
// Build the full help URL.
|
125 |
31f03b6c
|
Sjon Hortensius
|
$helpurl .= "{$g['help_base_url']}?page={$pagename}";
|
126 |
|
|
|
127 |
909a1954
|
Renato Botelho
|
/*
|
128 |
|
|
* Read files from $g['ext_menu_path']/*.xml and fill an array with menu info
|
129 |
|
|
*/
|
130 |
|
|
function read_ext_menu_path_data() {
|
131 |
|
|
global $g;
|
132 |
|
|
|
133 |
|
|
$result = array();
|
134 |
|
|
|
135 |
2568e151
|
Christian McDonald
|
if (!is_dir(g_get('ext_menu_path'))) {
|
136 |
909a1954
|
Renato Botelho
|
return $result;
|
137 |
|
|
}
|
138 |
|
|
|
139 |
|
|
foreach (glob("{$g['ext_menu_path']}/*.xml") as $menu_xml) {
|
140 |
|
|
$xml_data = parse_xml_config_pkg($menu_xml, "packagegui");
|
141 |
|
|
if (empty($xml_data['menu'])) {
|
142 |
|
|
continue;
|
143 |
|
|
}
|
144 |
|
|
foreach ($xml_data['menu'] as $menu) {
|
145 |
|
|
$result[] = $menu;
|
146 |
|
|
}
|
147 |
|
|
}
|
148 |
|
|
|
149 |
|
|
return $result;
|
150 |
|
|
}
|
151 |
|
|
|
152 |
567d7fd6
|
Stephen Beaver
|
// Create a menu entry of any installed packages in the specified category
|
153 |
|
|
// (Now reads the menu information from $config['installedpackages']['menu'] only)
|
154 |
31f03b6c
|
Sjon Hortensius
|
function return_ext_menu($section) {
|
155 |
909a1954
|
Renato Botelho
|
global $config, $ext_menu_path_data;
|
156 |
da4a4b9f
|
Stephen Beaver
|
|
157 |
31f03b6c
|
Sjon Hortensius
|
$htmltext = "";
|
158 |
|
|
$extarray = array();
|
159 |
909a1954
|
Renato Botelho
|
$ext_menu_entries = array();
|
160 |
da4a4b9f
|
Stephen Beaver
|
|
161 |
aa82505e
|
Phil Davis
|
if ((!empty($config['installedpackages']['package'])) && (!empty($config['installedpackages']['menu']))) {
|
162 |
567d7fd6
|
Stephen Beaver
|
foreach ($config['installedpackages']['menu'] as $menu) {
|
163 |
b88050bb
|
jim-p
|
if (isset($menu['name']) && ($menu['name'] != "AutoConfigBackup")) { // AutoConfigBackup was moved to a built-in function
|
164 |
245bfa55
|
Steve Beaver
|
// print('Name: ' . $menu['name'] . ', Pkg category: ' . $menu['category'] . ', Section: ' . $section . '<br />');
|
165 |
b88050bb
|
jim-p
|
if (isset($menu['section']) && ($menu['section'] == $section)) {
|
166 |
245bfa55
|
Steve Beaver
|
$ext_menu_entries[] = $menu;
|
167 |
|
|
}
|
168 |
e259607f
|
Thane Gill
|
}
|
169 |
909a1954
|
Renato Botelho
|
}
|
170 |
|
|
}
|
171 |
|
|
|
172 |
|
|
foreach ($ext_menu_path_data as $menu) {
|
173 |
|
|
if ($menu['section'] == $section) {
|
174 |
|
|
$ext_menu_entries[] = $menu;
|
175 |
|
|
}
|
176 |
|
|
}
|
177 |
|
|
|
178 |
|
|
foreach ($ext_menu_entries as $menu) {
|
179 |
|
|
if ($menu['url'] != "") {
|
180 |
|
|
$test_url = $menu['url'];
|
181 |
|
|
$addresswithport = getenv("HTTP_HOST");
|
182 |
|
|
$colonpos = strpos($addresswithport, ":");
|
183 |
da4a4b9f
|
Stephen Beaver
|
|
184 |
909a1954
|
Renato Botelho
|
if ($colonpos !== false) {
|
185 |
|
|
//my url is actually just the IP address of the pfsense box
|
186 |
|
|
$myurl = substr($addresswithport, 0, $colonpos);
|
187 |
31f03b6c
|
Sjon Hortensius
|
} else {
|
188 |
909a1954
|
Renato Botelho
|
$myurl = $addresswithport;
|
189 |
31f03b6c
|
Sjon Hortensius
|
}
|
190 |
909a1954
|
Renato Botelho
|
$description = str_replace('$myurl', $myurl, $menu['url']);
|
191 |
|
|
} else {
|
192 |
|
|
$description = '/pkg.php?xml=' . $menu['configfile'];
|
193 |
|
|
$test_url=$description;
|
194 |
|
|
}
|
195 |
da4a4b9f
|
Stephen Beaver
|
|
196 |
909a1954
|
Renato Botelho
|
if (isAllowedPage($test_url)) {
|
197 |
|
|
$extarray[] = array($menu['name'], $description);
|
198 |
31f03b6c
|
Sjon Hortensius
|
}
|
199 |
|
|
}
|
200 |
567d7fd6
|
Stephen Beaver
|
|
201 |
31f03b6c
|
Sjon Hortensius
|
return $extarray;
|
202 |
|
|
}
|
203 |
|
|
|
204 |
8559c9d9
|
jim-p
|
function output_menu($arrayitem, $target = null, $section = "") {
|
205 |
7c3f1189
|
Phil Davis
|
$output = "";
|
206 |
|
|
|
207 |
31f03b6c
|
Sjon Hortensius
|
foreach ($arrayitem as $item) {
|
208 |
24fc15e6
|
Steve Beaver
|
|
209 |
8559c9d9
|
jim-p
|
/* If the user has access to help pages, also show the full help menu. See #5909 */
|
210 |
b29aa6e5
|
jim-p
|
if (isAllowedPage($item[1]) || $item[1] == "/index.php?logout" ||
|
211 |
|
|
(($section == "Help") && isAllowedPage("help.php")) ||
|
212 |
|
|
(substr($item[1], 0, 8) == "https://")) {
|
213 |
31f03b6c
|
Sjon Hortensius
|
$attr = sprintf("href=\"%s\"", htmlentities($item[1]));
|
214 |
24fc15e6
|
Steve Beaver
|
|
215 |
31f03b6c
|
Sjon Hortensius
|
if ($target) {
|
216 |
|
|
$attr .= sprintf(" target=\"%s\"", htmlentities($target));
|
217 |
|
|
}
|
218 |
24fc15e6
|
Steve Beaver
|
|
219 |
31f03b6c
|
Sjon Hortensius
|
$class = "navlnk";
|
220 |
24fc15e6
|
Steve Beaver
|
|
221 |
31f03b6c
|
Sjon Hortensius
|
if ($item['class']) {
|
222 |
|
|
$class .= " {$item['class']}";
|
223 |
|
|
}
|
224 |
24fc15e6
|
Steve Beaver
|
|
225 |
31f03b6c
|
Sjon Hortensius
|
$attr .= sprintf(" class=\"%s\"", htmlentities($class));
|
226 |
24fc15e6
|
Steve Beaver
|
|
227 |
31f03b6c
|
Sjon Hortensius
|
if ($item['style']) {
|
228 |
|
|
$attr .= sprintf(" style=\"%s\"", htmlentities($item['style']));
|
229 |
|
|
}
|
230 |
898aa92c
|
Steve Beaver
|
|
231 |
24fc15e6
|
Steve Beaver
|
|
232 |
898aa92c
|
Steve Beaver
|
if ($item[0] == '-DIVIDER-') {
|
233 |
7c3f1189
|
Phil Davis
|
$output .= ' <li class="divider"></li>';
|
234 |
898aa92c
|
Steve Beaver
|
} else {
|
235 |
ce437697
|
Steve Beaver
|
$output .= "<li>". sprintf("<a %s %s>%s</a>", $attr, ($item[1] == "/index.php?logout") ? "usepost":"",$item[0]) . "</li>\n";
|
236 |
898aa92c
|
Steve Beaver
|
}
|
237 |
31f03b6c
|
Sjon Hortensius
|
}
|
238 |
|
|
}
|
239 |
7c3f1189
|
Phil Davis
|
|
240 |
|
|
return $output;
|
241 |
31f03b6c
|
Sjon Hortensius
|
}
|
242 |
|
|
|
243 |
909a1954
|
Renato Botelho
|
$ext_menu_path_data = read_ext_menu_path_data();
|
244 |
|
|
|
245 |
31f03b6c
|
Sjon Hortensius
|
// System
|
246 |
|
|
$system_menu = array();
|
247 |
|
|
$system_menu[] = array(gettext("Advanced"), "/system_advanced_admin.php");
|
248 |
440a30cf
|
Stephen Beaver
|
$system_menu[] = array(gettext("Update"), "/pkg_mgr_install.php?id=firmware");
|
249 |
31f03b6c
|
Sjon Hortensius
|
$system_menu[] = array(gettext("General Setup"), "/system.php");
|
250 |
c8014348
|
Christian McDonald
|
$system_menu[] = array(gettext("High Availability"), "/system_hasync.php");
|
251 |
dc61252a
|
Renato Botelho
|
$system_menu[] = array(gettext("Package Manager"), "/pkg_mgr_installed.php");
|
252 |
31f03b6c
|
Sjon Hortensius
|
$system_menu[] = array(gettext("Setup Wizard"), "/wizard.php?xml=setup_wizard.xml");
|
253 |
d036bc07
|
Stephen Beaver
|
$system_menu[] = array(gettext("Routing"), "/system_gateways.php");
|
254 |
c8014348
|
Christian McDonald
|
$system_menu[] = array(gettext("Certificates"), "/system_camanager.php");
|
255 |
e0fd8fdd
|
Luiz Otavio O Souza
|
$system_menu[] = array(gettext("Register"), "/system_register.php");
|
256 |
b8fd0558
|
Steve Beaver
|
|
257 |
cf529cbe
|
jim-p
|
if (!isAllowedPage("system_usermanager.php")) {
|
258 |
31f03b6c
|
Sjon Hortensius
|
$system_menu[] = array(gettext("User Manager"), "/system_usermanager_passwordmg.php");
|
259 |
e259607f
|
Thane Gill
|
} else {
|
260 |
31f03b6c
|
Sjon Hortensius
|
$system_menu[] = array(gettext("User Manager"), "/system_usermanager.php");
|
261 |
e259607f
|
Thane Gill
|
}
|
262 |
da4a4b9f
|
Stephen Beaver
|
|
263 |
cf529cbe
|
jim-p
|
if ($user_settings['customsettings'] && isAllowedPage("system_user_settings.php")) {
|
264 |
8bab524e
|
Phil Davis
|
$system_menu[] = array(gettext("User Settings"), "/system_user_settings.php");
|
265 |
|
|
}
|
266 |
|
|
|
267 |
ecffb0bb
|
Phil Davis
|
$system_menu = msort(array_merge($system_menu, return_ext_menu("System")), 0);
|
268 |
31f03b6c
|
Sjon Hortensius
|
|
269 |
c8014348
|
Christian McDonald
|
/* ensure Logout is the last item in the menu */
|
270 |
|
|
$system_menu[] = array(gettext("Logout") . " (" . $_SESSION['Username'] . ")", "/index.php?logout");
|
271 |
|
|
|
272 |
31f03b6c
|
Sjon Hortensius
|
// Interfaces
|
273 |
24fc15e6
|
Steve Beaver
|
// NOTE:
|
274 |
|
|
// Now that menus are sorted, adding a DIVIDER must be done after the sorting so an array is formed of the
|
275 |
eb6984fd
|
Phil Davis
|
// items above the divider and another for below it. These are then sorted and combined with the divider
|
276 |
31f03b6c
|
Sjon Hortensius
|
$interfaces_menu = array();
|
277 |
24fc15e6
|
Steve Beaver
|
$interfaces_top = array();
|
278 |
|
|
$interfaces_bottom = array();
|
279 |
|
|
|
280 |
e259607f
|
Thane Gill
|
if (!isset($config['system']['webgui']['noassigninterfaces'])) {
|
281 |
24fc15e6
|
Steve Beaver
|
$interfaces_top[] = array(gettext("Assignments"), "/interfaces_assign.php");
|
282 |
898aa92c
|
Steve Beaver
|
$div = true;
|
283 |
e259607f
|
Thane Gill
|
}
|
284 |
898aa92c
|
Steve Beaver
|
|
285 |
|
|
$platform = system_identify_specific_platform();
|
286 |
|
|
|
287 |
|
|
if ($platform['name'] == "uFW") {
|
288 |
24fc15e6
|
Steve Beaver
|
$interfaces_top[] = array(gettext("Switches"), "/switch_system.php");
|
289 |
898aa92c
|
Steve Beaver
|
}
|
290 |
|
|
|
291 |
f593f80b
|
Phil Davis
|
$opts = get_configured_interface_with_descr(true);
|
292 |
24fc15e6
|
Steve Beaver
|
|
293 |
e259607f
|
Thane Gill
|
foreach ($opts as $oif => $odescr) {
|
294 |
|
|
if (!isset($config['interfaces'][$oif]['ovpn'])) {
|
295 |
24fc15e6
|
Steve Beaver
|
$interfaces_bottom[] = array(htmlspecialchars($odescr), "/interfaces.php?if={$oif}");
|
296 |
e259607f
|
Thane Gill
|
}
|
297 |
|
|
}
|
298 |
24fc15e6
|
Steve Beaver
|
|
299 |
1d3510cf
|
Phil Davis
|
$interfaces_bottom = array_merge($interfaces_bottom, return_ext_menu("Interfaces"));
|
300 |
|
|
|
301 |
|
|
if ($user_settings['webgui']['interfacessort']) {
|
302 |
|
|
$interfaces_bottom = msort($interfaces_bottom, 0);
|
303 |
|
|
}
|
304 |
|
|
|
305 |
eb6984fd
|
Phil Davis
|
// Combine the top section, the divider and the bottom section of this menu
|
306 |
1d3510cf
|
Phil Davis
|
$interfaces_menu = array_merge($interfaces_top, [array(0 => "-DIVIDER-")], $interfaces_bottom);
|
307 |
31f03b6c
|
Sjon Hortensius
|
|
308 |
|
|
// Firewall
|
309 |
|
|
$firewall_menu = array();
|
310 |
|
|
$firewall_menu[] = array(gettext("Aliases"), "/firewall_aliases.php");
|
311 |
|
|
$firewall_menu[] = array(gettext("NAT"), "/firewall_nat.php");
|
312 |
|
|
$firewall_menu[] = array(gettext("Rules"), "/firewall_rules.php");
|
313 |
|
|
$firewall_menu[] = array(gettext("Schedules"), "/firewall_schedule.php");
|
314 |
|
|
$firewall_menu[] = array(gettext("Traffic Shaper"), "/firewall_shaper.php");
|
315 |
|
|
$firewall_menu[] = array(gettext("Virtual IPs"), "/firewall_virtual_ip.php");
|
316 |
ecffb0bb
|
Phil Davis
|
$firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")), 0);
|
317 |
31f03b6c
|
Sjon Hortensius
|
|
318 |
|
|
// Services
|
319 |
|
|
$services_menu = array();
|
320 |
44c59448
|
Viktor G
|
$services_menu[] = array(gettext("Auto Config Backup"), "/services_acb_settings.php");
|
321 |
31f03b6c
|
Sjon Hortensius
|
$services_menu[] = array(gettext("Captive Portal"), "/services_captiveportal.php");
|
322 |
|
|
$services_menu[] = array(gettext("DNS Forwarder"), "/services_dnsmasq.php");
|
323 |
|
|
$services_menu[] = array(gettext("DNS Resolver"), "/services_unbound.php");
|
324 |
|
|
$services_menu[] = array(gettext("DHCP Relay"), "/services_dhcp_relay.php");
|
325 |
|
|
$services_menu[] = array(gettext("DHCPv6 Relay"), "/services_dhcpv6_relay.php");
|
326 |
239b5161
|
Stephen Beaver
|
|
327 |
2568e151
|
Christian McDonald
|
if (g_get('services_dhcp_server_enable')) {
|
328 |
31f03b6c
|
Sjon Hortensius
|
$services_menu[] = array(gettext("DHCP Server"), "/services_dhcp.php");
|
329 |
46b7214c
|
k-paulius
|
$services_menu[] = array(htmlspecialchars(gettext("DHCPv6 Server & RA")), "/services_dhcpv6.php");
|
330 |
31f03b6c
|
Sjon Hortensius
|
}
|
331 |
567d7fd6
|
Stephen Beaver
|
|
332 |
31f03b6c
|
Sjon Hortensius
|
$services_menu[] = array(gettext("Dynamic DNS"), "/services_dyndns.php");
|
333 |
35e05b7f
|
Phil Davis
|
$services_menu[] = array(gettext("IGMP Proxy"), "/services_igmpproxy.php");
|
334 |
31f03b6c
|
Sjon Hortensius
|
$services_menu[] = array(gettext("NTP"), "/services_ntpd.php");
|
335 |
1af5edbf
|
Stephen Beaver
|
$services_menu[] = array(gettext("PPPoE Server"), "/services_pppoe.php");
|
336 |
31f03b6c
|
Sjon Hortensius
|
$services_menu[] = array(gettext("SNMP"), "/services_snmp.php");
|
337 |
239b5161
|
Stephen Beaver
|
|
338 |
ecffb0bb
|
Phil Davis
|
if (count($config['interfaces']) > 1) {
|
339 |
31f03b6c
|
Sjon Hortensius
|
/* no use for UPnP in single-interface deployments
|
340 |
|
|
remove to reduce user confusion
|
341 |
|
|
*/
|
342 |
|
|
$services_menu[] = array(gettext("UPnP & NAT-PMP"), "/pkg_edit.php?xml=miniupnpd.xml");
|
343 |
|
|
}
|
344 |
239b5161
|
Stephen Beaver
|
|
345 |
7ca42d47
|
k-paulius
|
$services_menu[] = array(gettext("Wake-on-LAN"), "/services_wol.php");
|
346 |
ecffb0bb
|
Phil Davis
|
$services_menu = msort(array_merge($services_menu, return_ext_menu("Services")), 0);
|
347 |
31f03b6c
|
Sjon Hortensius
|
|
348 |
|
|
// VPN
|
349 |
|
|
$vpn_menu = array();
|
350 |
|
|
$vpn_menu[] = array(gettext("IPsec"), "/vpn_ipsec.php");
|
351 |
|
|
$vpn_menu[] = array(gettext("OpenVPN"), "/vpn_openvpn_server.php");
|
352 |
a4af095c
|
Renato Botelho
|
//$vpn_menu[] = array(gettext("PPTP"), "/vpn_pptp.php");
|
353 |
31f03b6c
|
Sjon Hortensius
|
$vpn_menu[] = array(gettext("L2TP"), "/vpn_l2tp.php");
|
354 |
ecffb0bb
|
Phil Davis
|
$vpn_menu = msort(array_merge($vpn_menu, return_ext_menu("VPN")), 0);
|
355 |
31f03b6c
|
Sjon Hortensius
|
|
356 |
|
|
// Status
|
357 |
|
|
$status_menu = array();
|
358 |
925817a7
|
Phil Davis
|
$status_menu[] = array(gettext("Captive Portal"), "/status_captiveportal.php");
|
359 |
1af5edbf
|
Stephen Beaver
|
$status_menu[] = array(gettext("CARP (failover)"), "/status_carp.php");
|
360 |
31f03b6c
|
Sjon Hortensius
|
$status_menu[] = array(gettext("Dashboard"), "/index.php");
|
361 |
|
|
$status_menu[] = array(gettext("Gateways"), "/status_gateways.php");
|
362 |
|
|
$status_menu[] = array(gettext("DHCP Leases"), "/status_dhcp_leases.php");
|
363 |
|
|
$status_menu[] = array(gettext("DHCPv6 Leases"), "/status_dhcpv6_leases.php");
|
364 |
4acef976
|
jim-p
|
$status_menu[] = array(gettext("DNS Resolver"), "/status_unbound.php");
|
365 |
d00157df
|
Steve Beaver
|
$status_menu[] = array(gettext("Filter Reload"), "/status_filter_reload.php?user=true");
|
366 |
31f03b6c
|
Sjon Hortensius
|
$status_menu[] = array(gettext("Interfaces"), "/status_interfaces.php");
|
367 |
1af5edbf
|
Stephen Beaver
|
$status_menu[] = array(gettext("IPsec"), "/status_ipsec.php");
|
368 |
31f03b6c
|
Sjon Hortensius
|
$status_menu[] = array(gettext("NTP"), "/status_ntpd.php");
|
369 |
|
|
$status_menu[] = array(gettext("OpenVPN"), "/status_openvpn.php");
|
370 |
|
|
$status_menu[] = array(gettext("Queues"), "/status_queues.php");
|
371 |
|
|
$status_menu[] = array(gettext("Services"), "/status_services.php");
|
372 |
1af5edbf
|
Stephen Beaver
|
$status_menu[] = array(gettext("System Logs"), "/status_logs.php");
|
373 |
dd8a6d75
|
Stephen Jones
|
$status_menu[] = array(gettext("Traffic Graph"), "/status_graph.php");
|
374 |
239b5161
|
Stephen Beaver
|
|
375 |
ecffb0bb
|
Phil Davis
|
if (count($config['interfaces']) > 1) {
|
376 |
31f03b6c
|
Sjon Hortensius
|
$status_menu[] = array(gettext("UPnP & NAT-PMP"), "/status_upnp.php");
|
377 |
e259607f
|
Thane Gill
|
}
|
378 |
239b5161
|
Stephen Beaver
|
|
379 |
25e4c862
|
Renato Botelho
|
$wifdescrs = array();
|
380 |
31f03b6c
|
Sjon Hortensius
|
$ifentries = get_configured_interface_with_descr();
|
381 |
|
|
foreach ($ifentries as $ent => $entdesc) {
|
382 |
|
|
if (is_array($config['interfaces'][$ent]['wireless']) &&
|
383 |
2568e151
|
Christian McDonald
|
preg_match(g_get('wireless_regex'), $config['interfaces'][$ent]['if'])) {
|
384 |
31f03b6c
|
Sjon Hortensius
|
$wifdescrs[$ent] = $entdesc;
|
385 |
e259607f
|
Thane Gill
|
}
|
386 |
31f03b6c
|
Sjon Hortensius
|
}
|
387 |
239b5161
|
Stephen Beaver
|
|
388 |
e259607f
|
Thane Gill
|
if (count($wifdescrs) > 0) {
|
389 |
31f03b6c
|
Sjon Hortensius
|
$status_menu[] = array(gettext("Wireless"), "/status_wireless.php");
|
390 |
e259607f
|
Thane Gill
|
}
|
391 |
239b5161
|
Stephen Beaver
|
|
392 |
ecffb0bb
|
Phil Davis
|
$status_menu = msort(array_merge($status_menu, return_ext_menu("Status")), 0);
|
393 |
31f03b6c
|
Sjon Hortensius
|
|
394 |
|
|
// Diagnostics
|
395 |
|
|
$diagnostics_menu = array();
|
396 |
|
|
$diagnostics_menu[] = array(gettext("ARP Table"), "/diag_arp.php");
|
397 |
|
|
$diagnostics_menu[] = array(gettext("Authentication"), "/diag_authentication.php");
|
398 |
0f298138
|
k-paulius
|
$diagnostics_menu[] = array(htmlspecialchars(gettext("Backup & Restore")), "/diag_backup.php");
|
399 |
c7903f8e
|
Stephen Beaver
|
$diagnostics_menu[] = array(gettext("Command Prompt"), "/diag_command.php");
|
400 |
31f03b6c
|
Sjon Hortensius
|
$diagnostics_menu[] = array(gettext("DNS Lookup"), "/diag_dns.php");
|
401 |
36a844df
|
Stephen Beaver
|
$diagnostics_menu[] = array(gettext("Edit File"), "/diag_edit.php");
|
402 |
31f03b6c
|
Sjon Hortensius
|
$diagnostics_menu[] = array(gettext("Factory Defaults"), "/diag_defaults.php");
|
403 |
239b5161
|
Stephen Beaver
|
|
404 |
ecffb0bb
|
Phil Davis
|
if (file_exists("/var/run/gmirror_active")) {
|
405 |
|
|
$diagnostics_menu[] = array(gettext("GEOM Mirrors"), "/diag_gmirror.php");
|
406 |
e259607f
|
Thane Gill
|
}
|
407 |
239b5161
|
Stephen Beaver
|
|
408 |
1af5edbf
|
Stephen Beaver
|
$diagnostics_menu[] = array(gettext("Halt System"), "/diag_halt.php");
|
409 |
ecffb0bb
|
Phil Davis
|
$diagnostics_menu[] = array(gettext("Limiter Info"), "/diag_limiter_info.php");
|
410 |
|
|
$diagnostics_menu[] = array(gettext("NDP Table"), "/diag_ndp.php");
|
411 |
31f03b6c
|
Sjon Hortensius
|
$diagnostics_menu[] = array(gettext("Tables"), "/diag_tables.php");
|
412 |
|
|
$diagnostics_menu[] = array(gettext("Ping"), "/diag_ping.php");
|
413 |
|
|
$diagnostics_menu[] = array(gettext("Test Port"), "/diag_testport.php");
|
414 |
|
|
$diagnostics_menu[] = array(gettext("pfInfo"), "/diag_pf_info.php");
|
415 |
1af5edbf
|
Stephen Beaver
|
$diagnostics_menu[] = array(gettext("pfTop"), "/diag_pftop.php");
|
416 |
|
|
$diagnostics_menu[] = array(gettext("Reboot"), "/diag_reboot.php");
|
417 |
31f03b6c
|
Sjon Hortensius
|
$diagnostics_menu[] = array(gettext("Routes"), "/diag_routes.php");
|
418 |
9718847b
|
k-paulius
|
$diagnostics_menu[] = array(gettext("S.M.A.R.T. Status"), "/diag_smart.php");
|
419 |
ecffb0bb
|
Phil Davis
|
$diagnostics_menu[] = array(gettext("Sockets"), "/diag_sockets.php");
|
420 |
31f03b6c
|
Sjon Hortensius
|
$diagnostics_menu[] = array(gettext("States"), "/diag_dump_states.php");
|
421 |
|
|
$diagnostics_menu[] = array(gettext("States Summary"), "/diag_states_summary.php");
|
422 |
|
|
$diagnostics_menu[] = array(gettext("System Activity"), "/diag_system_activity.php");
|
423 |
|
|
$diagnostics_menu[] = array(gettext("Traceroute"), "/diag_traceroute.php");
|
424 |
|
|
$diagnostics_menu[] = array(gettext("Packet Capture"), "/diag_packet_capture.php");
|
425 |
239b5161
|
Stephen Beaver
|
|
426 |
ecffb0bb
|
Phil Davis
|
$diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")), 0);
|
427 |
31f03b6c
|
Sjon Hortensius
|
|
428 |
2568e151
|
Christian McDonald
|
if (!g_get('disablehelpmenu')) {
|
429 |
31f03b6c
|
Sjon Hortensius
|
$help_menu = array();
|
430 |
|
|
$help_menu[] = array(gettext("About this Page"), $helpurl);
|
431 |
2568e151
|
Christian McDonald
|
if (g_get('product_name') == "pfSense") {
|
432 |
a3d92f1b
|
Jared Dillard
|
$help_menu[] = array(gettext("Bug Database"), "https://redirects.netgate.com/issues");
|
433 |
e259607f
|
Thane Gill
|
}
|
434 |
d7218f77
|
Stephen Beaver
|
|
435 |
f07e6d64
|
Steve Beaver
|
$help_menu[] = array(gettext("User Forum"), "https://redirects.netgate.com/forum");
|
436 |
|
|
$help_menu[] = array(gettext("Documentation"), "https://redirects.netgate.com/docs");
|
437 |
|
|
$help_menu[] = array(gettext("Paid Support"), "https://redirects.netgate.com/support");
|
438 |
|
|
$help_menu[] = array(gettext("pfSense Book"), "https://redirects.netgate.com/book");
|
439 |
|
|
$help_menu[] = array(gettext("FreeBSD Handbook"), "https://redirects.netgate.com/fbsdhandbook");
|
440 |
|
|
$help_menu[] = array(gettext("User survey"), "https://redirects.netgate.com/survey_1");
|
441 |
2568e151
|
Christian McDonald
|
if (strpos(g_get('product_label'), 'Plus') === false) {
|
442 |
5895065c
|
Steve Beaver
|
$help_menu[] = array(gettext("Upgrade to pfSense Plus"), "https://redirects.netgate.com/upgrade");
|
443 |
|
|
}
|
444 |
ecffb0bb
|
Phil Davis
|
$help_menu = msort(array_merge($help_menu, return_ext_menu("Help")), 0);
|
445 |
31f03b6c
|
Sjon Hortensius
|
}
|
446 |
3d29d2eb
|
Jared Dillard
|
|
447 |
|
|
$menuclass = "static";
|
448 |
ddb84143
|
Stephen Beaver
|
|
449 |
8bab524e
|
Phil Davis
|
if ($user_settings['webgui']['webguifixedmenu'] == "fixed") {
|
450 |
3d29d2eb
|
Jared Dillard
|
$menuclass = "fixed";
|
451 |
|
|
}
|
452 |
477db933
|
Jared Dillard
|
|
453 |
9ceace25
|
jim-p
|
$numColumns = (int) $user_settings['webgui']['dashboardcolumns'];
|
454 |
477db933
|
Jared Dillard
|
|
455 |
|
|
if (($pagename === "index.php") && ($numColumns > 2)) {
|
456 |
d349843c
|
Jared Dillard
|
$columnsContainer = 'style="max-width: ' . 585*$numColumns . 'px;width: 100%"';
|
457 |
477db933
|
Jared Dillard
|
}
|
458 |
5280f021
|
Phil Davis
|
|
459 |
|
|
$display_notices = false;
|
460 |
|
|
$allow_clear_notices = false;
|
461 |
|
|
|
462 |
|
|
if (are_notices_pending()) {
|
463 |
|
|
// Evaluate user privs to determine if notices should be displayed, and if the user can clear them.
|
464 |
|
|
$user_entry = getUserEntry($_SESSION['Username']);
|
465 |
b2daca76
|
Phil Davis
|
if (isAdminUID($_SESSION['Username']) || userHasPrivilege($user_entry, "user-view-clear-notices") || userHasPrivilege($user_entry, "page-all")) {
|
466 |
5280f021
|
Phil Davis
|
$display_notices = true;
|
467 |
|
|
$allow_clear_notices = true;
|
468 |
|
|
} elseif (userHasPrivilege($user_entry, "user-view-notices")) {
|
469 |
|
|
$display_notices = true;
|
470 |
|
|
}
|
471 |
|
|
}
|
472 |
31f03b6c
|
Sjon Hortensius
|
?>
|
473 |
477db933
|
Jared Dillard
|
<body id="<?=$numColumns?>">
|
474 |
3d29d2eb
|
Jared Dillard
|
<nav id="topmenu" class="navbar navbar-<?=$menuclass?>-top navbar-inverse">
|
475 |
31f03b6c
|
Sjon Hortensius
|
<div class="container">
|
476 |
|
|
<div class="navbar-header">
|
477 |
2d26ee5e
|
Sjon Hortensius
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#pf-navbar">
|
478 |
31f03b6c
|
Sjon Hortensius
|
<span class="sr-only">Toggle navigation</span>
|
479 |
|
|
<span class="icon-bar"></span>
|
480 |
|
|
<span class="icon-bar"></span>
|
481 |
|
|
<span class="icon-bar"></span>
|
482 |
|
|
</button>
|
483 |
be76c9d6
|
Jared Dillard
|
<a class="navbar-brand" href="/">
|
484 |
f9a6637a
|
Renato Botelho
|
<?php include("/usr/local/www/logo.svg"); ?>
|
485 |
be76c9d6
|
Jared Dillard
|
<span style="color:white;font-size:.5em;text-transform:uppercase;letter-spacing:1px;">Community Edition</span>
|
486 |
|
|
</a>
|
487 |
31f03b6c
|
Sjon Hortensius
|
</div>
|
488 |
2d26ee5e
|
Sjon Hortensius
|
<div class="collapse navbar-collapse" id="pf-navbar">
|
489 |
31f03b6c
|
Sjon Hortensius
|
<ul class="nav navbar-nav">
|
490 |
1d129967
|
Christopher Fazendin
|
<?php
|
491 |
8bab524e
|
Phil Davis
|
if ($user_settings['webgui']['webguihostnamemenu'] == 'hostonly') {
|
492 |
1d129967
|
Christopher Fazendin
|
$help_menu_title = htmlspecialchars($config['system']['hostname']);
|
493 |
|
|
}
|
494 |
8bab524e
|
Phil Davis
|
elseif ($user_settings['webgui']['webguihostnamemenu'] == 'fqdn') {
|
495 |
8ad8e9ab
|
Phil Davis
|
$help_menu_title = htmlspecialchars($system_url);
|
496 |
1d129967
|
Christopher Fazendin
|
}
|
497 |
|
|
else {
|
498 |
|
|
$help_menu_title = 'Help';
|
499 |
|
|
}
|
500 |
|
|
foreach ([
|
501 |
|
|
['name' => 'System', 'menu' => $system_menu, 'href' => null],
|
502 |
|
|
['name' => 'Interfaces', 'menu' => $interfaces_menu, 'href' => null],
|
503 |
|
|
['name' => 'Firewall', 'menu' => $firewall_menu, 'href' => null],
|
504 |
|
|
['name' => 'Services', 'menu' => $services_menu, 'href' => null],
|
505 |
|
|
['name' => 'VPN', 'menu' => $vpn_menu, 'href' => null],
|
506 |
|
|
['name' => 'Status', 'menu' => $status_menu, 'href' => null],
|
507 |
|
|
['name' => 'Diagnostics', 'menu' => $diagnostics_menu, 'href' => null],
|
508 |
|
|
['name' => $help_menu_title, 'menu' => $help_menu, 'href' => '_blank']
|
509 |
69a17c90
|
Thane Gill
|
] as $item):
|
510 |
2568e151
|
Christian McDonald
|
if ($item['name'] == 'Help' && g_get('disablehelpmenu')) {
|
511 |
69a17c90
|
Thane Gill
|
continue;
|
512 |
898aa92c
|
Steve Beaver
|
}
|
513 |
7c3f1189
|
Phil Davis
|
|
514 |
|
|
$menu_output = output_menu($item['menu'], $item['href'], $item['name']);
|
515 |
|
|
|
516 |
|
|
if (strlen($menu_output) > 0):
|
517 |
898aa92c
|
Steve Beaver
|
?>
|
518 |
31f03b6c
|
Sjon Hortensius
|
<li class="dropdown">
|
519 |
e97e9aca
|
Thane Gill
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
520 |
|
|
<?=gettext($item['name'])?>
|
521 |
31f03b6c
|
Sjon Hortensius
|
<span class="caret"></span>
|
522 |
|
|
</a>
|
523 |
7c3f1189
|
Phil Davis
|
<ul class="dropdown-menu" role="menu"><?=$menu_output?></ul>
|
524 |
31f03b6c
|
Sjon Hortensius
|
</li>
|
525 |
898aa92c
|
Steve Beaver
|
|
526 |
|
|
<?php
|
527 |
7c3f1189
|
Phil Davis
|
endif;
|
528 |
898aa92c
|
Steve Beaver
|
endforeach?>
|
529 |
fc2ba7e2
|
k-paulius
|
</ul>
|
530 |
|
|
<ul class="nav navbar-nav navbar-right">
|
531 |
5280f021
|
Phil Davis
|
<?php if ($display_notices):?>
|
532 |
e97e9aca
|
Thane Gill
|
<?php $notices = get_notices()?>
|
533 |
31f03b6c
|
Sjon Hortensius
|
<li class="dropdown">
|
534 |
2617a1bc
|
Jared Dillard
|
<a href="#" data-toggle="modal" data-target="#notices" role="button" aria-expanded="false">
|
535 |
aa82505e
|
Phil Davis
|
<i class="fa fa-bell text-danger" title="<?=gettext("Notices")?>"></i>
|
536 |
2617a1bc
|
Jared Dillard
|
<span class="badge bg-danger"><?=count($notices)?></span>
|
537 |
31f03b6c
|
Sjon Hortensius
|
</a>
|
538 |
|
|
</li>
|
539 |
2617a1bc
|
Jared Dillard
|
<?php
|
540 |
|
|
endif;
|
541 |
|
|
?>
|
542 |
07edce6d
|
Stephen Beaver
|
<li class="dropdown">
|
543 |
ce437697
|
Steve Beaver
|
<a href="/index.php?logout" usepost>
|
544 |
8ad8e9ab
|
Phil Davis
|
<i class="fa fa-sign-out" title="<?=gettext("Logout") . " (" . $_SESSION['Username'] . "@" . htmlspecialchars($system_url) . ")"?>"></i>
|
545 |
07edce6d
|
Stephen Beaver
|
</a>
|
546 |
|
|
</li>
|
547 |
d7218f77
|
Stephen Beaver
|
</ul>
|
548 |
6eeca0ef
|
Sjon Hortensius
|
</div>
|
549 |
|
|
</div>
|
550 |
31f03b6c
|
Sjon Hortensius
|
</nav>
|
551 |
d7218f77
|
Stephen Beaver
|
|
552 |
477db933
|
Jared Dillard
|
<div class="container <?=$menuclass?>" <?=$columnsContainer?>>
|
553 |
5b2e9e7b
|
Steve Beaver
|
|
554 |
|
|
<?php
|
555 |
|
|
// Print a warning if current user = admin and the password hash is still set to the default value
|
556 |
|
|
if ($_SESSION['Username'] == "admin") {
|
557 |
|
|
$cu = getUserEntry("admin");
|
558 |
|
|
|
559 |
2568e151
|
Christian McDonald
|
if (local_backed("admin", g_get('factory_shipped_password'))) {
|
560 |
1ddc7206
|
Steve Beaver
|
print('<div class="alert alert-danger">' .
|
561 |
ab4fdf49
|
Steve Beaver
|
sprintf(gettext('%sWARNING:%s The \'admin\' account password is set to the default value. ' .
|
562 |
|
|
' %s Change the password in the User Manager.%s'),
|
563 |
1ddc7206
|
Steve Beaver
|
'<strong>', '</strong>', '<a href="/system_usermanager.php?act=edit&userid=' . $cu['uid'] . '">', '</a>') .
|
564 |
5b2e9e7b
|
Steve Beaver
|
'</div>');
|
565 |
|
|
}
|
566 |
|
|
}
|
567 |
|
|
?>
|
568 |
|
|
|
569 |
45eebe10
|
Sander van Leeuwen
|
<header class="header">
|
570 |
89dcfa01
|
Stephen Beaver
|
|
571 |
|
|
<?php
|
572 |
|
|
// If you set $notitle = true BEFORE including head.inc, the page title will be supressed
|
573 |
aa82505e
|
Phil Davis
|
if (isset($notitle)) {
|
574 |
89dcfa01
|
Stephen Beaver
|
print('<br />');
|
575 |
|
|
unset($notitle);
|
576 |
|
|
} else {
|
577 |
edcd7535
|
Phil Davis
|
if (isset($pglinks)) {
|
578 |
ce437697
|
Steve Beaver
|
print(genhtmltitle($pgtitle, $pglinks));
|
579 |
edcd7535
|
Phil Davis
|
} else {
|
580 |
|
|
print(genhtmltitle($pgtitle));
|
581 |
|
|
}
|
582 |
89dcfa01
|
Stephen Beaver
|
}
|
583 |
|
|
?>
|
584 |
0bf1e5fe
|
Sjon Hortensius
|
<ul class="context-links">
|
585 |
89dcfa01
|
Stephen Beaver
|
|
586 |
91d59881
|
NOYB
|
<?php if (isset($widgets)): ?>
|
587 |
c05363c8
|
NOYB
|
<li>
|
588 |
cee365e6
|
Stephen Beaver
|
<a href="#" title="<?=gettext("Save dashboard layout")?>" id="btnstore" class="invisible">
|
589 |
91d59881
|
NOYB
|
<i class="fa fa-save icon-pointer"></i>
|
590 |
c05363c8
|
NOYB
|
</a>
|
591 |
|
|
</li>
|
592 |
|
|
<?php endif?>
|
593 |
|
|
|
594 |
91d59881
|
NOYB
|
<?php if ($dashboard_available_widgets_hidden): ?>
|
595 |
35d8d613
|
NOYB
|
<li>
|
596 |
91d59881
|
NOYB
|
<a onclick="$('#widget-available').toggle(360);" title="<?=gettext("Available widgets")?>">
|
597 |
|
|
<i class="fa fa-plus icon-pointer"></i>
|
598 |
35d8d613
|
NOYB
|
</a>
|
599 |
|
|
</li>
|
600 |
|
|
<?php endif?>
|
601 |
36a844df
|
Stephen Beaver
|
|
602 |
c05363c8
|
NOYB
|
<?php if ($system_logs_filter_form_hidden): ?>
|
603 |
|
|
<li>
|
604 |
29c39b7c
|
k-paulius
|
<a onclick="$('#filter-form').toggle(360)" title="<?=gettext("Log filter")?>">
|
605 |
7bd42c09
|
NOYB
|
<i class="fa fa-filter icon-pointer"></i>
|
606 |
c05363c8
|
NOYB
|
</a>
|
607 |
|
|
</li>
|
608 |
|
|
<?php endif ?>
|
609 |
|
|
|
610 |
7076def1
|
Stephen Beaver
|
<?php if ($system_logs_manage_log_form_hidden):
|
611 |
820780b5
|
NOYB
|
/* If the user does not have access to status logs settings page, then exclude the manage log panel icon from the title bar. */
|
612 |
|
|
if (isAllowedPage("status_logs_settings.php")) {
|
613 |
|
|
?>
|
614 |
c05363c8
|
NOYB
|
<li>
|
615 |
29c39b7c
|
k-paulius
|
<a onclick="$('#manage-log-form').toggle(360)" title="<?=gettext("Manage log")?>">
|
616 |
7bd42c09
|
NOYB
|
<i class="fa fa-wrench icon-pointer"></i>
|
617 |
c05363c8
|
NOYB
|
</a>
|
618 |
|
|
</li>
|
619 |
820780b5
|
NOYB
|
<?php }
|
620 |
|
|
endif
|
621 |
|
|
?>
|
622 |
c05363c8
|
NOYB
|
|
623 |
b1b8784a
|
NOYB
|
<?php if ($monitoring_settings_form_hidden): ?>
|
624 |
|
|
<li>
|
625 |
|
|
<a onclick="$('#monitoring-settings-form').toggle(360);" title="<?=gettext("Settings")?>">
|
626 |
|
|
<i class="fa fa-wrench icon-pointer"></i>
|
627 |
|
|
</a>
|
628 |
|
|
</li>
|
629 |
|
|
<?php endif?>
|
630 |
|
|
|
631 |
|
|
<?php if ($status_monitoring): ?>
|
632 |
|
|
<li>
|
633 |
10485d3c
|
Jared Dillard
|
<a class="update-graph" title="<?=gettext("Refresh Graph")?>">
|
634 |
b1b8784a
|
NOYB
|
<i class="fa fa-repeat icon-pointer"></i>
|
635 |
|
|
</a>
|
636 |
|
|
</li>
|
637 |
726ebc65
|
Jared Dillard
|
<li>
|
638 |
|
|
<a class="export-graph" id="export-graph" title="<?=gettext("Export Graph")?>">
|
639 |
|
|
<i class="fa fa-download icon-pointer"></i>
|
640 |
|
|
</a>
|
641 |
|
|
</li>
|
642 |
b1b8784a
|
NOYB
|
<?php endif?>
|
643 |
|
|
|
644 |
c05363c8
|
NOYB
|
<?php
|
645 |
3abcd547
|
jim-p
|
/* Determine shortcut section for XML-based packages */
|
646 |
|
|
if (empty($shortcut_section) && !empty($xmlfile)) {
|
647 |
|
|
$shortcut_section = basename($pagename, '.xml');
|
648 |
|
|
}
|
649 |
|
|
|
650 |
38386fb4
|
NOYB
|
if (!$hide_service_status && !empty($shortcuts[$shortcut_section]['service']) && isAllowedPage('status_services.php')) {
|
651 |
649cde0b
|
Sander van Leeuwen
|
$ssvc = array();
|
652 |
|
|
switch ($shortcut_section) {
|
653 |
|
|
case "openvpn":
|
654 |
|
|
$ssvc = find_service_by_openvpn_vpnid($vpnid);
|
655 |
|
|
break;
|
656 |
|
|
case "captiveportal":
|
657 |
|
|
$ssvc = find_service_by_cp_zone($cpzone);
|
658 |
|
|
break;
|
659 |
|
|
default:
|
660 |
|
|
$ssvc = find_service_by_name($shortcuts[$shortcut_section]['service']);
|
661 |
31f03b6c
|
Sjon Hortensius
|
}
|
662 |
649cde0b
|
Sander van Leeuwen
|
if (!empty($ssvc)) {
|
663 |
ee678e75
|
Sander van Leeuwen
|
// echo '<li>'. get_service_status_icon($ssvc, false). '</li>'; TODO: Add missing function
|
664 |
29fda3d3
|
Stephen Beaver
|
echo '<li>'. get_service_control_links($ssvc, false). '</li>';
|
665 |
649cde0b
|
Sander van Leeuwen
|
}
|
666 |
|
|
}
|
667 |
31f03b6c
|
Sjon Hortensius
|
|
668 |
38386fb4
|
NOYB
|
if (('' != ($link = get_shortcut_main_link($shortcut_section, false))) && (isAllowedPage($shortcuts[$shortcut_section]['main']))) {
|
669 |
9014e27c
|
k-paulius
|
echo '<li>' . $link . '</li>';
|
670 |
|
|
}
|
671 |
|
|
|
672 |
38386fb4
|
NOYB
|
if (('' != ($link = get_shortcut_status_link($shortcut_section, false))) && (isAllowedPage($shortcuts[$shortcut_section]['status']))) {
|
673 |
9014e27c
|
k-paulius
|
echo '<li>' . $link . '</li>';
|
674 |
|
|
}
|
675 |
|
|
|
676 |
38386fb4
|
NOYB
|
if (('' != ($link = get_shortcut_log_link($shortcut_section, false))) && (isAllowedPage($shortcuts[$shortcut_section]['log']))) {
|
677 |
9014e27c
|
k-paulius
|
echo '<li>' . $link . '</li>';
|
678 |
|
|
}
|
679 |
45eebe10
|
Sander van Leeuwen
|
|
680 |
0bf1e5fe
|
Sjon Hortensius
|
?>
|
681 |
2568e151
|
Christian McDonald
|
<?php if (!g_get('disablehelpicon') && isAllowedPage("help.php")): ?>
|
682 |
0bf1e5fe
|
Sjon Hortensius
|
<li>
|
683 |
20e108e0
|
NOYB
|
<a href="<?=$helpurl?>" target="_blank" title="<?=gettext("Help for items on this page")?>">
|
684 |
7ea65674
|
Jared Dillard
|
<i class="fa fa-question-circle"></i>
|
685 |
0bf1e5fe
|
Sjon Hortensius
|
</a>
|
686 |
|
|
</li>
|
687 |
e259607f
|
Thane Gill
|
<?php endif?>
|
688 |
0bf1e5fe
|
Sjon Hortensius
|
</ul>
|
689 |
45eebe10
|
Sander van Leeuwen
|
</header>
|
690 |
56c100ab
|
Erik Fonnesbeck
|
<?php
|
691 |
31f03b6c
|
Sjon Hortensius
|
/* if upgrade in progress, alert user */
|
692 |
c165834f
|
Renato Botelho
|
$warning_text = "";
|
693 |
|
|
if (file_exists('/conf/needs_package_sync') && platform_booting()) {
|
694 |
|
|
$warning_text = sprintf(gettext(
|
695 |
|
|
'%1$s%3$s is booting, then packages will be reinstalled in the ' .
|
696 |
|
|
'background.%2$s%1$sDo not make changes in the GUI until this is ' .
|
697 |
2568e151
|
Christian McDonald
|
'complete.%2$s'), '<p>', '</p>', g_get('product_label'));
|
698 |
c165834f
|
Renato Botelho
|
} elseif (is_subsystem_dirty('packagelock')) {
|
699 |
|
|
$pgtitle = array(gettext("System"), gettext("Package Manager"));
|
700 |
|
|
$warning_text = sprintf(gettext('%1$sPackages are currently being ' .
|
701 |
|
|
'reinstalled in the background.%2$s%1$sDo not make changes in ' .
|
702 |
|
|
'the GUI until this is complete.%2$s'), '<p>', '</p>');
|
703 |
|
|
$warning_text .= sprintf(gettext('%1$sIf the above message is still ' .
|
704 |
|
|
'displayed after a couple of hours, use the \'Clear Package ' .
|
705 |
|
|
'Lock\' button on the %3$s page and reinstall packages manually.' .
|
706 |
|
|
'%2$s'), '<p>', '</p>', sprintf('<a href="diag_backup.php" ' .
|
707 |
|
|
'title="%1$s > %2$s">%1$s > %2$s</a>', gettext('Diagnostics'),
|
708 |
|
|
htmlspecialchars(gettext('Backup & Restore'))));
|
709 |
|
|
}
|
710 |
180508d1
|
Stephen Beaver
|
|
711 |
c165834f
|
Renato Botelho
|
if (!empty($warning_text)) {
|
712 |
f78bbe16
|
Phil Davis
|
print_info_box($warning_text);
|
713 |
31f03b6c
|
Sjon Hortensius
|
}
|
714 |
|
|
|
715 |
d7218f77
|
Stephen Beaver
|
/* If this page is being remotely managed then do not allow the loading of the contents. */
|
716 |
1180e4f0
|
Sjon Hortensius
|
if ($config['remote_managed_pages']['item']) {
|
717 |
ecffb0bb
|
Phil Davis
|
foreach ($config['remote_managed_pages']['item'] as $rmp) {
|
718 |
1180e4f0
|
Sjon Hortensius
|
if ($rmp == $_SERVER['SCRIPT_NAME']) {
|
719 |
3b3a95e5
|
Phil Davis
|
print_info_box(gettext("This page is currently being managed by a remote machine."));
|
720 |
31f03b6c
|
Sjon Hortensius
|
include("foot.inc");
|
721 |
56c100ab
|
Erik Fonnesbeck
|
exit;
|
722 |
|
|
}
|
723 |
1180e4f0
|
Sjon Hortensius
|
}
|
724 |
e259607f
|
Thane Gill
|
}
|
725 |
d7218f77
|
Stephen Beaver
|
|
726 |
|
|
// Modal notices window
|
727 |
a46c437d
|
Stephen Beaver
|
// The notices modal needs to be outside of the page display div or things get messy
|
728 |
5280f021
|
Phil Davis
|
if ($display_notices):
|
729 |
|
|
?>
|
730 |
d7218f77
|
Stephen Beaver
|
|
731 |
|
|
<div id="notices" class="modal fade" role="dialog">
|
732 |
362642c1
|
Jared Dillard
|
<div class="modal-dialog">
|
733 |
d7218f77
|
Stephen Beaver
|
<div class="modal-content">
|
734 |
|
|
<div class="modal-header">
|
735 |
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
736 |
|
|
<span aria-hidden="true">×</span>
|
737 |
|
|
</button>
|
738 |
|
|
|
739 |
f49cd725
|
Phil Davis
|
<h3 class="modal-title" id="myModalLabel"><?=gettext("Notices")?></h3>
|
740 |
d7218f77
|
Stephen Beaver
|
</div>
|
741 |
|
|
|
742 |
|
|
<div class="modal-body">
|
743 |
|
|
<?php
|
744 |
|
|
$noticeCategories = array();
|
745 |
|
|
|
746 |
aa82505e
|
Phil Davis
|
if (is_array($notices)) {
|
747 |
|
|
foreach ($notices as $time => $notice) {
|
748 |
|
|
if (!isset($noticeCategories[ $notice['category'] ])) {
|
749 |
d7218f77
|
Stephen Beaver
|
$noticeCategories[ $notice['category'] ] = array();
|
750 |
aa82505e
|
Phil Davis
|
}
|
751 |
d7218f77
|
Stephen Beaver
|
|
752 |
|
|
$notice['time'] = $time;
|
753 |
|
|
array_push($noticeCategories[ $notice['category'] ], $notice);
|
754 |
|
|
}
|
755 |
|
|
}
|
756 |
|
|
|
757 |
|
|
foreach ($noticeCategories as $category => $catNotices):?>
|
758 |
|
|
<h4><?=$category?></h4>
|
759 |
|
|
<ul>
|
760 |
|
|
<?php
|
761 |
|
|
foreach ($catNotices as $notice):
|
762 |
|
|
?>
|
763 |
|
|
<li>
|
764 |
|
|
<b>
|
765 |
|
|
<?php if (!empty($notice['url'])):?>
|
766 |
e4710ed5
|
Chris Buechler
|
<a href="<?=htmlspecialchars($notice['url'])?>"><?=htmlspecialchars($notice['id'])?></a> -
|
767 |
d7218f77
|
Stephen Beaver
|
<?php endif;?>
|
768 |
|
|
</b>
|
769 |
6df2c200
|
Viktor G
|
<?=str_replace("\n", "<br/>", htmlspecialchars(htmlspecialchars_decode(htmlspecialchars_decode($notice['notice']))))?>
|
770 |
d7218f77
|
Stephen Beaver
|
<i>@ <?=date('Y-m-d H:i:s', $notice['time'])?></i>
|
771 |
|
|
</li>
|
772 |
|
|
<?php endforeach;?>
|
773 |
|
|
</ul>
|
774 |
|
|
<?php endforeach;?>
|
775 |
|
|
</div>
|
776 |
|
|
|
777 |
|
|
<div class="modal-footer">
|
778 |
a77c2a23
|
Jared Dillard
|
<button type="button" class="btn btn-info" data-dismiss="modal"><i class="fa fa-times icon-embed-btn"></i><?=gettext("Close")?></button>
|
779 |
5280f021
|
Phil Davis
|
<?php if ($allow_clear_notices && isAllowedPage("/index.php")):?>
|
780 |
b6786d45
|
Stephen Beaver
|
<button type="button" id="clearallnotices" class="btn btn-primary"><i class="fa fa-trash-o icon-embed-btn"></i><?=gettext("Mark All as Read")?></button>
|
781 |
fe80b3aa
|
Phil Davis
|
<?php endif;?>
|
782 |
d7218f77
|
Stephen Beaver
|
</div>
|
783 |
|
|
</div>
|
784 |
|
|
</div>
|
785 |
|
|
</div>
|
786 |
|
|
|
787 |
8fd9052f
|
Colin Fleming
|
<script type="text/javascript">
|
788 |
8d3f3e34
|
Stephen Beaver
|
//<![CDATA[
|
789 |
aa82505e
|
Phil Davis
|
events.push(function() {
|
790 |
8d3f3e34
|
Stephen Beaver
|
$('#clearallnotices').click(function() {
|
791 |
329a1cd5
|
Stephen Beaver
|
ajaxRequest = $.ajax({
|
792 |
|
|
url: "/index.php",
|
793 |
|
|
type: "post",
|
794 |
0206483d
|
Stephen Beaver
|
data: { closenotice: "all"},
|
795 |
aa82505e
|
Phil Davis
|
success: function() {
|
796 |
0206483d
|
Stephen Beaver
|
window.location = window.location.href;
|
797 |
|
|
},
|
798 |
aa82505e
|
Phil Davis
|
failure: function() {
|
799 |
1860c406
|
Phil Davis
|
alert("Error clearing notices!");
|
800 |
0206483d
|
Stephen Beaver
|
}
|
801 |
329a1cd5
|
Stephen Beaver
|
});
|
802 |
8d3f3e34
|
Stephen Beaver
|
});
|
803 |
|
|
});
|
804 |
|
|
//]]>
|
805 |
888c3c1b
|
Stephen Beaver
|
</script>
|
806 |
|
|
|
807 |
5280f021
|
Phil Davis
|
<?php
|
808 |
|
|
endif; // ($display_notices)
|
809 |
0b87fcf5
|
bruno
|
|
810 |
|
|
// Get the flash Messages
|
811 |
|
|
get_flash_message();
|