Project

General

Profile

Download (3.67 KB) Statistics
| Branch: | Tag: | Revision:

univnautes / usr / local / www / diag_logs_dhcp.php @ a1b66bec

1
<?php
2
/* $Id$ */
3
/*
4
	diag_logs_dhcp.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:	dhcpserver
36
*/
37

    
38
##|+PRIV
39
##|*IDENT=page-diagnostics-logs-dhcp
40
##|*NAME=Diagnostics: Logs: DHCP page
41
##|*DESCR=Allow access to the 'Diagnostics: Logs: DHCP' page.
42
##|*MATCH=diag_logs_dhcp.php*
43
##|-PRIV
44

    
45
require("guiconfig.inc");
46

    
47
$dhcpd_logfile = "{$g['varlog_path']}/dhcpd.log";
48

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

    
53
if ($_POST['clear']) {
54
	clear_log_file($dhcpd_logfile);
55
	killbyname("dhcpd");
56
	services_dhcpd_configure();
57
}
58

    
59
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("DHCP"));
60
$shortcut_section = "dhcp";
61
include("head.inc");
62

    
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 dhcp">
68
  <tr><td>
69
<?php
70
	$tab_array = array();
71
	$tab_array[] = array(gettext("System"), false, "diag_logs.php");
72
	$tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
73
	$tab_array[] = array(gettext("DHCP"), true, "diag_logs_dhcp.php");
74
	$tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
75
	$tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php");
76
	$tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
77
	$tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
78
	$tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
79
	$tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
80
	$tab_array[] = array(gettext("NTP"), false, "diag_logs_ntpd.php");
81
	$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
82
	display_top_tabs($tab_array);
83
?>
84
  </td></tr>
85
  <tr>
86
    <td>
87
	<div id="mainarea">
88
		<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
89
		  <tr>
90
			<td colspan="2" class="listtopic">
91
			  <?php printf(gettext("Last %s DHCP service log entries"), $nentries);?></td>
92
		  </tr>
93
		  <?php dump_clog($dhcpd_logfile, $nentries); ?>
94
		<tr><td><br /><form action="diag_logs_dhcp.php" method="post">
95
			<input name="clear" type="submit" class="formbtn" value="<?= gettext("Clear log");?>" /></form></td>
96
			<td>NOTE: Clearing the log file will restart the DHCP daemon.</td></tr>
97
		</table>
98
	</div>
99
	</td>
100
  </tr>
101
</table>
102
<?php include("fend.inc"); ?>
103
</body>
104
</html>
(22-22/256)