| Line 15... |
Line 15... |
| 15 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
15 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
| 16 |
$Language = strtolower(substr(chop($Langue[0]),0,2));
|
16 |
$Language = strtolower(substr(chop($Langue[0]),0,2));
|
| 17 |
}
|
17 |
}
|
| 18 |
if($Language == 'fr')
|
18 |
if($Language == 'fr')
|
| 19 |
{
|
19 |
{
|
| 20 |
$l_title = "Catégories de la liste noire";
|
20 |
$l_title = "Catégories de la liste noire";
|
| 21 |
$l_error_open_file="Erreur d'ouverture du fichier";
|
21 |
$l_error_open_file="Erreur d'ouverture du fichier";
|
| 22 |
$l_close="Fermer";
|
22 |
$l_close="Fermer";
|
| 23 |
$l_description_cat="Cette catégorie n'est pas décrite";
|
23 |
$l_description_cat="Cette catégorie n'est pas décrite";
|
| 24 |
$l_description_ossi="Catégorie personnelle";
|
24 |
$l_name_cat ="Cette catégorie n'a pas de nom";
|
| 25 |
$l_nb_domains="Nombre de noms de domaine filtrés :";
|
25 |
$l_nb_domains="Nombre de noms de domaine filtrés :";
|
| 26 |
$l_nb_urls="Nombre d'URL filtrés :";
|
26 |
$l_nb_urls="Nombre d'URL filtrés :";
|
| 27 |
$l_nb_ip="Nombre d'IP filtrées :";
|
27 |
$l_nb_ip="Nombre d'IP filtrées :";
|
| 28 |
$l_example="Exemple(s) : ";
|
28 |
$l_example="Exemple(s) : ";
|
| - |
|
29 |
$l_error_cat = "Erreur de categorie";
|
| - |
|
30 |
$l_error_list = "Erreur de listing";
|
| 29 |
}
|
31 |
}
|
| 30 |
else
|
32 |
else
|
| 31 |
{
|
33 |
{
|
| 32 |
$l_title = "Blacklist categories";
|
34 |
$l_title = "Blacklist categories";
|
| 33 |
$l_error_open_file="Error opening the file";
|
35 |
$l_error_open_file="Error opening the file";
|
| 34 |
$l_close="Close";
|
36 |
$l_close="Close";
|
| 35 |
$l_description_cat="This category isn't describe";
|
37 |
$l_description_cat="This category isn't describe";
|
| 36 |
$l_description_ossi="Personal category";
|
38 |
$l_name_cat ="This category has not name";
|
| 37 |
$l_nb_domains="Number of filtered domain names :";
|
39 |
$l_nb_domains="Number of filtered domain names :";
|
| 38 |
$l_nb_urls="Number of filtered URL :";
|
40 |
$l_nb_urls="Number of filtered URL :";
|
| 39 |
$l_nb_ip="Number of filtered IP :";
|
41 |
$l_nb_ip="Number of filtered IP :";
|
| 40 |
$l_example="Example(s) : ";
|
42 |
$l_example="Example(s) : ";
|
| - |
|
43 |
$l_error_cat = "Error category";
|
| - |
|
44 |
$l_error_list = "Error listing";
|
| - |
|
45 |
|
| 41 |
}
|
46 |
}
|
| 42 |
if(isset($_GET['cat']))
|
47 |
if(isset($_GET['cat']))
|
| 43 |
{
|
48 |
{
|
| 44 |
$categorie = $_GET['cat'];
|
49 |
$categorie = $_GET['cat'];
|
| 45 |
}
|
50 |
}
|
| - |
|
51 |
else
|
| - |
|
52 |
{
|
| - |
|
53 |
$categorie = $l_error_cat;
|
| - |
|
54 |
}
|
| 46 |
if(isset($_GET['liste']))
|
55 |
if(isset($_GET['liste']))
|
| 47 |
{
|
56 |
{
|
| 48 |
$liste = $_GET['liste'];
|
57 |
$liste = $_GET['liste'];
|
| 49 |
}
|
58 |
}
|
| - |
|
59 |
else
|
| - |
|
60 |
{
|
| - |
|
61 |
$liste = $l_error_list;
|
| - |
|
62 |
}
|
| 50 |
if($liste == "bl")
|
63 |
if($liste == "bl")
|
| 51 |
{
|
64 |
{
|
| 52 |
$bl_categorie_domain_file = $bl_dnsmasq_dir.$categorie.".conf";
|
65 |
$bl_categorie_domain_file = $bl_dnsmasq_dir.$categorie.".conf";
|
| 53 |
$bl_categorie_url_file = $bl_dir.$categorie."/urls";
|
66 |
$bl_categorie_url_file = $bl_dir.$categorie."/urls";
|
| 54 |
$bl_categorie_ip_file = $bl_iptables_dir.$categorie;
|
67 |
$bl_categorie_ip_file = $bl_iptables_dir.$categorie;
|
| Line 94... |
Line 107... |
| 94 |
$nb_ip = 0;
|
107 |
$nb_ip = 0;
|
| 95 |
}
|
108 |
}
|
| 96 |
}
|
109 |
}
|
| 97 |
$global_usage = file($bl_dir."global_usage");
|
110 |
$global_usage = file($bl_dir."global_usage");
|
| 98 |
$langue = strtoupper($Language);
|
111 |
$langue = strtoupper($Language);
|
| 99 |
if($categorie == "ossi")
|
112 |
if(isset($categorie))
|
| 100 |
{
|
- |
|
| 101 |
$l_description_cat = $l_description_ossi;
|
- |
|
| 102 |
}
|
- |
|
| 103 |
else
|
- |
|
| 104 |
{
|
113 |
{
|
| - |
|
114 |
$fin1 = 0; $fin2 = 0;
|
| 105 |
for($i=0; $i<count($global_usage); $i++)
|
115 |
foreach($global_usage as $line)
|
| 106 |
{
|
116 |
{
|
| 107 |
if(preg_match("#^NAME:.$categorie$#", $global_usage[$i]) == 1)
|
117 |
if(preg_match("#^NAME:.$categorie$#", $line) == 1)
|
| - |
|
118 |
$fin1 = 1;
|
| - |
|
119 |
if($fin1 && preg_match("#^DESC.$langue:.#", $line) == 1)
|
| - |
|
120 |
$l_description_cat = preg_replace("#^DESC.$langue:.#", "", $line);
|
| - |
|
121 |
if($fin1 && preg_match("#^NAME.$langue:.#", $line) == 1)
|
| 108 |
{
|
122 |
{
|
| 109 |
$i++;
|
- |
|
| 110 |
while(preg_match("#^DESC.$langue:#", $global_usage[$i]) == 0)
|
- |
|
| 111 |
$i++;
|
- |
|
| 112 |
$l_description_cat = preg_replace("#^DESC.$langue:.#", "", $global_usage[$i]);
|
123 |
$l_name_cat = preg_replace("#^NAME.$langue:.#", "", $line);
|
| 113 |
break;
|
124 |
$fin2 = 1;
|
| 114 |
}
|
125 |
}
|
| - |
|
126 |
if($fin2) break;
|
| - |
|
127 |
|
| 115 |
}
|
128 |
}
|
| 116 |
}
|
129 |
}
|
| 117 |
echo "<TITLE>$l_title</TITLE>";
|
130 |
echo "<TITLE>$l_title</TITLE>";
|
| 118 |
?>
|
131 |
?>
|
| 119 |
<link rel="stylesheet" href="/css/style.css" type="text/css">
|
132 |
<link rel="stylesheet" href="/css/style.css" type="text/css">
|
| 120 |
</HEAD>
|
133 |
</HEAD>
|
| 121 |
<body>
|
134 |
<body>
|
| 122 |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
|
135 |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
|
| 123 |
<tr><th><?php echo $categorie ;?></th></tr>
|
136 |
<tr><th><?php if(isset($categorie)){echo $categorie ;}else{echo $l_error_cat;}?></th></tr>
|
| 124 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
|
137 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
|
| 125 |
</TABLE>
|
138 |
</TABLE>
|
| 126 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
|
139 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
|
| 127 |
<tr><td valign="middle" align="left">
|
140 |
<tr><td valign="middle" align="left">
|
| 128 |
<?php
|
141 |
<?php
|
| Line 133... |
Line 146... |
| 133 |
else
|
146 |
else
|
| 134 |
{
|
147 |
{
|
| 135 |
$filtre = $liste == "bl" ? $bl_categorie_domain_file : $wl_categorie_domain_file;
|
148 |
$filtre = $liste == "bl" ? $bl_categorie_domain_file : $wl_categorie_domain_file;
|
| 136 |
}
|
149 |
}
|
| 137 |
$filtre_domain = $liste == "bl" ? $bl_categorie_domain_file : $wl_categorie_domain_file;
|
150 |
$filtre_domain = $liste == "bl" ? $bl_categorie_domain_file : $wl_categorie_domain_file;
|
| 138 |
$filtre_url = $liste == "bl" ? $bl_categorie_url_file : $wl_categorie_url_file;
|
151 |
$filtre_url = $liste == "bl" ? $bl_categorie_url_file : "";
|
| 139 |
$filtre_ip = $liste == "bl" ? $bl_categorie_ip_file : $wl_categorie_ip_file;
|
152 |
$filtre_ip = $liste == "bl" ? $bl_categorie_ip_file : $wl_categorie_ip_file;
|
| 140 |
$compat_categorie=strtr($categorie,"-","_");
|
153 |
$compat_categorie=strtr($categorie,"-","_");
|
| - |
|
154 |
echo "<br><center><b>$l_name_cat</b></center>";
|
| 141 |
echo "<br><center><b>$l_description_cat</b></center><br>";
|
155 |
echo "<center><b>$l_description_cat</b></center><br>";
|
| 142 |
echo "$l_nb_domains <b><a href='?liste=$liste&cat=$categorie&filtre=$filtre_domain&titre=domain&nb_domains=$nb_domains&nb_urls=$nb_urls&nb_ip=$nb_ip'>$nb_domains</a></b><br>";
|
156 |
echo "$l_nb_domains <b><a href='?liste=$liste&cat=$categorie&filtre=$filtre_domain&titre=domain&nb_domains=$nb_domains&nb_urls=$nb_urls&nb_ip=$nb_ip'>$nb_domains</a></b><br>";
|
| 143 |
echo "$l_nb_urls <b><a href='?liste=$liste&cat=$categorie&filtre=$filtre_url&titre=url&nb_domains=$nb_domains&nb_urls=$nb_urls&nb_ip=$nb_ip'>$nb_urls</a></b><br>";
|
157 |
echo "$l_nb_urls <b><a href='?liste=$liste&cat=$categorie&filtre=$filtre_url&titre=url&nb_domains=$nb_domains&nb_urls=$nb_urls&nb_ip=$nb_ip'>$nb_urls</a></b><br>";
|
| 144 |
echo "$l_nb_ip <b><a href='?liste=$liste&cat=$categorie&filtre=$filtre_ip&titre=ip&nb_domains=$nb_domains&nb_urls=$nb_urls&nb_ip=$nb_ip'>$nb_ip</a></b><br>";
|
158 |
echo "$l_nb_ip <b><a href='?liste=$liste&cat=$categorie&filtre=$filtre_ip&titre=ip&nb_domains=$nb_domains&nb_urls=$nb_urls&nb_ip=$nb_ip'>$nb_ip</a></b><br>";
|
| 145 |
?>
|
159 |
?>
|
| 146 |
</td></tr>
|
160 |
</td></tr>
|