Project

General

Profile

Download (4.83 KB) Statistics
| Branch: | Tag: | Revision:
1 cfc707f7 Scott Ullrich
<?php
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
	diag_logs.php
5 13d193c2 Scott Ullrich
	Copyright (C) 2004-2009 Scott Ullrich
6 cfc707f7 Scott Ullrich
	All rights reserved.
7
8
	originally part of m0n0wall (http://m0n0.ch/wall)
9 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
	All rights reserved.
11 cfc707f7 Scott Ullrich
12 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14 cfc707f7 Scott Ullrich
15 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17 cfc707f7 Scott Ullrich
18 5b237745 Scott Ullrich
	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 cfc707f7 Scott Ullrich
22 5b237745 Scott Ullrich
	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 13d193c2 Scott Ullrich
/*		
35
	pfSense_MODULE:	system
36
*/
37
38 6b07c15a Matthew Grooms
##|+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 5b237745 Scott Ullrich
require("guiconfig.inc");
46
47 963d5343 Bill Marquette
$system_logfile = "{$g['varlog_path']}/system.log";
48
49 5b237745 Scott Ullrich
$nentries = $config['syslog']['nentries'];
50
if (!$nentries)
51
	$nentries = 50;
52
53 d6abaa18 Scott Ullrich
if ($_POST['clear']) 
54
	clear_log_file($system_logfile);
55 5b237745 Scott Ullrich
56 0541e302 Scott Ullrich
if ($_GET['filtertext'])
57 daab67a1 Scott Ullrich
	$filtertext = htmlspecialchars($_GET['filtertext']);
58 0541e302 Scott Ullrich
59
if ($_POST['filtertext'])
60 daab67a1 Scott Ullrich
	$filtertext = htmlspecialchars($_POST['filtertext']);
61 0541e302 Scott Ullrich
62 59769c23 Scott Ullrich
if ($filtertext)
63 36a166de Scott Ullrich
	$filtertextmeta="?filtertext=$filtertext";
64 59769c23 Scott Ullrich
65 e0977fed smos
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("General"));
66 b63695db Scott Ullrich
include("head.inc");
67
68 5b237745 Scott Ullrich
?>
69
70
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
71
<?php include("fbegin.inc"); ?>
72
<table width="100%" border="0" cellpadding="0" cellspacing="0">
73 0913a099 Erik Kristensen
	<tr>
74
		<td>
75 b63695db Scott Ullrich
<?php
76
	$tab_array = array();
77 f8ec8de4 Renato Botelho
	$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 ae2c143a jim-p
	$tab_array[] = array(gettext("NTP"), false, "diag_logs_ntpd.php");
87 f8ec8de4 Renato Botelho
	$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
88 b63695db Scott Ullrich
	display_top_tabs($tab_array);
89 e0977fed smos
?>
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 e0c45357 jim-p
	$tab_array[] = array(gettext("Routing"), false, "/diag_logs_routing.php");
98 e0977fed smos
	$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 b63695db Scott Ullrich
?>
102 0913a099 Erik Kristensen
		</td>
103
	</tr>
104
	<tr>
105
		<td>
106
			<div id="mainarea">
107
			<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
108
				<tr>
109 f8ec8de4 Renato Botelho
					<td colspan="2" class="listtopic"><?php printf(gettext("Last %s system log entries"),$nentries); ?></td>
110 0913a099 Erik Kristensen
				</tr>
111 0541e302 Scott Ullrich
				<?php
112
					if($filtertext)
113 295e19dd Scott Ullrich
						dump_clog($system_logfile, $nentries, true, array("$filtertext"), array("ppp"));
114 0541e302 Scott Ullrich
					else
115 295e19dd Scott Ullrich
						dump_clog($system_logfile, $nentries, true, array(), array("ppp"));
116 0541e302 Scott Ullrich
				?>
117 0913a099 Erik Kristensen
				<tr>
118 0541e302 Scott Ullrich
					<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 f8ec8de4 Renato Botelho
              				<input id="filtertext" name="filtertext" value="<?=$filtertext;?>" />
126 0541e302 Scott Ullrich
              				<input id="filtersubmit" name="filtersubmit" type="submit" class="formbtn" value="<?=gettext("Filter");?>" />
127 0913a099 Erik Kristensen
						</form>
128
					</td>
129
				</tr>
130
			</table>
131
	    	</div>
132
		</td>
133
	</tr>
134 5b237745 Scott Ullrich
</table>
135
<?php include("fend.inc"); ?>
136
</body>
137
</html>