Subversion Repositories ALCASAR

Rev

Rev 878 | Rev 1332 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
318 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";
1325 richard 16
  $l_description_cat="Cette catégorie n'est pas décrite";
318 richard 17
  $l_nb_domains="Nombre de noms de domaine filtrés :";
18
  $l_nb_urls="Nombre d'URL filtrés :";
1325 richard 19
  $l_nb_ip="Nombre d'IP filtrées :";
318 richard 20
}
21
else {
22
  $l_title = "Blacklist categories";
23
  $l_error_open_file="Error opening the file";
24
  $l_close="Close";
1325 richard 25
  $l_description_cat="This category isn't describe";
318 richard 26
  $l_nb_domains="Number of filtered domain names :";
27
  $l_nb_urls="Number of filtered URL :";
1325 richard 28
  $l_nb_ip="Number of filtered IP :";
318 richard 29
}
30
if (isset($_GET['cat'])){$categorie=$_GET['cat'];} 
31
$bl_categorie_domain_file=$bl_dir.$categorie."/domains";
32
$bl_categorie_url_file=$bl_dir.$categorie."/urls";
1325 richard 33
$bl_categorie_ip_file = "/usr/local/share/iptables-bl/".$categorie;
318 richard 34
if (file_exists($bl_categorie_domain_file))
1325 richard 35
	$nb_domains = exec("grep -vE '^([0-9]{1,3}\.){3}[0-9]{1,3}$' $bl_categorie_domain_file | wc -l | cut -d' ' -f1");
318 richard 36
else
1325 richard 37
	$nb_domains=$l_error_openfile." ".$bl_categorie_domain_file;
318 richard 38
if (file_exists($bl_categorie_url_file))
39
	$nb_urls=exec ("wc -w $bl_categorie_url_file|cut -d' ' -f1");
40
else
41
	$nb_urls=$l_error_openfile." ".$bl_categorie_url_file;
1325 richard 42
if(file_exists($bl_categorie_ip_file))
43
	$nb_ip = exec("wc -w $bl_categorie_ip_file | cut -d' ' -f1");
44
else
45
	$nb_ip = $l_error_openfile." ".$bl_categorie_ip_file;
46
$global_usage = file($bl_dir."global_usage");
47
$langue = strtoupper($Language);
48
for($i=0; $i<count($global_usage); $i++)
49
{
50
	if(preg_match("#^NAME:.$categorie$#", $global_usage[$i]) == 1)
51
	{
52
		$i++;
53
		while(preg_match("#^DESC.$langue:#", $global_usage[$i]) == 0)
54
			$i++;
55
		$l_description_cat = preg_replace("#^DESC.$langue:.#", "", $global_usage[$i]);
56
		break;
57
	}
58
}
318 richard 59
echo "<TITLE>$l_title</TITLE>";
60
?>
61
<link rel="stylesheet" href="/css/style.css" type="text/css">
62
</HEAD>
63
<body>
64
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
65
	<tr><th><?php echo $categorie ;?></th></tr>
66
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
67
</TABLE>
68
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
69
<tr><td valign="middle" align="left">
70
<?php
71
$compat_categorie=strtr($categorie,"-","_");
1325 richard 72
echo "<br><center><b>$l_description_cat</b></center><br>";
73
echo "$l_nb_domains <b><a href='./bl_categories_help2.php?cat=$categorie&filtre=$bl_categorie_domain_file'>$nb_domains</a></b><br>";
74
echo "$l_nb_urls <b><a href='./bl_categories_help2.php?cat=$categorie&filtre=$bl_categorie_url_file'>$nb_urls</a></b><br>";
75
echo "$l_nb_ip <b><a href='./bl_categories_help2.php?cat=$categorie&filtre=$bl_categorie_ip_file'>$nb_ip</a></b><br>";
318 richard 76
?>
77
</td></tr>
78
</TABLE>
79
<br>
80
<center><a href="javascript:window.close();"><b><?php echo "$l_close"; ?></b></a></center>
81
</BODY>
82
</HTML>