Subversion Repositories ALCASAR

Rev

Go to most recent revision | Blame | Last modification | View Log

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><!-- written by Rexy -->
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?
$bl_dir="/etc/dansguardian/lists/blacklists/";
# Choice of language
$Language = 'en';
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
if($Language == 'fr'){
  $l_title = "Catégories de la liste noire";
  $l_error_open_file="Erreur d'ouverture du fichier";
  $l_close="Fermer";
  $l_description_cat="Cette catégorie n'est pas décrite";
  $l_nb_domains="Nombre de noms de domaine filtrés :";
  $l_nb_urls="Nombre d'URL filtrés :";
  $l_nb_ip="Nombre d'IP filtrées :";
  $l_example = "Exemple(s) :";
}
else {
  $l_title = "Blacklist categories";
  $l_error_open_file="Error opening the file";
  $l_close="Close";
  $l_description_cat="This category isn't describe";
  $l_nb_domains="Number of filtered domain names :";
  $l_nb_urls="Number of filtered URL :";
  $l_nb_ip="Number of filtered IP :";
  $l_example = "Example(s) :";
}
if (isset($_GET['cat'])){$categorie=$_GET['cat'];} 
$bl_categorie_domain_file=$bl_dir.$categorie."/domains";
$bl_categorie_url_file=$bl_dir.$categorie."/urls";
$bl_categorie_ip_file = "/usr/local/share/iptables-bl/".$categorie;
if (file_exists($bl_categorie_domain_file))
        $nb_domains = exec("grep -vE '^([0-9]{1,3}\.){3}[0-9]{1,3}$' $bl_categorie_domain_file | wc -l | cut -d' ' -f1");
else
        $nb_domains=$l_error_openfile." ".$bl_categorie_domain_file;
if (file_exists($bl_categorie_url_file))
        $nb_urls=exec ("wc -w $bl_categorie_url_file|cut -d' ' -f1");
else
        $nb_urls=$l_error_openfile." ".$bl_categorie_url_file;
if(file_exists($bl_categorie_ip_file))
        $nb_ip = exec("wc -w $bl_categorie_ip_file | cut -d' ' -f1");
else
        $nb_ip = $l_error_openfile." ".$bl_categorie_ip_file;
$global_usage = file($bl_dir."global_usage");
$langue = strtoupper($Language);
for($i=0; $i<count($global_usage); $i++)
{
        if(preg_match("#^NAME:.$categorie$#", $global_usage[$i]) == 1)
        {
                $i++;
                while(preg_match("#^DESC.$langue:#", $global_usage[$i]) == 0)
                        $i++;
                $l_description_cat = preg_replace("#^DESC.$langue:.#", "", $global_usage[$i]);
                break;
        }
}
echo "<TITLE>$l_title</TITLE>";
?>
<link rel="stylesheet" href="/css/style.css" type="text/css">
</HEAD>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr><th><?php echo $categorie ;?></th></tr>
        <tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
<tr><td valign="middle" align="left">
<?php
$compat_categorie=strtr($categorie,"-","_");
echo "<br><center><b>$l_description_cat</b></center><br>";
echo "$l_nb_domains <b><a href='?cat=$categorie&filtre=$bl_categorie_domain_file'>$nb_domains</a></b><br>";
echo "$l_nb_urls <b><a href='?cat=$categorie&filtre=$bl_categorie_url_file'>$nb_urls</a></b><br>";
echo "$l_nb_ip <b><a href='?cat=$categorie&filtre=$bl_categorie_ip_file'>$nb_ip</a></b><br>";
?>
</td></tr>
</TABLE>
<br/>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr><th><?php echo $l_example;?></th></tr>
        <tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
<tr><td valign="middle" align="left">
<?php
if(isset($_GET["filtre"])){$nom_filtre = $_GET["filtre"];}
if(preg_match("#/domains$#", $nom_filtre) == 1)
        exec("grep -vE '^([0-9]{1,3}\.){3}[0-9]{1,3}$' $nom_filtre | head -n 15", $resultat);
else
        exec("cat $nom_filtre | head -n 15", $resultat);
for($i=0; $i<15; $i++)
        echo $resultat[$i]."<br/>";
?>
</td></tr>
</TABLE>
<center><a href="javascript:window.close();"><b><?php echo "$l_close"; ?></b></a></center>
</BODY>
</HTML>