1 |
cfc707f7
|
Scott Ullrich
|
<?php
|
2 |
5b237745
|
Scott Ullrich
|
/*
|
3 |
|
|
diag_logs.php
|
4 |
|
|
*/
|
5 |
fd9ebcd5
|
Stephen Beaver
|
/* ====================================================================
|
6 |
0da0d43e
|
Phil Davis
|
* Copyright (c) 2004-2015 Electric Sheep Fencing, LLC. All rights reserved.
|
7 |
9da2cf1c
|
Stephen Beaver
|
*
|
8 |
c9df279d
|
Stephen Beaver
|
* Some or all of this file is based on the m0n0wall project which is
|
9 |
9da2cf1c
|
Stephen Beaver
|
* Copyright (c) 2004 Manuel Kasper (BSD 2 clause)
|
10 |
fd9ebcd5
|
Stephen Beaver
|
*
|
11 |
0da0d43e
|
Phil Davis
|
* Redistribution and use in source and binary forms, with or without modification,
|
12 |
|
|
* are permitted provided that the following conditions are met:
|
13 |
fd9ebcd5
|
Stephen Beaver
|
*
|
14 |
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
15 |
|
|
* this list of conditions and the following disclaimer.
|
16 |
|
|
*
|
17 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
18 |
|
|
* notice, this list of conditions and the following disclaimer in
|
19 |
|
|
* the documentation and/or other materials provided with the
|
20 |
0da0d43e
|
Phil Davis
|
* distribution.
|
21 |
fd9ebcd5
|
Stephen Beaver
|
*
|
22 |
0da0d43e
|
Phil Davis
|
* 3. All advertising materials mentioning features or use of this software
|
23 |
fd9ebcd5
|
Stephen Beaver
|
* must display the following acknowledgment:
|
24 |
|
|
* "This product includes software developed by the pfSense Project
|
25 |
0da0d43e
|
Phil Davis
|
* for use in the pfSense software distribution. (http://www.pfsense.org/).
|
26 |
fd9ebcd5
|
Stephen Beaver
|
*
|
27 |
|
|
* 4. The names "pfSense" and "pfSense Project" must not be used to
|
28 |
|
|
* endorse or promote products derived from this software without
|
29 |
|
|
* prior written permission. For written permission, please contact
|
30 |
|
|
* coreteam@pfsense.org.
|
31 |
|
|
*
|
32 |
|
|
* 5. Products derived from this software may not be called "pfSense"
|
33 |
|
|
* nor may "pfSense" appear in their names without prior written
|
34 |
|
|
* permission of the Electric Sheep Fencing, LLC.
|
35 |
|
|
*
|
36 |
|
|
* 6. Redistributions of any form whatsoever must retain the following
|
37 |
|
|
* acknowledgment:
|
38 |
|
|
*
|
39 |
|
|
* "This product includes software developed by the pfSense Project
|
40 |
|
|
* for use in the pfSense software distribution (http://www.pfsense.org/).
|
41 |
0da0d43e
|
Phil Davis
|
*
|
42 |
fd9ebcd5
|
Stephen Beaver
|
* THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
|
43 |
|
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
44 |
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
45 |
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
|
46 |
|
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
47 |
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
48 |
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
49 |
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
50 |
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
51 |
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
52 |
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
53 |
|
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
54 |
|
|
*
|
55 |
|
|
* ====================================================================
|
56 |
|
|
*
|
57 |
|
|
*/
|
58 |
5b237745
|
Scott Ullrich
|
|
59 |
0a5d0b7b
|
sbeaver
|
/*
|
60 |
13d193c2
|
Scott Ullrich
|
pfSense_MODULE: system
|
61 |
|
|
*/
|
62 |
|
|
|
63 |
6b07c15a
|
Matthew Grooms
|
##|+PRIV
|
64 |
|
|
##|*IDENT=page-diagnostics-logs-system
|
65 |
5230f468
|
jim-p
|
##|*NAME=Status: Logs: System
|
66 |
0b8328c5
|
jim-p
|
##|*DESCR=Allow access to the 'Status: System Logs: General' page.
|
67 |
|
|
##|*MATCH=diag_logs.php
|
68 |
6b07c15a
|
Matthew Grooms
|
##|-PRIV
|
69 |
|
|
|
70 |
5b237745
|
Scott Ullrich
|
require("guiconfig.inc");
|
71 |
e3efcb23
|
NOYB
|
require_once("filter_log.inc");
|
72 |
5b237745
|
Scott Ullrich
|
|
73 |
d8af270c
|
jim-p
|
/*
|
74 |
|
|
Build a list of allowed log files so we can reject others to prevent the page
|
75 |
|
|
from acting on unauthorized files.
|
76 |
|
|
*/
|
77 |
|
|
$allowed_logs = array(
|
78 |
|
|
"system" => array("name" => "General",
|
79 |
|
|
"shortcut" => ""),
|
80 |
|
|
"dhcpd" => array("name" => "DHCP",
|
81 |
|
|
"shortcut" => "dhcp"),
|
82 |
|
|
"portalauth" => array("name" => "Captive Portal Authentication",
|
83 |
|
|
"shortcut" => "captiveportal"),
|
84 |
|
|
"ipsec" => array("name" => "IPsec",
|
85 |
|
|
"shortcut" => "ipsec"),
|
86 |
|
|
"ppp" => array("name" => "PPP",
|
87 |
|
|
"shortcut" => ""),
|
88 |
|
|
"relayd" => array("name" => "Load Balancer",
|
89 |
|
|
"shortcut" => "relayd"),
|
90 |
|
|
"openvpn" => array("name" => "OpenVPN",
|
91 |
|
|
"shortcut" => "openvpn"),
|
92 |
|
|
"ntpd" => array("name" => "NTPd",
|
93 |
|
|
"shortcut" => "ntp"),
|
94 |
|
|
"gateways" => array("name" => "Gateways",
|
95 |
|
|
"shortcut" => "gateways"),
|
96 |
|
|
"routing" => array("name" => "Routing",
|
97 |
|
|
"shortcut" => "routing"),
|
98 |
|
|
"resolver" => array("name" => "DNS Resolver",
|
99 |
|
|
"shortcut" => "resolver"),
|
100 |
|
|
"wireless" => array("name" => "Wireless",
|
101 |
|
|
"shortcut" => "wireless"),
|
102 |
|
|
);
|
103 |
|
|
|
104 |
0a5d0b7b
|
sbeaver
|
// The logs to display are specified in a GET argument. Default to 'system' logs
|
105 |
d8af270c
|
jim-p
|
if (!$_GET['logfile']) {
|
106 |
0a5d0b7b
|
sbeaver
|
$logfile = 'system';
|
107 |
d8af270c
|
jim-p
|
} else {
|
108 |
0a5d0b7b
|
sbeaver
|
$logfile = $_GET['logfile'];
|
109 |
d8af270c
|
jim-p
|
if (!array_key_exists($logfile, $allowed_logs)) {
|
110 |
|
|
/* Do not let someone attempt to load an unauthorized log. */
|
111 |
|
|
$logfile = 'system';
|
112 |
|
|
}
|
113 |
|
|
}
|
114 |
0a5d0b7b
|
sbeaver
|
|
115 |
e3efcb23
|
NOYB
|
function getGETPOSTsettingvalue($settingname, $default) {
|
116 |
|
|
$settingvalue = $default;
|
117 |
|
|
if ($_GET[$settingname]) {
|
118 |
|
|
$settingvalue = $_GET[$settingname];
|
119 |
|
|
}
|
120 |
|
|
if ($_POST[$settingname]) {
|
121 |
|
|
$settingvalue = $_POST[$settingname];
|
122 |
|
|
}
|
123 |
|
|
return $settingvalue;
|
124 |
|
|
}
|
125 |
|
|
|
126 |
|
|
$filtersubmit = getGETPOSTsettingvalue('filtersubmit', null);
|
127 |
|
|
|
128 |
|
|
if ($filtersubmit) {
|
129 |
|
|
$filtertext = getGETPOSTsettingvalue('filtertext', "");
|
130 |
|
|
$filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
|
131 |
|
|
}
|
132 |
|
|
|
133 |
|
|
$filterlogentries_submit = getGETPOSTsettingvalue('filterlogentries_submit', null);
|
134 |
|
|
|
135 |
|
|
if ($filterlogentries_submit) {
|
136 |
|
|
$filterfieldsarray = array();
|
137 |
|
|
|
138 |
|
|
$filterfieldsarray['time'] = getGETPOSTsettingvalue('filterlogentries_time', null);
|
139 |
|
|
$filterfieldsarray['process'] = getGETPOSTsettingvalue('filterlogentries_process', null);
|
140 |
|
|
$filterfieldsarray['pid'] = getGETPOSTsettingvalue('filterlogentries_pid', null);
|
141 |
|
|
$filterfieldsarray['message'] = getGETPOSTsettingvalue('filterlogentries_message', null);
|
142 |
|
|
$filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
|
143 |
|
|
}
|
144 |
|
|
|
145 |
d8af270c
|
jim-p
|
$system_logfile = "{$g['varlog_path']}/" . basename($logfile) . ".log";
|
146 |
963d5343
|
Bill Marquette
|
|
147 |
5b237745
|
Scott Ullrich
|
$nentries = $config['syslog']['nentries'];
|
148 |
|
|
|
149 |
e3efcb23
|
NOYB
|
# Override Display Quantity
|
150 |
|
|
if ($filterlogentries_qty) {
|
151 |
|
|
$nentries = $filterlogentries_qty;
|
152 |
5f601060
|
Phil Davis
|
}
|
153 |
5b237745
|
Scott Ullrich
|
|
154 |
e3efcb23
|
NOYB
|
if (!$nentries || !is_numeric($nentries)) {
|
155 |
|
|
$nentries = 50;
|
156 |
5f601060
|
Phil Davis
|
}
|
157 |
0541e302
|
Scott Ullrich
|
|
158 |
e3efcb23
|
NOYB
|
if ($_POST['clear']) {
|
159 |
|
|
clear_log_file($system_logfile);
|
160 |
5f601060
|
Phil Davis
|
}
|
161 |
0541e302
|
Scott Ullrich
|
|
162 |
5f601060
|
Phil Davis
|
if ($filtertext) {
|
163 |
36a166de
|
Scott Ullrich
|
$filtertextmeta="?filtertext=$filtertext";
|
164 |
5f601060
|
Phil Davis
|
}
|
165 |
59769c23
|
Scott Ullrich
|
|
166 |
d8af270c
|
jim-p
|
/* Setup shortcuts if they exist */
|
167 |
|
|
|
168 |
|
|
if (!empty($allowed_logs[$logfile]["shortcut"])) {
|
169 |
|
|
$shortcut_section = $allowed_logs[$logfile]["shortcut"];
|
170 |
|
|
}
|
171 |
|
|
|
172 |
|
|
$pgtitle = array(gettext("Status"), gettext("System logs"), gettext($allowed_logs[$logfile]["name"]));
|
173 |
b63695db
|
Scott Ullrich
|
include("head.inc");
|
174 |
|
|
|
175 |
33d52df1
|
sbeaver
|
$tab_array = array();
|
176 |
0a5d0b7b
|
sbeaver
|
$tab_array[] = array(gettext("System"), ($logfile == 'system'), "diag_logs.php");
|
177 |
33d52df1
|
sbeaver
|
$tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
|
178 |
0a5d0b7b
|
sbeaver
|
$tab_array[] = array(gettext("DHCP"), ($logfile == 'dhcpd'), "diag_logs.php?logfile=dhcpd");
|
179 |
|
|
$tab_array[] = array(gettext("Portal Auth"), ($logfile == 'portalauth'), "diag_logs.php?logfile=portalauth");
|
180 |
|
|
$tab_array[] = array(gettext("IPsec"), ($logfile == 'ipsec'), "diag_logs.php?logfile=ipsec");
|
181 |
|
|
$tab_array[] = array(gettext("PPP"), ($logfile == 'ppp'), "diag_logs.php?logfile=ppp");
|
182 |
33d52df1
|
sbeaver
|
$tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
|
183 |
0a5d0b7b
|
sbeaver
|
$tab_array[] = array(gettext("Load Balancer"), ($logfile == 'relayd'), "diag_logs.php?logfile=relayd");
|
184 |
|
|
$tab_array[] = array(gettext("OpenVPN"), ($logfile == 'openvpn'), "diag_logs.php?logfile=openvpn");
|
185 |
|
|
$tab_array[] = array(gettext("NTP"), ($logfile == 'ntpd'), "diag_logs.php?logfile=ntpd");
|
186 |
33d52df1
|
sbeaver
|
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
|
187 |
|
|
display_top_tabs($tab_array);
|
188 |
|
|
|
189 |
|
|
$tab_array = array();
|
190 |
cb578e18
|
sbeaver
|
if (in_array($logfile, array('system', 'gateways', 'routing', 'resolver', 'wireless'))) {
|
191 |
0a5d0b7b
|
sbeaver
|
$tab_array[] = array(gettext("General"), ($logfile == 'system'), "/diag_logs.php");
|
192 |
|
|
$tab_array[] = array(gettext("Gateways"), ($logfile == 'gateways'), "/diag_logs.php?logfile=gateways");
|
193 |
|
|
$tab_array[] = array(gettext("Routing"), ($logfile == 'routing'), "/diag_logs.php?logfile=routing");
|
194 |
|
|
$tab_array[] = array(gettext("Resolver"), ($logfile == 'resolver'), "/diag_logs.php?logfile=resolver");
|
195 |
|
|
$tab_array[] = array(gettext("Wireless"), ($logfile == 'wireless'), "/diag_logs.php?logfile=wireless");
|
196 |
|
|
display_top_tabs($tab_array, false, 'nav nav-tabs');
|
197 |
|
|
}
|
198 |
33d52df1
|
sbeaver
|
|
199 |
e3efcb23
|
NOYB
|
if (!isset($config['syslog']['rawfilter'])) { // Advanced log filter form
|
200 |
|
|
$form = new Form(false);
|
201 |
33d52df1
|
sbeaver
|
|
202 |
e3efcb23
|
NOYB
|
$section = new Form_Section('Advanced Log Filter', 'adv-filter-panel', true);
|
203 |
33d52df1
|
sbeaver
|
|
204 |
e3efcb23
|
NOYB
|
$group = new Form_Group('');
|
205 |
|
|
|
206 |
|
|
$group->add(new Form_Input(
|
207 |
|
|
'filterlogentries_time',
|
208 |
|
|
null,
|
209 |
|
|
'text',
|
210 |
|
|
$filterfieldsarray['time']
|
211 |
|
|
))->setHelp('Time');
|
212 |
|
|
|
213 |
|
|
$group->add(new Form_Input(
|
214 |
|
|
'filterlogentries_process',
|
215 |
|
|
null,
|
216 |
|
|
'text',
|
217 |
|
|
$filterfieldsarray['process']
|
218 |
|
|
))->setHelp('Process');
|
219 |
|
|
|
220 |
|
|
$group->add(new Form_Input(
|
221 |
|
|
'filterlogentries_pid',
|
222 |
|
|
null,
|
223 |
|
|
'number',
|
224 |
|
|
$filterfieldsarray['pid']
|
225 |
|
|
))->setHelp('PID');
|
226 |
|
|
|
227 |
|
|
$group->add(new Form_Input(
|
228 |
|
|
'filterlogentries_qty',
|
229 |
|
|
null,
|
230 |
|
|
'number',
|
231 |
|
|
$filterlogentries_qty,
|
232 |
|
|
['placeholder' => $nentries]
|
233 |
|
|
))->setHelp('Quantity');
|
234 |
|
|
|
235 |
|
|
$section->add($group);
|
236 |
|
|
|
237 |
|
|
$group = new Form_Group('');
|
238 |
|
|
|
239 |
|
|
$group->add(new Form_Input(
|
240 |
|
|
'filterlogentries_message',
|
241 |
|
|
null,
|
242 |
|
|
'text',
|
243 |
|
|
$filterfieldsarray['message']
|
244 |
|
|
))->setHelp('Log Message');
|
245 |
16a597f6
|
NOYB
|
|
246 |
|
|
$btnsubmit = new Form_Button(
|
247 |
|
|
'filterlogentries_submit',
|
248 |
|
|
' ' . 'Apply Filter',
|
249 |
|
|
null,
|
250 |
|
|
'fa-filter'
|
251 |
|
|
);
|
252 |
e3efcb23
|
NOYB
|
}
|
253 |
|
|
else { // Simple log filter form
|
254 |
|
|
$form = new Form(false);
|
255 |
|
|
|
256 |
|
|
$section = new Form_Section('Log Filter', 'basic-filter-panel', true);
|
257 |
|
|
|
258 |
|
|
$group = new Form_Group('');
|
259 |
|
|
|
260 |
|
|
$group->add(new Form_Input(
|
261 |
|
|
'filtertext',
|
262 |
|
|
null,
|
263 |
|
|
'text',
|
264 |
|
|
$filtertext
|
265 |
|
|
))->setHelp('Filter Expression');
|
266 |
|
|
|
267 |
|
|
$group->add(new Form_Input(
|
268 |
|
|
'filterlogentries_qty',
|
269 |
|
|
null,
|
270 |
|
|
'number',
|
271 |
|
|
$filterlogentries_qty,
|
272 |
|
|
['placeholder' => $nentries]
|
273 |
|
|
))->setHelp('Quantity');
|
274 |
33d52df1
|
sbeaver
|
|
275 |
16a597f6
|
NOYB
|
$btnsubmit = new Form_Button(
|
276 |
|
|
'filtersubmit',
|
277 |
|
|
' ' . 'Apply Filter',
|
278 |
|
|
null,
|
279 |
|
|
'fa-filter'
|
280 |
|
|
);
|
281 |
|
|
}
|
282 |
9279147a
|
Stephen Beaver
|
|
283 |
|
|
$btnsubmit->removeClass('btn-primary')->addClass('btn-success')->addClass('btn-sm');
|
284 |
33d52df1
|
sbeaver
|
|
285 |
e3efcb23
|
NOYB
|
$group->add(new Form_StaticText(
|
286 |
9279147a
|
Stephen Beaver
|
'',
|
287 |
e3efcb23
|
NOYB
|
$btnsubmit
|
288 |
9279147a
|
Stephen Beaver
|
));
|
289 |
33d52df1
|
sbeaver
|
|
290 |
e3efcb23
|
NOYB
|
$group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . 'Regular expression reference</a> Precede with exclamation (!) to exclude match.');
|
291 |
|
|
$section->add($group);
|
292 |
33d52df1
|
sbeaver
|
$form->add($section);
|
293 |
|
|
print $form;
|
294 |
5b237745
|
Scott Ullrich
|
|
295 |
e3efcb23
|
NOYB
|
// Now the forms are complete we can draw the log table and its controls
|
296 |
|
|
if (!isset($config['syslog']['rawfilter'])) {
|
297 |
|
|
if ($filterlogentries_submit)
|
298 |
|
|
$filterlog = conv_log_filter($system_logfile, $nentries, $nentries + 100, $filterfieldsarray);
|
299 |
|
|
else
|
300 |
|
|
$filterlog = conv_log_filter($system_logfile, $nentries, $nentries + 100, $filtertext);
|
301 |
e0977fed
|
smos
|
?>
|
302 |
9279147a
|
Stephen Beaver
|
|
303 |
e3efcb23
|
NOYB
|
<div class="panel panel-default">
|
304 |
|
|
<div class="panel-heading">
|
305 |
|
|
<h2 class="panel-title">
|
306 |
|
|
<?php
|
307 |
|
|
if ((!$filtertext) && (!$filterfieldsarray))
|
308 |
|
|
printf(gettext("Last %d %s log entries."), count($filterlog), $logfile);
|
309 |
|
|
else
|
310 |
|
|
printf(gettext("%d matched %s log entries."), count($filterlog), $logfile);
|
311 |
|
|
|
312 |
|
|
printf(gettext(" (Maximum %d)"), $nentries);
|
313 |
|
|
?>
|
314 |
|
|
</h2>
|
315 |
|
|
</div>
|
316 |
|
|
<div class="panel-body">
|
317 |
|
|
<div class="table-responsive">
|
318 |
|
|
<table class="table table-striped table-hover table-compact">
|
319 |
|
|
<tr>
|
320 |
|
|
<th><?=gettext("Time")?></th>
|
321 |
|
|
<th><?=gettext("Process")?></th>
|
322 |
|
|
<th><?=gettext("PID")?></th>
|
323 |
|
|
<th style="width:100%"><?=gettext("Log Message")?></th>
|
324 |
|
|
</tr>
|
325 |
|
|
<?php
|
326 |
|
|
foreach ($filterlog as $filterent) {
|
327 |
|
|
?>
|
328 |
|
|
<tr>
|
329 |
|
|
<td style="white-space:nowrap;">
|
330 |
|
|
<?=htmlspecialchars($filterent['time'])?>
|
331 |
|
|
</td>
|
332 |
|
|
<td style="white-space:nowrap;">
|
333 |
|
|
<?=htmlspecialchars($filterent['process'])?>
|
334 |
|
|
</td>
|
335 |
|
|
<td style="white-space:nowrap;">
|
336 |
|
|
<?=htmlspecialchars($filterent['pid'])?>
|
337 |
|
|
</td>
|
338 |
|
|
<td style="word-wrap:break-word; word-break:break-all; white-space:normal">
|
339 |
|
|
<?=htmlspecialchars($filterent['message'])?>
|
340 |
|
|
</td>
|
341 |
|
|
</tr>
|
342 |
|
|
<?php
|
343 |
|
|
} // e-o-foreach
|
344 |
|
|
?>
|
345 |
|
|
</table>
|
346 |
|
|
</div>
|
347 |
|
|
</div>
|
348 |
|
|
</div>
|
349 |
|
|
<?php
|
350 |
|
|
if (count($filterlog) == 0)
|
351 |
|
|
print_info_box('No logs to display');
|
352 |
|
|
}
|
353 |
|
|
else
|
354 |
|
|
{
|
355 |
|
|
?>
|
356 |
5d7a0cca
|
sbeaver
|
<div class="panel panel-default">
|
357 |
f17594c7
|
Sjon Hortensius
|
<div class="panel-heading"><h2 class="panel-title"><?=gettext("Last ")?><?=$nentries?> <?=$logfile?><?=gettext(" log entries")?></h2></div>
|
358 |
ba6c5357
|
Stephen Beaver
|
<div class="table table-responsive">
|
359 |
|
|
<table class="table table-striped table-hover">
|
360 |
|
|
<thead>
|
361 |
|
|
<tr>
|
362 |
|
|
<th class="col-sm-2"></th>
|
363 |
|
|
<th></th>
|
364 |
|
|
</tr>
|
365 |
|
|
</thead>
|
366 |
|
|
<tbody>
|
367 |
|
|
<?php
|
368 |
288a2a0f
|
Phil Davis
|
if (($logfile == 'resolver') || ($logfile == 'system'))
|
369 |
5d7a0cca
|
sbeaver
|
$inverse = array("ppp");
|
370 |
|
|
else
|
371 |
|
|
$inverse = null;
|
372 |
|
|
|
373 |
288a2a0f
|
Phil Davis
|
if ($filtertext)
|
374 |
e3efcb23
|
NOYB
|
$rows = dump_clog($system_logfile, $nentries, true, array("$filtertext"), $inverse);
|
375 |
5d7a0cca
|
sbeaver
|
else
|
376 |
e3efcb23
|
NOYB
|
$rows = dump_clog($system_logfile, $nentries, true, array(), $inverse);
|
377 |
b63695db
|
Scott Ullrich
|
?>
|
378 |
ba6c5357
|
Stephen Beaver
|
</tbody>
|
379 |
|
|
</table>
|
380 |
|
|
</div>
|
381 |
5d7a0cca
|
sbeaver
|
</div>
|
382 |
e3efcb23
|
NOYB
|
<?php
|
383 |
|
|
if ($rows == 0)
|
384 |
|
|
print_info_box('No logs to display');
|
385 |
|
|
}
|
386 |
|
|
?>
|
387 |
|
|
|
388 |
|
|
<?php
|
389 |
|
|
$form = new Form(false);
|
390 |
|
|
|
391 |
|
|
$section = new Form_Section('Manage Log', 'log-manager-panel', true);
|
392 |
|
|
|
393 |
|
|
$group = new Form_Group('');
|
394 |
|
|
|
395 |
|
|
$btnclear = new Form_Button(
|
396 |
|
|
'clear',
|
397 |
|
|
' ' . 'Clear log',
|
398 |
|
|
null,
|
399 |
|
|
'fa-trash'
|
400 |
|
|
);
|
401 |
|
|
|
402 |
|
|
$btnclear->removeClass('btn-primary')->addClass('btn-danger')->addClass('btn-sm');
|
403 |
|
|
|
404 |
|
|
if ($logfile == 'dhcpd')
|
405 |
|
|
print_info_box('Warning: Clearing the log file will restart the DHCP daemon.');
|
406 |
|
|
|
407 |
|
|
$group->add(new Form_StaticText(
|
408 |
|
|
'',
|
409 |
|
|
$btnclear
|
410 |
|
|
));
|
411 |
|
|
|
412 |
|
|
$section->add($group);
|
413 |
|
|
$form->add($section);
|
414 |
|
|
print $form;
|
415 |
|
|
?>
|
416 |
33d52df1
|
sbeaver
|
|
417 |
c10cb196
|
Stephen Beaver
|
<?php include("foot.inc"); ?>
|