Project

General

Profile

Download (4.38 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	diag_logs.php
5
	Copyright (C) 2004-2009 Scott Ullrich
6
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
7
	All rights reserved.
8

    
9
	originally part of m0n0wall (http://m0n0.ch/wall)
10
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
11
	All rights reserved.
12

    
13
	Redistribution and use in source and binary forms, with or without
14
	modification, are permitted provided that the following conditions are met:
15

    
16
	1. Redistributions of source code must retain the above copyright notice,
17
	   this list of conditions and the following disclaimer.
18

    
19
	2. Redistributions in binary form must reproduce the above copyright
20
	   notice, this list of conditions and the following disclaimer in the
21
	   documentation and/or other materials provided with the distribution.
22

    
23
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
27
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
	POSSIBILITY OF SUCH DAMAGE.
33
*/
34

    
35
/*		
36
	pfSense_MODULE:	system
37
*/
38

    
39
##|+PRIV
40
##|*IDENT=page-diagnostics-logs-system
41
##|*NAME=Diagnostics: Logs: System page
42
##|*DESCR=Allow access to the 'Diagnostics: Logs: System' page.
43
##|*MATCH=diag_logs.php*
44
##|-PRIV
45

    
46
require("guiconfig.inc");
47

    
48
$system_logfile = "{$g['varlog_path']}/system.log";
49

    
50
$nentries = $config['syslog']['nentries'];
51
if (!$nentries)
52
	$nentries = 50;
53

    
54
if ($_POST['clear']) 
55
	clear_log_file($system_logfile);
56

    
57
if ($_GET['filtertext'])
58
	$filtertext = htmlspecialchars($_GET['filtertext']);
59

    
60
if ($_POST['filtertext'])
61
	$filtertext = htmlspecialchars($_POST['filtertext']);
62

    
63
if ($filtertext)
64
	$filtertextmeta="?filtertext=$filtertext";
65

    
66
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("General"));
67
include("head.inc");
68

    
69
$tab_array = array();
70
$tab_array[] = array(gettext("System"), true, "diag_logs.php");
71
$tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
72
$tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
73
$tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
74
$tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php");
75
$tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
76
$tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
77
$tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
78
$tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
79
$tab_array[] = array(gettext("NTP"), false, "diag_logs_ntpd.php");
80
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
81
display_top_tabs($tab_array);
82

    
83
$tab_array = array();
84
$tab_array[] = array(gettext("General"), true, "/diag_logs.php");
85
$tab_array[] = array(gettext("Gateways"), false, "/diag_logs_gateways.php");
86
$tab_array[] = array(gettext("Routing"), false, "/diag_logs_routing.php");
87
$tab_array[] = array(gettext("Resolver"), false, "/diag_logs_resolver.php");
88
$tab_array[] = array(gettext("Wireless"), false, "/diag_logs_wireless.php");
89
display_top_tabs($tab_array, false, 'nav nav-tabs');
90

    
91
require('classes/Form.class.php');
92

    
93
$form = new Form(false);
94

    
95
$section = new Form_Section('Log file filter');
96

    
97
$section->addInput(new Form_Input(
98
	'filtertext',
99
	'Filter',
100
	'text',
101
	$filtertext,
102
	['placeholder' => 'Filter text']
103
));
104

    
105
$form->addGlobal(new Form_Button(
106
	'filtersubmit',
107
	'Filter'
108
))->removeClass('btn-primary')->addClass('btn-default')->addClass('btn-sm');
109

    
110
$form->addGlobal(new Form_Button(
111
	'clear',
112
	'Clear log'
113
))->removeClass('btn-primary')->addClass('btn-danger')->addClass('btn-sm');
114

    
115
$form->add($section);
116
print $form;
117

    
118
?>
119
    <div class="panel panel-default">
120
        <div class="panel-heading"><?=gettext("Last ")?><?=$nentries?><?=gettext(" log entries")?></div>
121
	    <pre>
122
<?php
123
    	if($filtertext)
124
    		dump_clog_no_table($system_logfile, $nentries, true, array("$filtertext"), array("ppp"));
125
    	else
126
    		dump_clog_no_table($system_logfile, $nentries, true, array(), array("ppp"));
127
?>
128
    	</pre>
129
	</div>
130

    
131
<?php include("foot.inc"); ?>
(20-20/252)