1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
2 |
<HTML><!-- written by Rexy -->
|
2 |
<HTML><!-- written by Rexy -->
|
3 |
<HEAD>
|
3 |
<HEAD>
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5 |
<TITLE>ALCASAR DNS filtering</TITLE>
|
5 |
<TITLE>ALCASAR DNS filtering</TITLE>
|
6 |
<link rel="stylesheet" href="/css/style.css" type="text/css">
|
6 |
<link rel="stylesheet" href="/css/style.css" type="text/css">
|
7 |
</HEAD>
|
7 |
</HEAD>
|
8 |
<body>
|
8 |
<body>
|
9 |
<?
|
9 |
<?
|
10 |
# Choice of language
|
10 |
# Choice of language
|
11 |
$Language = 'en';
|
11 |
$Language = 'en';
|
12 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
12 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
13 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
13 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
14 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
14 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
15 |
if($Language == 'fr'){
|
15 |
if($Language == 'fr'){
|
16 |
$l_title1 = "Filtrage de noms de domaine et d'URL";
|
16 |
$l_title1 = "Filtrage de noms de domaine et d'URL";
|
17 |
$l_dnsfilter_on="Le filtrage de noms de domaine est actuellement activé";
|
17 |
$l_dnsfilter_on="Le filtrage de noms de domaine et d'URL est actuellement activé";
|
18 |
$l_dnsfilter_off="Le filtrage de noms de domaine est actuellement désactivé";
|
18 |
$l_dnsfilter_off="Le filtrage de noms de domaine et d'URL est actuellement désactivé";
|
19 |
$l_switch_filtering_on="Activer le filtrage";
|
19 |
$l_switch_filtering_on="Activer le filtrage";
|
20 |
$l_switch_filtering_off="Désactiver le filtrage";
|
20 |
$l_switch_filtering_off="Désactiver le filtrage";
|
21 |
$l_main_bl="Liste noire principale (version actuelle : ";
|
21 |
$l_main_bl="Liste noire principale (version actuelle : ";
|
22 |
$l_download="Télécharger la dernière version";
|
22 |
$l_download="Télécharger la dernière version";
|
23 |
$l_warning="<B>Attention</B> : ce téléchargement peut durer plusieurs minutes.";
|
23 |
$l_warning="<B>Attention</B> : ce téléchargement peut durer plusieurs minutes.";
|
24 |
$l_secondary_bl="Liste noire et liste blanche secondaires";
|
24 |
$l_secondary_bl="Liste noire et liste blanche secondaires";
|
25 |
}
|
25 |
}
|
26 |
else {
|
26 |
else {
|
27 |
$l_title1 = "Domain names and URL filtering";
|
27 |
$l_title1 = "Domain names and URL filtering";
|
28 |
$l_dnsfilter_on="Actually, the WEB filter is on";
|
28 |
$l_dnsfilter_on="Actually, the Domain name and URL filter is on";
|
29 |
$l_dnsfilter_off="Actually, the WEB filter is off";
|
29 |
$l_dnsfilter_off="Actually, the Domain name and URL filter is off";
|
30 |
$l_switch_filtering_on="Switch the WebFilter on";
|
30 |
$l_switch_filtering_on="Switch the Filter on";
|
31 |
$l_switch_filtering_off="Switch the WebFilter off";
|
31 |
$l_switch_filtering_off="Switch the Filter off";
|
32 |
$l_main_bl="Main blacklist (current version : ";
|
32 |
$l_main_bl="Main blacklist (current version : ";
|
33 |
$l_download="Download the last version";
|
33 |
$l_download="Download the last version";
|
34 |
$l_warning="<B>Be carefull</B> : this download is estimate to fiew minutes.";
|
34 |
$l_warning="<B>Be carefull</B> : this download is estimate to fiew minutes.";
|
35 |
$l_secondary_bl="Secondary blacklist and whitelist";
|
35 |
$l_secondary_bl="Secondary blacklist and whitelist";
|
36 |
}
|
36 |
}
|
37 |
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
|
37 |
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
|
38 |
switch ($choix)
|
38 |
switch ($choix)
|
39 |
{
|
39 |
{
|
40 |
case 'BL_On' :
|
40 |
case 'BL_On' :
|
41 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -on");
|
41 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -on");
|
42 |
break;
|
42 |
break;
|
43 |
case 'BL_Off' :
|
43 |
case 'BL_Off' :
|
44 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -off");
|
44 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -off");
|
45 |
break;
|
45 |
break;
|
46 |
case 'MAJ_bl' :
|
46 |
case 'MAJ_bl' :
|
47 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -download");
|
47 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -download");
|
48 |
break;
|
48 |
break;
|
49 |
case 'MAJ_OSSI' :
|
49 |
case 'MAJ_OSSI' :
|
50 |
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/domains","w+");
|
50 |
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/domains","w+");
|
51 |
fputs($fichier, $_POST['OSSI_bl_domains']);
|
51 |
fputs($fichier, $_POST['OSSI_bl_domains']);
|
52 |
fclose($fichier);
|
52 |
fclose($fichier);
|
53 |
unset($_POST['OSSI_bl_domains']);
|
53 |
unset($_POST['OSSI_bl_domains']);
|
54 |
$fichier=fopen("/etc/dansguardian/lists/exceptionsitelist","w+");
|
54 |
$fichier=fopen("/etc/dansguardian/lists/exceptionsitelist","w+");
|
55 |
fputs($fichier, $_POST['OSSI_wl_domains']);
|
55 |
fputs($fichier, $_POST['OSSI_wl_domains']);
|
56 |
fclose($fichier);
|
56 |
fclose($fichier);
|
57 |
unset($_POST['OSSI_wl_domains']);
|
57 |
unset($_POST['OSSI_wl_domains']);
|
58 |
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/urls","w+");
|
58 |
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/urls","w+");
|
59 |
fputs($fichier, $_POST['OSSI_bl_urls']);
|
59 |
fputs($fichier, $_POST['OSSI_bl_urls']);
|
60 |
fclose($fichier);
|
60 |
fclose($fichier);
|
61 |
unset($_POST['OSSI_bl_urls']);
|
61 |
unset($_POST['OSSI_bl_urls']);
|
62 |
$fichier=fopen("/etc/dansguardian/lists/exceptionurllist","w+");
|
62 |
$fichier=fopen("/etc/dansguardian/lists/exceptionurllist","w+");
|
63 |
fputs($fichier, $_POST['OSSI_wl_urls']);
|
63 |
fputs($fichier, $_POST['OSSI_wl_urls']);
|
64 |
fclose($fichier);
|
64 |
fclose($fichier);
|
65 |
unset($_POST['OSSI_wl_urls']);
|
65 |
unset($_POST['OSSI_wl_urls']);
|
66 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -reload");
|
66 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -reload");
|
67 |
break;
|
67 |
break;
|
68 |
}
|
68 |
}
|
69 |
?>
|
69 |
?>
|
70 |
</TABLE>
|
70 |
</TABLE>
|
71 |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
|
71 |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
|
72 |
<tr><th><?php echo "$l_title1"; ?></th></tr>
|
72 |
<tr><th><?php echo "$l_title1"; ?></th></tr>
|
73 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
|
73 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
|
74 |
</TABLE>
|
74 |
</TABLE>
|
75 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
|
75 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
|
76 |
<tr><td valign="middle" align="left">
|
76 |
<tr><td valign="middle" align="left">
|
77 |
<?php
|
77 |
<?php
|
78 |
$pointeur = fopen("/etc/dansguardian/dansguardian.conf", "r");
|
78 |
$pointeur = fopen("/etc/dansguardian/dansguardian.conf", "r");
|
79 |
$result_filter = false; $out=0;
|
79 |
$result_filter = false; $out=0;
|
80 |
if ($pointeur)
|
80 |
if ($pointeur)
|
81 |
{
|
81 |
{
|
82 |
while (!feof($pointeur))
|
82 |
while (!feof($pointeur))
|
83 |
{
|
83 |
{
|
84 |
$ligne = fgets($pointeur);
|
84 |
$ligne = fgets($pointeur);
|
85 |
if (preg_match("/^reportinglevel = 3/", $ligne, $r))
|
85 |
if (preg_match("/^reportinglevel = 3/", $ligne, $r))
|
86 |
{
|
86 |
{
|
87 |
$result_filter = true;
|
87 |
$result_filter = true;
|
88 |
$out++;
|
88 |
$out++;
|
89 |
}
|
89 |
}
|
90 |
if ($out == 2) break;
|
90 |
if ($out == 2) break;
|
91 |
}
|
91 |
}
|
92 |
}
|
92 |
}
|
93 |
fclose($pointeur);
|
93 |
fclose($pointeur);
|
94 |
if ($result_filter)
|
94 |
if ($result_filter)
|
95 |
{
|
95 |
{
|
96 |
echo "<CENTER><H3>$l_dnsfilter_on</H3></CENTER>";
|
96 |
echo "<CENTER><H3>$l_dnsfilter_on</H3></CENTER>";
|
97 |
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
|
97 |
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
|
98 |
echo "<input type=hidden name='choix' value=\"BL_Off\">";
|
98 |
echo "<input type=hidden name='choix' value=\"BL_Off\">";
|
99 |
echo "<input type=submit value=\"$l_switch_filtering_off\">";
|
99 |
echo "<input type=submit value=\"$l_switch_filtering_off\">";
|
100 |
}
|
100 |
}
|
101 |
else
|
101 |
else
|
102 |
{
|
102 |
{
|
103 |
echo "<CENTER><H3>$l_dnsfilter_off</H3></CENTER>";
|
103 |
echo "<CENTER><H3>$l_dnsfilter_off</H3></CENTER>";
|
104 |
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
|
104 |
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
|
105 |
echo "<input type=hidden name='choix' value=\"BL_On\">";
|
105 |
echo "<input type=hidden name='choix' value=\"BL_On\">";
|
106 |
echo "<input type=submit value=\"$l_switch_filtering_on\">";
|
106 |
echo "<input type=submit value=\"$l_switch_filtering_on\">";
|
107 |
}
|
107 |
}
|
108 |
echo "</FORM>";
|
108 |
echo "</FORM>";
|
109 |
echo "</td></tr>";
|
109 |
echo "</td></tr>";
|
110 |
echo "</TABLE>";
|
110 |
echo "</TABLE>";
|
111 |
if ($result_filter) require ('dns_filter2.php');
|
111 |
if ($result_filter) require ('dns_filter2.php');
|
112 |
?>
|
112 |
?>
|
113 |
</BODY>
|
113 |
</BODY>
|
114 |
</HTML>
|
114 |
</HTML>
|
115 |
|
115 |
|