1
|
<?php
|
2
|
/* $Id$ */
|
3
|
/*
|
4
|
diag_logs.php
|
5
|
Copyright (C) 2004-2009 Scott Ullrich
|
6
|
All rights reserved.
|
7
|
|
8
|
originally part of m0n0wall (http://m0n0.ch/wall)
|
9
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
10
|
All rights reserved.
|
11
|
|
12
|
Redistribution and use in source and binary forms, with or without
|
13
|
modification, are permitted provided that the following conditions are met:
|
14
|
|
15
|
1. Redistributions of source code must retain the above copyright notice,
|
16
|
this list of conditions and the following disclaimer.
|
17
|
|
18
|
2. Redistributions in binary form must reproduce the above copyright
|
19
|
notice, this list of conditions and the following disclaimer in the
|
20
|
documentation and/or other materials provided with the distribution.
|
21
|
|
22
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
23
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
24
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
25
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
26
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
27
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
31
|
POSSIBILITY OF SUCH DAMAGE.
|
32
|
*/
|
33
|
|
34
|
/*
|
35
|
pfSense_MODULE: system
|
36
|
*/
|
37
|
|
38
|
##|+PRIV
|
39
|
##|*IDENT=page-diagnostics-logs-system
|
40
|
##|*NAME=Diagnostics: Logs: System page
|
41
|
##|*DESCR=Allow access to the 'Diagnostics: Logs: System' page.
|
42
|
##|*MATCH=diag_logs.php*
|
43
|
##|-PRIV
|
44
|
|
45
|
require("guiconfig.inc");
|
46
|
|
47
|
$system_logfile = "{$g['varlog_path']}/system.log";
|
48
|
|
49
|
$nentries = $config['syslog']['nentries'];
|
50
|
if (!$nentries)
|
51
|
$nentries = 50;
|
52
|
|
53
|
if ($_POST['clear'])
|
54
|
clear_log_file($system_logfile);
|
55
|
|
56
|
if ($_GET['filtertext'])
|
57
|
$filtertext = htmlspecialchars($_GET['filtertext']);
|
58
|
|
59
|
if ($_POST['filtertext'])
|
60
|
$filtertext = htmlspecialchars($_POST['filtertext']);
|
61
|
|
62
|
if ($filtertext)
|
63
|
$filtertextmeta="?filtertext=$filtertext";
|
64
|
|
65
|
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("General"));
|
66
|
include("head.inc");
|
67
|
|
68
|
?>
|
69
|
|
70
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
71
|
<?php include("fbegin.inc"); ?>
|
72
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="logs system">
|
73
|
<tr>
|
74
|
<td>
|
75
|
<?php
|
76
|
$tab_array = array();
|
77
|
$tab_array[] = array(gettext("System"), true, "diag_logs.php");
|
78
|
$tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
|
79
|
$tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
|
80
|
$tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
|
81
|
$tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php");
|
82
|
$tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
|
83
|
$tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
|
84
|
$tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
|
85
|
$tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
|
86
|
$tab_array[] = array(gettext("NTP"), false, "diag_logs_ntpd.php");
|
87
|
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
|
88
|
display_top_tabs($tab_array);
|
89
|
?>
|
90
|
</td>
|
91
|
</tr>
|
92
|
<tr><td class="tabnavtbl">
|
93
|
<?php
|
94
|
$tab_array = array();
|
95
|
$tab_array[] = array(gettext("General"), true, "/diag_logs.php");
|
96
|
$tab_array[] = array(gettext("Gateways"), false, "/diag_logs_gateways.php");
|
97
|
$tab_array[] = array(gettext("Routing"), false, "/diag_logs_routing.php");
|
98
|
$tab_array[] = array(gettext("Resolver"), false, "/diag_logs_resolver.php");
|
99
|
$tab_array[] = array(gettext("Wireless"), false, "/diag_logs_wireless.php");
|
100
|
display_top_tabs($tab_array);
|
101
|
?>
|
102
|
</td>
|
103
|
</tr>
|
104
|
<tr>
|
105
|
<td>
|
106
|
<div id="mainarea">
|
107
|
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
|
108
|
<tr>
|
109
|
<td colspan="2" class="listtopic"><?php printf(gettext("Last %s system log entries"),$nentries); ?></td>
|
110
|
</tr>
|
111
|
<?php
|
112
|
if($filtertext)
|
113
|
dump_clog($system_logfile, $nentries, true, array("$filtertext"), array("ppp"));
|
114
|
else
|
115
|
dump_clog($system_logfile, $nentries, true, array(), array("ppp"));
|
116
|
?>
|
117
|
<tr>
|
118
|
<td align="left" valign="top">
|
119
|
<form id="filterform" name="filterform" action="diag_logs.php" method="post" style="margin-top: 14px;">
|
120
|
<input id="submit" name="clear" type="submit" class="formbtn" value="<?=gettext("Clear log");?>" />
|
121
|
</form>
|
122
|
</td>
|
123
|
<td align="right" valign="top" >
|
124
|
<form id="clearform" name="clearform" action="diag_logs.php" method="post" style="margin-top: 14px;">
|
125
|
<input id="filtertext" name="filtertext" value="<?=$filtertext;?>" />
|
126
|
<input id="filtersubmit" name="filtersubmit" type="submit" class="formbtn" value="<?=gettext("Filter");?>" />
|
127
|
</form>
|
128
|
</td>
|
129
|
</tr>
|
130
|
</table>
|
131
|
</div>
|
132
|
</td>
|
133
|
</tr>
|
134
|
</table>
|
135
|
<?php include("fend.inc"); ?>
|
136
|
</body>
|
137
|
</html>
|