Projet

Général

Profil

Télécharger (4,13 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / diag_logs_ipsec.php @ 537940c8

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_BUILDER_BINARIES:	/sbin/ifconfig	/usr/bin/awk	
36
	pfSense_MODULE:	ipsec
37
*/
38

    
39
##|+PRIV
40
##|*IDENT=page-status-systemlogs-ipsecvpn
41
##|*NAME=Status: System logs: IPsec VPN page
42
##|*DESCR=Allow access to the 'Status: System logs: IPsec VPN' page.
43
##|*MATCH=diag_logs_ipsec.php*
44
##|-PRIV
45

    
46
require("guiconfig.inc");
47
require("ipsec.inc");
48

    
49
$ipsec_logfile = "{$g['varlog_path']}/ipsec.log";
50

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

    
55
if ($_POST['clear']) 
56
	clear_log_file($ipsec_logfile);
57

    
58
$ipsec_logarr = return_clog($ipsec_logfile, $nentries);
59

    
60
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("IPsec VPN"));
61
$shortcut_section = "ipsec";
62
include("head.inc");
63

    
64
?>
65
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
66
<?php include("fbegin.inc"); ?>
67
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="logs ipsec">
68
 	<tr>
69
		<td>
70
<?php
71
	$tab_array = array();
72
	$tab_array[] = array(gettext("System"), false, "diag_logs.php");
73
	$tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
74
	$tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
75
	$tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
76
	$tab_array[] = array(gettext("IPsec"), true, "diag_logs_ipsec.php");
77
	$tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
78
	$tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
79
	$tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
80
	$tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
81
	$tab_array[] = array(gettext("NTP"), false, "diag_logs_ntpd.php");
82
	$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
83
	display_top_tabs($tab_array);
84
?>
85
  		</td>
86
	</tr>
87
	<tr>
88
    	<td>
89
			<div id="mainarea">
90
			<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
91
		  		<tr>
92
					<td colspan="2" class="listtopic"><?php printf(gettext("Last %s  IPsec log entries"),$nentries);?></td>
93
		  		</tr>
94
				<?php
95
				foreach($ipsec_logarr as $logent){
96
					$logent = htmlspecialchars($logent);
97
					$logent = preg_split("/\s+/", $logent, 6);
98
					echo "<tr valign=\"top\">\n";
99
					$entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3)));
100
					echo "<td class=\"listlr nowrap\">" . $entry_date_time  . "</td>\n";
101
					echo "<td class=\"listr\">" . $logent[4] . " " . $logent[5] . "</td>\n";
102
					echo "</tr>\n";
103
				}
104
				?>
105
				<tr>
106
					<td>
107
						<br />
108
						<form action="diag_logs_ipsec.php" method="post">
109
						<input name="clear" type="submit" class="formbtn" value="<?=gettext("Clear log"); ?>" />
110
						</form>
111
					</td>
112
				</tr>
113
			</table>
114
			</div>
115
		</td>
116
	</tr>
117
</table>
118
<?php include("fend.inc"); ?>
119
</body>
120
</html>
(26-26/255)