Project

General

Profile

Download (4.32 KB) Statistics
| Branch: | Tag: | Revision:
1 55f3ca1d gnhb
<?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_BUILDER_BINARIES:	/sbin/ifconfig	/usr/bin/awk	
36
	pfSense_MODULE:
37
*/
38
39
##|+PRIV
40
##|*IDENT=page-status-systemlogs-ppp
41
##|*NAME=Status: System logs: IPsec VPN page
42
##|*DESCR=Allow access to the 'Status: System logs: IPsec VPN' page.
43
##|*MATCH=diag_logs_ppp.php*
44
##|-PRIV
45
46
require("guiconfig.inc");
47
48
$ppp_logfile = "{$g['varlog_path']}/ppp.log";
49
50
$nentries = $config['syslog']['nentries'];
51
if (!$nentries)
52
	$nentries = 50;
53
54
if ($_POST['clear']) 
55
	clear_log_file($ppp_logfile);
56
57
$ppp_logarr = return_clog($ppp_logfile, $nentries);
58
59 f8ec8de4 Renato Botelho
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("PPP"));
60 55f3ca1d gnhb
include("head.inc");
61
62
?>
63
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
64
<?php include("fbegin.inc"); ?>
65
<table width="100%" border="0" cellpadding="0" cellspacing="0">
66
 	<tr>
67
		<td>
68
<?php
69
	$tab_array = array();
70 f8ec8de4 Renato Botelho
	$tab_array[] = array(gettext("System"), false, "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"), true, "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 ae2c143a jim-p
	$tab_array[] = array(gettext("NTP"), false, "diag_logs_ntpd.php");
80 f8ec8de4 Renato Botelho
	$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
81 55f3ca1d gnhb
	display_top_tabs($tab_array);
82
?>
83
  		</td>
84
	</tr>
85
	<tr>
86
    	<td>
87
			<div id="mainarea">
88
			<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
89
		  		<tr>
90 d1d0a1ad Vinicius Coque
					<td colspan="2" class="listtopic"><?php printf(gettext("Last %s PPP log entries"),$nentries);?></td>
91 55f3ca1d gnhb
		  		</tr>
92
				<?php
93
				foreach($ppp_logarr as $logent){
94
					if(isset($match)) {
95
						$logent = preg_replace($search, $replace, $logent);
96
					} else {
97
						$searchs = "/(racoon: )([A-Z:].*?)([0-9].+\.[0-9].+.[0-9].+.[0-9].+\[[0-9].+\])(.*)/i";
98 f8ec8de4 Renato Botelho
						$replaces = "$1<strong><font color=red>[".gettext("Unknown Gateway/Dynamic")."]</font></strong>: $2$3$4";
99 55f3ca1d gnhb
						$logent = preg_replace($searchs, $replaces, $logent);
100
					}
101
					$logent = preg_split("/\s+/", $logent, 6);
102
					echo "<tr valign=\"top\">\n";
103
					$entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3)));
104
					echo "<td class=\"listlr\" nowrap>" . $entry_date_time  . "</td>\n";
105
					echo "<td class=\"listr\">" . $logent[4] . " " . $logent[5] . "</td>\n";
106
					echo "</tr>\n";
107
				}
108
				?>
109
				<tr>
110
					<td>
111
						<br>
112
						<form action="diag_logs_ppp.php" method="post">
113 0c6342cd Carlos Eduardo Ramos
						<input name="clear" type="submit" class="formbtn" value="<?=gettext("Clear log"); ?>">
114 55f3ca1d gnhb
						</form>
115
					</td>
116
				</tr>
117
			</table>
118
			</div>
119
		</td>
120
	</tr>
121
</table>
122
<?php include("fend.inc"); ?>
123
</body>
124
</html>