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 WEB filtering</TITLE>
|
5 |
<TITLE>ALCASAR WEB 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 |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
|
9 |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
|
10 |
<?
|
10 |
<?
|
11 |
# Choice of language
|
11 |
# Choice of language
|
12 |
$Language = 'en';
|
12 |
$Language = 'en';
|
13 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
13 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
14 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
14 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
15 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
15 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
16 |
if($Language == 'fr'){
|
16 |
if($Language == 'fr'){
|
17 |
$l_title = "Filtrage WEB";
|
17 |
$l_title = "Filtrage WEB";
|
18 |
$l_webfilter_on="Le filtrage WEB est actuellement activé";
|
18 |
$l_webfilter_on="Le filtrage WEB est actuellement activé";
|
19 |
$l_webfilter_off="Le filtrage WEB est actuellement désactivé";
|
19 |
$l_webfilter_off="Le filtrage WEB est actuellement désactivé";
|
20 |
$l_switch_on="Activer le filtrage WEB";
|
20 |
$l_switch_on="Activer le filtrage WEB";
|
21 |
$l_switch_off="Désactiver le filtrage WEB";
|
21 |
$l_switch_off="Désactiver le filtrage WEB";
|
22 |
$l_comment_on="(la consultation WEB est filtrée selon les critères définis ci-dessous)";
|
22 |
$l_comment_on="(la consultation WEB est filtrée selon les critères définis ci-dessous)";
|
23 |
$l_comment_off="(la consultation WEB est autorisée sans restriction)";
|
23 |
$l_comment_off="(la consultation WEB est autorisée sans restriction)";
|
24 |
$l_main_bl="Liste noire principale (version actuelle : ";
|
24 |
$l_main_bl="Liste noire principale (version actuelle : ";
|
25 |
$l_download="Télécharger la dernière version";
|
25 |
$l_download="Télécharger la dernière version";
|
26 |
$l_warning="<B>Attention</B> : ce téléchargement dure plusieurs minutes.";
|
26 |
$l_warning="<B>Attention</B> : ce téléchargement dure plusieurs minutes.";
|
27 |
$l_secondary_bl="Liste noire et liste blanche secondaires";
|
27 |
$l_secondary_bl="Liste noire et liste blanche secondaires";
|
28 |
}
|
28 |
}
|
29 |
else {
|
29 |
else {
|
30 |
$l_title = "WEB Filter";
|
30 |
$l_title = "WEB Filter";
|
31 |
$l_webfilter_on="Actually, the WEB filter is on";
|
31 |
$l_webfilter_on="Actually, the WEB filter is on";
|
32 |
$l_webfilter_off="Actually, the WEB filter is off";
|
32 |
$l_webfilter_off="Actually, the WEB filter is off";
|
33 |
$l_switch_on="Switch the WebFilter on";
|
33 |
$l_switch_on="Switch the WebFilter on";
|
34 |
$l_switch_off="Switch the WebFilter off";
|
34 |
$l_switch_off="Switch the WebFilter off";
|
35 |
$l_comment_on="(The WEB consultation is filtered as defined below)";
|
35 |
$l_comment_on="(The WEB consultation is filtered as defined below)";
|
36 |
$l_comment_off="(The WEB consultation is allowed without any restriction)";
|
36 |
$l_comment_off="(The WEB consultation is allowed without any restriction)";
|
37 |
$l_main_bl="Main blacklist (current version : ";
|
37 |
$l_main_bl="Main blacklist (current version : ";
|
38 |
$l_download="Download the last version";
|
38 |
$l_download="Download the last version";
|
39 |
$l_warning="<B>Be carefull</B> : this download is estimate to fiew minutes.";
|
39 |
$l_warning="<B>Be carefull</B> : this download is estimate to fiew minutes.";
|
40 |
$l_secondary_bl="Secondary blacklist and whitelist";
|
40 |
$l_secondary_bl="Secondary blacklist and whitelist";
|
41 |
}
|
41 |
}
|
42 |
echo "
|
42 |
echo "
|
43 |
<tr><th>$l_title</th></tr>
|
43 |
<tr><th>$l_title</th></tr>
|
44 |
<tr bgcolor=\"#FFCC66\"><td><img src=\"/images/pix.gif\" width=1 height=2></td></tr>
|
44 |
<tr bgcolor=\"#FFCC66\"><td><img src=\"/images/pix.gif\" width=1 height=2></td></tr>
|
45 |
</TABLE>";
|
45 |
</TABLE>";
|
46 |
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
|
46 |
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
|
47 |
switch ($choix)
|
47 |
switch ($choix)
|
48 |
{
|
48 |
{
|
49 |
case 'BL_On' :
|
49 |
case 'BL_On' :
|
50 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -on");
|
50 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -on");
|
51 |
break;
|
51 |
break;
|
52 |
case 'BL_Off' :
|
52 |
case 'BL_Off' :
|
53 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -off");
|
53 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -off");
|
54 |
break;
|
54 |
break;
|
55 |
case 'MAJ_bl' :
|
55 |
case 'MAJ_bl' :
|
56 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -download");
|
56 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -download");
|
57 |
break;
|
57 |
break;
|
58 |
case 'MAJ_OSSI' :
|
58 |
case 'MAJ_OSSI' :
|
59 |
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/domains","w+");
|
59 |
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/domains","w+");
|
60 |
fputs($fichier, $_POST['OSSI_bl_domains']);
|
60 |
fputs($fichier, $_POST['OSSI_bl_domains']);
|
61 |
fclose($fichier);
|
61 |
fclose($fichier);
|
62 |
unset($_POST['OSSI_bl_domains']);
|
62 |
unset($_POST['OSSI_bl_domains']);
|
63 |
$fichier=fopen("/etc/dansguardian/lists/exceptionsitelist","w+");
|
63 |
$fichier=fopen("/etc/dansguardian/lists/exceptionsitelist","w+");
|
64 |
fputs($fichier, $_POST['OSSI_wl_domains']);
|
64 |
fputs($fichier, $_POST['OSSI_wl_domains']);
|
65 |
fclose($fichier);
|
65 |
fclose($fichier);
|
66 |
unset($_POST['OSSI_wl_domains']);
|
66 |
unset($_POST['OSSI_wl_domains']);
|
67 |
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/urls","w+");
|
67 |
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/urls","w+");
|
68 |
fputs($fichier, $_POST['OSSI_bl_urls']);
|
68 |
fputs($fichier, $_POST['OSSI_bl_urls']);
|
69 |
fclose($fichier);
|
69 |
fclose($fichier);
|
70 |
unset($_POST['OSSI_bl_urls']);
|
70 |
unset($_POST['OSSI_bl_urls']);
|
71 |
$fichier=fopen("/etc/dansguardian/lists/exceptionurllist","w+");
|
71 |
$fichier=fopen("/etc/dansguardian/lists/exceptionurllist","w+");
|
72 |
fputs($fichier, $_POST['OSSI_wl_urls']);
|
72 |
fputs($fichier, $_POST['OSSI_wl_urls']);
|
73 |
fclose($fichier);
|
73 |
fclose($fichier);
|
74 |
unset($_POST['OSSI_wl_urls']);
|
74 |
unset($_POST['OSSI_wl_urls']);
|
75 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -reload");
|
75 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -reload");
|
76 |
break;
|
76 |
break;
|
77 |
}
|
77 |
}
|
78 |
?>
|
78 |
?>
|
79 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
|
79 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
|
80 |
<tr><td valign="middle" align="left">
|
80 |
<tr><td valign="middle" align="left">
|
81 |
<?php
|
81 |
<?php
|
82 |
$pointeur = fopen("/etc/dansguardian/dansguardian.conf", "r");
|
82 |
$pointeur = fopen("/etc/dansguardian/dansguardian.conf", "r");
|
83 |
$result = false;
|
83 |
$result = false;
|
84 |
if ($pointeur)
|
84 |
if ($pointeur)
|
85 |
{
|
85 |
{
|
86 |
while (!feof($pointeur))
|
86 |
while (!feof($pointeur))
|
87 |
{
|
87 |
{
|
88 |
$ligne = fgets($pointeur);
|
88 |
$ligne = fgets($pointeur);
|
89 |
if (preg_match("/^reportinglevel = 3/", $ligne, $r))
|
89 |
if (preg_match("/^reportinglevel = 3/", $ligne, $r))
|
90 |
{
|
90 |
{
|
91 |
$result = true;
|
91 |
$result = true;
|
92 |
break;
|
92 |
break;
|
93 |
}
|
93 |
}
|
94 |
}
|
94 |
}
|
95 |
}
|
95 |
}
|
96 |
fclose($pointeur);
|
96 |
fclose($pointeur);
|
97 |
if ($result)
|
97 |
if ($result)
|
98 |
{
|
98 |
{
|
99 |
echo "<CENTER><H3>$l_webfilter_on</H3>$l_comment_on</CENTER>";
|
99 |
echo "<CENTER><H3>$l_webfilter_on</H3>$l_comment_on</CENTER>";
|
100 |
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
|
100 |
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
|
101 |
echo "<input type=hidden name='choix' value=\"BL_Off\">";
|
101 |
echo "<input type=hidden name='choix' value=\"BL_Off\">";
|
102 |
echo "<input type=submit value=\"$l_switch_off\">";
|
102 |
echo "<input type=submit value=\"$l_switch_off\">";
|
103 |
}
|
103 |
}
|
104 |
else
|
104 |
else
|
105 |
{
|
105 |
{
|
106 |
echo "<CENTER><H3>$l_webfilter_off</H3>$l_comment_off</CENTER>";
|
106 |
echo "<CENTER><H3>$l_webfilter_off</H3>$l_comment_off</CENTER>";
|
107 |
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
|
107 |
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
|
108 |
echo "<input type=hidden name='choix' value=\"BL_On\">";
|
108 |
echo "<input type=hidden name='choix' value=\"BL_On\">";
|
109 |
echo "<input type=submit value=\"$l_switch_on\">";
|
109 |
echo "<input type=submit value=\"$l_switch_on\">";
|
110 |
}
|
110 |
}
|
111 |
echo "</FORM>";
|
111 |
echo "</FORM>";
|
112 |
echo "</td></tr>";
|
112 |
echo "</td></tr>";
|
113 |
echo "</TABLE>";
|
113 |
echo "</TABLE>";
|
114 |
if ($result) require ('web_filter2.php');
|
114 |
if ($result) require ('web_filter2.php');
|
115 |
?>
|
115 |
?>
|
116 |
</BODY>
|
116 |
</BODY>
|
117 |
</HTML>
|
117 |
</HTML>
|
118 |
|
118 |
|