Project

General

Profile

Download (4.18 KB) Statistics
| Branch: | Tag: | Revision:
1 32887d33 Scott Ullrich
<?php
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 32887d33 Scott Ullrich
/*
4 ce77a9c4 Phil Davis
	diag_logs_ipsec.php
5 13d193c2 Scott Ullrich
	Copyright (C) 2004-2009 Scott Ullrich
6 ce77a9c4 Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
7 32887d33 Scott Ullrich
	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 13d193c2 Scott Ullrich
/*	
36
	pfSense_BUILDER_BINARIES:	/sbin/ifconfig	/usr/bin/awk	
37
	pfSense_MODULE:	ipsec
38
*/
39
40 6b07c15a Matthew Grooms
##|+PRIV
41
##|*IDENT=page-status-systemlogs-ipsecvpn
42
##|*NAME=Status: System logs: IPsec VPN page
43
##|*DESCR=Allow access to the 'Status: System logs: IPsec VPN' page.
44
##|*MATCH=diag_logs_ipsec.php*
45
##|-PRIV
46
47 32887d33 Scott Ullrich
require("guiconfig.inc");
48 483e6de8 Scott Ullrich
require("ipsec.inc");
49 32887d33 Scott Ullrich
50 bc7f52e2 Colin Smith
$ipsec_logfile = "{$g['varlog_path']}/ipsec.log";
51 4a2e189b Seth Mos
52 32887d33 Scott Ullrich
$nentries = $config['syslog']['nentries'];
53
if (!$nentries)
54
	$nentries = 50;
55
56 d6abaa18 Scott Ullrich
if ($_POST['clear']) 
57
	clear_log_file($ipsec_logfile);
58 32887d33 Scott Ullrich
59 eb3a6710 Seth Mos
$ipsec_logarr = return_clog($ipsec_logfile, $nentries);
60
61 f8ec8de4 Renato Botelho
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("IPsec VPN"));
62 b32dd0a6 jim-p
$shortcut_section = "ipsec";
63 b63695db Scott Ullrich
include("head.inc");
64 32887d33 Scott Ullrich
65 b63695db Scott Ullrich
?>
66 32887d33 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
67
<?php include("fbegin.inc"); ?>
68 e51b6dbf Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="logs ipsec">
69 0913a099 Erik Kristensen
 	<tr>
70
		<td>
71 b63695db Scott Ullrich
<?php
72
	$tab_array = array();
73 f8ec8de4 Renato Botelho
	$tab_array[] = array(gettext("System"), false, "diag_logs.php");
74
	$tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
75
	$tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
76
	$tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
77
	$tab_array[] = array(gettext("IPsec"), true, "diag_logs_ipsec.php");
78
	$tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
79
	$tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
80
	$tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
81
	$tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
82 ae2c143a jim-p
	$tab_array[] = array(gettext("NTP"), false, "diag_logs_ntpd.php");
83 f8ec8de4 Renato Botelho
	$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
84 b63695db Scott Ullrich
	display_top_tabs($tab_array);
85
?>
86 0913a099 Erik Kristensen
  		</td>
87
	</tr>
88
	<tr>
89
    	<td>
90
			<div id="mainarea">
91 e51b6dbf Colin Fleming
			<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
92 0913a099 Erik Kristensen
		  		<tr>
93 f8ec8de4 Renato Botelho
					<td colspan="2" class="listtopic"><?php printf(gettext("Last %s  IPsec log entries"),$nentries);?></td>
94 0913a099 Erik Kristensen
		  		</tr>
95 4a2e189b Seth Mos
				<?php
96
				foreach($ipsec_logarr as $logent){
97 7ee7ed46 jim-p
					$logent = htmlspecialchars($logent);
98 4a2e189b Seth Mos
					$logent = preg_split("/\s+/", $logent, 6);
99
					echo "<tr valign=\"top\">\n";
100
					$entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3)));
101 c1229525 Colin Fleming
					echo "<td class=\"listlr nowrap\">" . $entry_date_time  . "</td>\n";
102 4a2e189b Seth Mos
					echo "<td class=\"listr\">" . $logent[4] . " " . $logent[5] . "</td>\n";
103
					echo "</tr>\n";
104
				}
105
				?>
106 0913a099 Erik Kristensen
				<tr>
107
					<td>
108 8cd558b6 ayvis
						<br />
109 1a2da578 Scott Ullrich
						<form action="diag_logs_ipsec.php" method="post">
110 e51b6dbf Colin Fleming
						<input name="clear" type="submit" class="formbtn" value="<?=gettext("Clear log"); ?>" />
111 0913a099 Erik Kristensen
						</form>
112
					</td>
113
				</tr>
114
			</table>
115
			</div>
116
		</td>
117
	</tr>
118 32887d33 Scott Ullrich
</table>
119
<?php include("fend.inc"); ?>
120
</body>
121
</html>