Subversion Repositories ALCASAR

Rev

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

Rev Author Line No. Line
286 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
<TITLE>ALCASAR DNS filtering</TITLE>
6
<link rel="stylesheet" href="/css/style.css" type="text/css">
7
</HEAD>
8
<body>
9
<?
10
# Choice of language
11
$Language = 'en';
12
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
13
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
14
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
15
if($Language == 'fr'){
16
  $l_title1 = "Filtrage de noms de domaine et d'URL";
311 richard 17
  $l_error_open_file="Erreur d'ouverture du fichier";
307 richard 18
  $l_dnsfilter_on="Le filtrage de noms de domaine et d'URL est actuellement activé";
19
  $l_dnsfilter_off="Le filtrage de noms de domaine et d'URL est actuellement désactivé";
286 richard 20
  $l_switch_filtering_on="Activer le filtrage";
21
  $l_switch_filtering_off="Désactiver le filtrage";
311 richard 22
  $l_main_bl="Liste noire principale";
23
  $l_bl_version="Version actuelle :";
24
  $l_bl_categories="Choix des catégories à filtrer";
286 richard 25
  $l_download="Télécharger la dernière version";
26
  $l_warning="<B>Attention</B> : ce téléchargement peut durer plusieurs minutes.";
27
  $l_secondary_bl="Liste noire et liste blanche secondaires";
311 richard 28
  $l_forbidden_dns="Noms de domaine filtrés";
29
  $l_forbidden_dns_explain="Entrez un nom de domaine par ligne (exemple : domaine.org)";
30
  $l_one_dns="Entrez un nom de domaine par ligne (exemple : domaine.org)";
31
  $l_rehabilitated_dns="Noms de domaine réhabilités";
32
  $l_rehabilitated_dns_explain="Entrez ici des noms de domaine bloqués par la liste noire principale <BR> que vous désirez réhabiliter.";
33
  $l_forbidden_url="URL filtrés";
34
  $l_forbidden_url_explain="Entrez une URL par ligne (exemple : domaine.org/perso.index.htm)";
35
  $l_rehabilitated_url="URL réhabilités";
36
  $l_rehabilitated_url_explain="Entrez ici des URL bloquées par la liste noire principale <BR> que vous désirez réhabiliter.";
37
  $l_one_url="Entrez une URL par ligne (exemple : domaine.org/perso.index.htm)";
38
  $l_record="Enregistrer les modifications";
286 richard 39
}
40
else {
41
  $l_title1 = "Domain names and URL filtering";
311 richard 42
  $l_error_open_file="Error opening the file";
307 richard 43
  $l_dnsfilter_on="Actually, the Domain name and URL filter is on";
44
  $l_dnsfilter_off="Actually, the Domain name and URL filter is off";
45
  $l_switch_filtering_on="Switch the Filter on";
46
  $l_switch_filtering_off="Switch the Filter off";
311 richard 47
  $l_main_bl="Main blacklist";
48
  $l_bl_version="Current version : ";
49
  $l_bl_categories="Choice of filtered categories";
286 richard 50
  $l_download="Download the last version";
51
  $l_warning="<B>Be carefull</B> : this download is estimate to fiew minutes.";
52
  $l_secondary_bl="Secondary blacklist and whitelist";
311 richard 53
  $l_forbidden_dns="Filtered domain names";
54
  $l_forbidden_dns_explain="Enter one domain name per row (exemple : domain.org)";
55
  $l_one_dns="Enter one domain name per row (exemple : domain.org)";
56
  $l_rehabilitated_dns="Rehabilitated domain names";
57
  $l_rehabilitated_dns_explain="Enter here domain names that are blocked by the main blacklist <BR> and which you want to rehabilitate.";
58
  $l_forbidden_url="Filtered URL";
59
  $l_forbidden_url_explain="Enter one URL per row (exemple : www.domaine.org/perso/index.htm)";
60
  $l_rehabilitated_url="Rehabilitated URL";
61
  $l_rehabilitated_url_explain="Enter here URL that are blocked by the main blacklist <BR> and which you want to rehabilitate.";
62
  $l_one_url="Enter one URL per row (exemple : www.domaine.org/perso/index.htm)";
63
  $l_record="Save changes";
286 richard 64
}
65
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
66
switch ($choix)
67
{
68
case 'BL_On' :
69
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -on");
70
	break;
71
case 'BL_Off' :
72
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -off");
73
	break;
74
case 'MAJ_bl' :
75
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -download");
311 richard 76
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -reload");
286 richard 77
	break;
78
case 'MAJ_OSSI' :
79
	$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/domains","w+");
80
	fputs($fichier, $_POST['OSSI_bl_domains']);
81
	fclose($fichier);
82
	unset($_POST['OSSI_bl_domains']);
83
	$fichier=fopen("/etc/dansguardian/lists/exceptionsitelist","w+");
84
	fputs($fichier, $_POST['OSSI_wl_domains']);
85
	fclose($fichier);
86
	unset($_POST['OSSI_wl_domains']);
87
	$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/urls","w+");
88
	fputs($fichier, $_POST['OSSI_bl_urls']);
89
	fclose($fichier);
90
	unset($_POST['OSSI_bl_urls']);
91
	$fichier=fopen("/etc/dansguardian/lists/exceptionurllist","w+");
92
	fputs($fichier, $_POST['OSSI_wl_urls']);
93
	fclose($fichier);
94
	unset($_POST['OSSI_wl_urls']);
95
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -reload");
96
	break;
97
}
98
?>
99
</TABLE>
100
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
101
<tr><th><?php echo "$l_title1"; ?></th></tr>
102
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
103
</TABLE>
104
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
105
	<tr><td valign="middle" align="left">
106
<?php
107
$pointeur = fopen("/etc/dansguardian/dansguardian.conf", "r");
108
$result_filter = false; $out=0;
109
if ($pointeur)
110
	{
111
  	while (!feof($pointeur))
112
		{
113
    		$ligne = fgets($pointeur);
114
    		if (preg_match("/^reportinglevel = 3/", $ligne, $r))
115
			{
116
			$result_filter = true;
117
			$out++;
118
			}
119
		if ($out == 2) break;
120
    		}
121
  	}
122
fclose($pointeur);
123
if ($result_filter)
124
	{
125
	echo "<CENTER><H3>$l_dnsfilter_on</H3></CENTER>";
126
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
127
	echo "<input type=hidden name='choix' value=\"BL_Off\">";
128
	echo "<input type=submit value=\"$l_switch_filtering_off\">";
129
}
130
else
131
	{
132
	echo "<CENTER><H3>$l_dnsfilter_off</H3></CENTER>";
133
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
134
	echo "<input type=hidden name='choix' value=\"BL_On\">";
135
	echo "<input type=submit value=\"$l_switch_filtering_on\">";
136
	}
137
echo "</FORM>";
138
echo "</td></tr>";
139
echo "</TABLE>";
140
if ($result_filter) require ('dns_filter2.php');
141
?>
142
</BODY>
143
</HTML>