1325 |
richard |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
|
2 |
<HTML><!-- written by Rexy -->
|
|
|
3 |
<HEAD>
|
|
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
5 |
<?
|
|
|
6 |
$bl_dir="/etc/dansguardian/lists/blacklists/";
|
|
|
7 |
# Choice of language
|
|
|
8 |
$Language = 'en';
|
|
|
9 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
|
|
10 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
|
|
11 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
|
|
12 |
if($Language == 'fr'){
|
|
|
13 |
$l_title = "Catégories de la liste noire";
|
|
|
14 |
$l_error_open_file="Erreur d'ouverture du fichier";
|
|
|
15 |
$l_close="Fermer";
|
|
|
16 |
$l_description_cat="Cette catégorie n'est pas décrite";
|
|
|
17 |
$l_nb_domains="Nombre de noms de domaine filtrés :";
|
|
|
18 |
$l_nb_urls="Nombre d'URL filtrés :";
|
|
|
19 |
$l_nb_ip="Nombre d'IP filtrées :";
|
|
|
20 |
$l_example = "Exemple(s) :";
|
|
|
21 |
}
|
|
|
22 |
else {
|
|
|
23 |
$l_title = "Blacklist categories";
|
|
|
24 |
$l_error_open_file="Error opening the file";
|
|
|
25 |
$l_close="Close";
|
|
|
26 |
$l_description_cat="This category isn't describe";
|
|
|
27 |
$l_nb_domains="Number of filtered domain names :";
|
|
|
28 |
$l_nb_urls="Number of filtered URL :";
|
|
|
29 |
$l_nb_ip="Number of filtered IP :";
|
|
|
30 |
$l_example = "Example(s) :";
|
|
|
31 |
}
|
|
|
32 |
if (isset($_GET['cat'])){$categorie=$_GET['cat'];}
|
|
|
33 |
$bl_categorie_domain_file=$bl_dir.$categorie."/domains";
|
|
|
34 |
$bl_categorie_url_file=$bl_dir.$categorie."/urls";
|
|
|
35 |
$bl_categorie_ip_file = "/usr/local/share/iptables-bl/".$categorie;
|
|
|
36 |
if (file_exists($bl_categorie_domain_file))
|
|
|
37 |
$nb_domains = exec("grep -vE '^([0-9]{1,3}\.){3}[0-9]{1,3}$' $bl_categorie_domain_file | wc -l | cut -d' ' -f1");
|
|
|
38 |
else
|
|
|
39 |
$nb_domains=$l_error_openfile." ".$bl_categorie_domain_file;
|
|
|
40 |
if (file_exists($bl_categorie_url_file))
|
|
|
41 |
$nb_urls=exec ("wc -w $bl_categorie_url_file|cut -d' ' -f1");
|
|
|
42 |
else
|
|
|
43 |
$nb_urls=$l_error_openfile." ".$bl_categorie_url_file;
|
|
|
44 |
if(file_exists($bl_categorie_ip_file))
|
|
|
45 |
$nb_ip = exec("wc -w $bl_categorie_ip_file | cut -d' ' -f1");
|
|
|
46 |
else
|
|
|
47 |
$nb_ip = $l_error_openfile." ".$bl_categorie_ip_file;
|
|
|
48 |
$global_usage = file($bl_dir."global_usage");
|
|
|
49 |
$langue = strtoupper($Language);
|
|
|
50 |
for($i=0; $i<count($global_usage); $i++)
|
|
|
51 |
{
|
|
|
52 |
if(preg_match("#^NAME:.$categorie$#", $global_usage[$i]) == 1)
|
|
|
53 |
{
|
|
|
54 |
$i++;
|
|
|
55 |
while(preg_match("#^DESC.$langue:#", $global_usage[$i]) == 0)
|
|
|
56 |
$i++;
|
|
|
57 |
$l_description_cat = preg_replace("#^DESC.$langue:.#", "", $global_usage[$i]);
|
|
|
58 |
break;
|
|
|
59 |
}
|
|
|
60 |
}
|
|
|
61 |
echo "<TITLE>$l_title</TITLE>";
|
|
|
62 |
?>
|
|
|
63 |
<link rel="stylesheet" href="/css/style.css" type="text/css">
|
|
|
64 |
</HEAD>
|
|
|
65 |
<body>
|
|
|
66 |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
67 |
<tr><th><?php echo $categorie ;?></th></tr>
|
|
|
68 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
|
|
|
69 |
</TABLE>
|
|
|
70 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
|
|
|
71 |
<tr><td valign="middle" align="left">
|
|
|
72 |
<?php
|
|
|
73 |
$compat_categorie=strtr($categorie,"-","_");
|
|
|
74 |
echo "<br><center><b>$l_description_cat</b></center><br>";
|
|
|
75 |
echo "$l_nb_domains <b><a href='?cat=$categorie&filtre=$bl_categorie_domain_file'>$nb_domains</a></b><br>";
|
|
|
76 |
echo "$l_nb_urls <b><a href='?cat=$categorie&filtre=$bl_categorie_url_file'>$nb_urls</a></b><br>";
|
|
|
77 |
echo "$l_nb_ip <b><a href='?cat=$categorie&filtre=$bl_categorie_ip_file'>$nb_ip</a></b><br>";
|
|
|
78 |
?>
|
|
|
79 |
</td></tr>
|
|
|
80 |
</TABLE>
|
|
|
81 |
<br/>
|
|
|
82 |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
83 |
<tr><th><?php echo $l_example;?></th></tr>
|
|
|
84 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
|
|
|
85 |
</TABLE>
|
|
|
86 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
|
|
|
87 |
<tr><td valign="middle" align="left">
|
|
|
88 |
<?php
|
|
|
89 |
if(isset($_GET["filtre"])){$nom_filtre = $_GET["filtre"];}
|
|
|
90 |
if(preg_match("#/domains$#", $nom_filtre) == 1)
|
|
|
91 |
exec("grep -vE '^([0-9]{1,3}\.){3}[0-9]{1,3}$' $nom_filtre | head -n 15", $resultat);
|
|
|
92 |
else
|
|
|
93 |
exec("cat $nom_filtre | head -n 15", $resultat);
|
|
|
94 |
for($i=0; $i<15; $i++)
|
|
|
95 |
echo $resultat[$i]."<br/>";
|
|
|
96 |
?>
|
|
|
97 |
</td></tr>
|
|
|
98 |
</TABLE>
|
|
|
99 |
<center><a href="javascript:window.close();"><b><?php echo "$l_close"; ?></b></a></center>
|
|
|
100 |
</BODY>
|
|
|
101 |
</HTML>
|