Subversion Repositories ALCASAR

Rev

Rev 1500 | Rev 1867 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log

<?php
//gestion de la langue
if (is_file("../lib/langues.php"))
        include("../lib/langues.php");
?>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN//2.0">
<HTML>
<!-- written by Crox -->
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>menu</TITLE>
<link rel="stylesheet" href="../../../css/bootstrap.min.css">
  <script src="../../../js/jquery.min.js"></script>
  <script src="../../../js/bootstrap.min.js"></script>
</HEAD>
<body>



<?php
        $table = 1;
        if(isset($_GET['table'])){
                $table = $_GET['table'];
        }
?>


<?php

echo'
        <br />
                        <div class="btn-group btn-group-justified" role="group" aria-label="Justified button group"> 
                        <a href="./security.php?table=1" class="btn btn-default" role="button">'.$l_spoofing.'</a> 
                        <a href="./security.php?table=2" class="btn btn-default" role="button">'.$l_virus.'</a>
                        <a href="./security.php?table=3" class="btn btn-default" role="button">'.$l_fail2ban.'</a>  
                        </div>
        <br />';


?>


<?php

if ( $table == 1){

        echo '<center><h3>';
        echo "$l_spoofing";
        echo '</h3></center><div class="container"><table class="table table-striped"><tbody>';

        $fichier='/var/Save/security/watchdog.log';
        $pointeur=fopen($fichier,"r");
        if ($pointeur){
        while (!feof($pointeur)){
                $ligne=fgets($pointeur);
                echo "<tr><td>$ligne</td></tr>";
                }
        }
        else
        {
                echo '<tr><center>Empty</center></tr>';
        }
        fclose($pointeur);
        echo '</tbody></table></div>';


} elseif ($table == 2){
        echo '<center><h3>';
        echo "$l_virus";
        echo '</h3></center><div class="container"><table class="table table-striped"><tbody>';
                                
        $fichier='/var/log/havp/access.log';
        $pointeur=fopen($fichier,"r");
        if ($pointeur){
        while (!feof($pointeur)){
                $ligne=fgets($pointeur);
                echo "<tr><td>$ligne</td></tr>";
                }
        }
        else
        {
                echo '<tr><center>Empty</center></tr>';
        }
        fclose($pointeur);
        echo '</tbody></table></div>';
        
} elseif ($table == 3){
        echo '<center><h3>';
        echo "$l_fail2ban";
        echo '</h3></center><div class="container"><table class="table table-striped"><tbody>';

        $fichier='/var/log/fail2ban.log';
        $unban="/Unban/";
        $ban="/Ban/";
        $pointeur=fopen($fichier,"r");
        if ($pointeur){
                while (!feof($pointeur)){
                        $ligne=fgets($pointeur);
                        if(preg_match($ban,$ligne,$r)){
                                echo "<tr><td><font color='red'>$ligne</font></td></tr>";
                        }
                        if(preg_match($unban,$ligne,$r)){
                                echo "<tr><td><font color='orange'>$ligne</font></td></tr>";
                        }
                }
                        fclose($pointeur);
        }
        else
        {
                echo '<tr><center>Empty</center></tr>';
        }
        echo '</tbody></table></div>';
} else {
        echo 'Do not exist';
}

?>
</body>
</HTML>