Subversion Repositories ALCASAR

Rev

Rev 1858 | Rev 2292 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
1163 crox53 1
<?php
2
//gestion de la langue
3
if (is_file("../lib/langues.php"))
4
	include("../lib/langues.php");
5
?>
1201 crox53 6
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN//2.0">
7
<HTML>
8
<!-- written by Crox -->
9
<HEAD>
10
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
11
<TITLE>menu</TITLE>
1858 raphael.pi 12
<link rel="stylesheet" href="../../../css/bootstrap.min.css">
13
  <script src="../../../js/jquery.min.js"></script>
14
  <script src="../../../js/bootstrap.min.js"></script>
1867 raphael.pi 15
  <style>
16
 body {
17
    background-color: #EFEFEF;
18
	}
19
  </style>
1201 crox53 20
</HEAD>
1163 crox53 21
<body>
1410 richard 22
 
23
 
24
 
25
<?php
26
	$table = 1;
27
	if(isset($_GET['table'])){
28
		$table = $_GET['table'];
29
	}
30
?>
31
 
32
 
33
<?php
34
 
35
echo'
36
	<br />
1858 raphael.pi 37
			<div class="btn-group btn-group-justified" role="group" aria-label="Justified button group"> 
38
			<a href="./security.php?table=1" class="btn btn-default" role="button">'.$l_spoofing.'</a> 
39
			<a href="./security.php?table=2" class="btn btn-default" role="button">'.$l_virus.'</a>
40
			<a href="./security.php?table=3" class="btn btn-default" role="button">'.$l_fail2ban.'</a>  
41
			</div>
1410 richard 42
	<br />';
43
 
44
 
45
?>
46
 
47
 
48
<?php
49
 
50
if ( $table == 1){
51
 
1858 raphael.pi 52
	echo '<center><h3>';
53
	echo "$l_spoofing";
54
	echo '</h3></center><div class="container"><table class="table table-striped"><tbody>';
1410 richard 55
 
1858 raphael.pi 56
	$fichier='/var/Save/security/watchdog.log';
57
	$pointeur=fopen($fichier,"r");
58
	if ($pointeur){
59
	while (!feof($pointeur)){
60
		$ligne=fgets($pointeur);
61
		echo "<tr><td>$ligne</td></tr>";
62
		}
63
	}
64
	else
65
	{
66
		echo '<tr><center>Empty</center></tr>';
67
	}
68
	fclose($pointeur);
69
	echo '</tbody></table></div>';
1410 richard 70
 
71
 
72
} elseif ($table == 2){
1858 raphael.pi 73
	echo '<center><h3>';
74
	echo "$l_virus";
75
	echo '</h3></center><div class="container"><table class="table table-striped"><tbody>';
76
 
77
	$fichier='/var/log/havp/access.log';
78
	$pointeur=fopen($fichier,"r");
79
	if ($pointeur){
80
	while (!feof($pointeur)){
81
		$ligne=fgets($pointeur);
82
		echo "<tr><td>$ligne</td></tr>";
83
		}
84
	}
85
	else
86
	{
87
		echo '<tr><center>Empty</center></tr>';
88
	}
89
	fclose($pointeur);
90
	echo '</tbody></table></div>';
91
 
1410 richard 92
} elseif ($table == 3){
1858 raphael.pi 93
	echo '<center><h3>';
94
	echo "$l_fail2ban";
95
	echo '</h3></center><div class="container"><table class="table table-striped"><tbody>';
1410 richard 96
 
1858 raphael.pi 97
	$fichier='/var/log/fail2ban.log';
98
	$unban="/Unban/";
99
	$ban="/Ban/";
100
	$pointeur=fopen($fichier,"r");
101
	if ($pointeur){
102
		while (!feof($pointeur)){
103
			$ligne=fgets($pointeur);
104
			if(preg_match($ban,$ligne,$r)){
105
				echo "<tr><td><font color='red'>$ligne</font></td></tr>";
106
			}
107
			if(preg_match($unban,$ligne,$r)){
108
				echo "<tr><td><font color='orange'>$ligne</font></td></tr>";
109
			}
110
		}
1163 crox53 111
			fclose($pointeur);
1858 raphael.pi 112
	}
113
	else
114
	{
115
		echo '<tr><center>Empty</center></tr>';
116
	}
117
	echo '</tbody></table></div>';
1410 richard 118
} else {
119
	echo 'Do not exist';
120
}
121
 
122
?>
1163 crox53 123
</body>
1201 crox53 124
</HTML>