Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
318 richard 1
<?php 
2
/*
3
 * firewall Eyes
4
 * Copyright (C) 2004 Creabilis
5
 * 
6
 * This program is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 2 of the License, or (at
9
 * your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful, but
12
 * WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
 *
20
 */
21
include("configuration.php");
22
include("include.php");
23
 
24
// authentification check
25
authenticationCheck();
26
 
27
// Date in the past
28
header("Expires: Mon, 26 Jul 2004 00:00:00 GMT");
29
 
30
// always modified
31
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
32
 
33
// HTTP/1.1
34
header("Cache-Control: no-store, no-cache, must-revalidate");
35
header("Cache-Control: post-check=0, pre-check=0", false);
36
 
37
// HTTP/1.0
38
header("Pragma: no-cache");
39
 
40
set_time_limit (300);
41
 
42
 
43
// TODO:
44
// predifined filters : all accept, all dropped/rejected
45
 
46
//line example :
47
//Sep 24 18:07:35 passerelle kernel: RULE 14 -- ACCEPT IN=eth1 OUT= MAC=00:04:e2:43:1c:c4:00:0b:cd:f9:f4:42:08:00 SRC=172.31.200.189 DST=172.31.1.253 LEN=48 TOS=0x00 PREC=0x00 TTL=128 ID=11059 DF PROTO=TCP SPT=1537 DPT=8080 WINDOW=65535 RES=0x00 SYN URGP=0 
48
 
49
$logfile=$configuration["logfile"];
50
$displayedLines=($_GET["displayedLines"] ? $_GET["displayedLines"] : $configuration["displayedLines"]);
51
 
52
$configurationVars=Array("resolvIp","resolvService","readFromTheEnd","exactSearch","automaticRefresh");
53
foreach($configurationVars as $confVarName) {
54
	${$confVarName}=($_GET["searchAction"] ? $_GET[$confVarName] : $configuration[$confVarName]);
55
 
56
}
57
 
58
// init
59
$lineCount=0;
60
$indexForAction=getIndexForColumn("action",$logFields);
61
$indexForProtocol=getIndexForColumn("protocol",$logFields);
62
// get inputs
63
$criteria=$_GET["criteria"];
64
 
65
$maxWidth=0;
66
for($i=0; $i<count($logFields); $i++) {
67
	$maxWidth+=$logFields[$i][2];
68
}
69
?>
70
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
71
<html>
72
	<head>
73
		<title>Creabilis fw-Eyes</title>
74
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
75
		<link href="log.css" rel="stylesheet" type="text/css"/>
76
		<script>
77
		function myrefresh() {
78
			<?php if ($automaticSubmit) {?>
79
			document.forms["search"].submit()
80
			<?php } ?>
81
		}
82
			</script>
83
	</head>
84
 
85
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF">
86
 
87
<table width="100%" height="100" border="0" cellpadding="0" cellspacing="0" background="images/header-background.jpg">
88
  <tr>
89
	<td valign="bottom" align="left" style="padding-left:19px"> 
90
		  <form method="GET" action="logs.php" style="margin: 0px;padding: 0px;" name="search" target="mainFrame">
91
				<INPUT type="hidden" name="searchAction" value="1">
92
 
93
				<div class="topbox" > 
94
				</div>
95
 
96
		<table border="0" cellpadding="0" cellspacing="0" width="<?=$maxWidth?>">
97
		  <tr> 
98
			<td rowspan="2" valign="top"><img src="images/logo-firewallEyes.gif" width="58" height="38" align="top"><img src="images/firewallEyes.jpg" width="199" height="48" align="top"></td>
99
			<td align="right" class="topbox"> lignes&nbsp;affich&eacute;es&nbsp; 
100
			  <input name="displayedLines" type="text" class="inputText" style="width:30 px;" size="3" maxlength="6" value="<?=htmlentities(stripslashes($displayedLines))?>" onChange="myrefresh()"> 
101
			  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fichier&nbsp;log&nbsp; <select name="logfile2display" class="inputText" onChange="myrefresh()">
102
				<?php
103
				foreach($logfiles as $currentIndex=>$currentLogfile) {
104
				?>
105
				<option value="<?=htmlspecialchars($currentIndex)?>"> 
106
				<?=htmlspecialchars($currentLogfile)?>
107
				</option>
108
				<?php
109
				}
110
				?>
111
			  </select> &nbsp;&nbsp; <input type="checkbox" name="readFromTheEnd" id="readFromTheEnd" value="1" <?= ($readFromTheEnd ? "checked" : "")?> onClick="myrefresh()"> 
112
			  <label for="readFromTheEnd">&nbsp;lecture&nbsp;depuis&nbsp;la&nbsp;fin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label></td>
113
		  </tr>
114
		  <tr> 
115
			<td colspan="<?=count($logFields)?>" align="left" class="topbox"> 
116
			  <input type="checkbox" name="automaticRefresh" id="automaticRefresh" value="1" <?= ($automaticRefresh ? "checked" : "")?> onClick="myrefresh()"> 
117
			  <label for="automaticRefresh">raffraichissement auto&nbsp;&nbsp;</label>
118
			  <input type="checkbox" name="resolvIp" id="resolvIp" value="1" <?= ($resolvIp ? "checked" : "")?> onClick="myrefresh()"> 
119
			  <label for="resolvIp">resolv&nbsp;IP&nbsp;&nbsp;</label> 
120
			  <input type="checkbox" name="resolvService" id="resolvService" value="1" <?= ($resolvService ? "checked" : "")?> onClick="myrefresh()"> 
121
			  <label for="resolvService">resolv&nbsp;services&nbsp;&nbsp;</label> 
122
			  <input type="checkbox" name="exactSearch" id="exactSearch" value="1" <?= ($exactSearch ? "checked" : "")?> onClick="myrefresh()">
123
			  <label for="exactSearch">recherche&nbsp;exacte&nbsp;&nbsp;</label> 
124
			  <input class="button" type="submit" value="Afficher"> 
125
			  <!--&nbsp;&nbsp;<input class="button" type="button" value="reset" onClick="top.window.location='index.html'">-->
126
			</td>
127
		  </tr>
128
		</table>	
129
				<table border="0" cellpadding="0" cellspacing="0" width="<?=$maxWidth?>">
130
					<tr>
131
			<?php 
132
				// tab header
133
				for($i=0; $i<count($logFields); $i++) { 
134
					?><td class="header"><span style="width: <?=$logFields[$i][2]?>px" class="header">&nbsp;<?=$logFields[$i][0]?></span>
135
					</td><?php 
136
				}?>
137
					</tr>
138
					<tr>
139
						<?php 
140
						// search form
141
						for($i=0; $i<count($logFields); $i++) { 
142
							?><td><span style="width: <?=$logFields[$i][2]?>px"><input type="text" name="criteria[<?=htmlentities($logFields[$i][0])?>]" value="<?=htmlentities(stripslashes($criteria[$logFields[$i][0]]))?>" style="width: <?=$logFields[$i][2]?>px" class="inputText" onChange="myrefresh()"></span>
143
							</td>
144
							<?php 
145
 
146
						}?>
147
					</tr>
148
				</table>
149
		  </form>
150
		</td>
151
	</tr>
152
	</table>
153
	</body>
154
</html>