Subversion Repositories ALCASAR

Rev

Go to most recent revision | Details | 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";
17
  $l_dnsfilter_on="Le filtrage de noms de domaine est actuellement activé";
18
  $l_dnsfilter_off="Le filtrage de noms de domaine est actuellement désactivé";
19
  $l_switch_filtering_on="Activer le filtrage";
20
  $l_switch_filtering_off="Désactiver le filtrage";
21
  $l_main_bl="Liste noire principale (version actuelle : ";
22
  $l_download="Télécharger la dernière version";
23
  $l_warning="<B>Attention</B> : ce téléchargement peut durer plusieurs minutes.";
24
  $l_secondary_bl="Liste noire et liste blanche secondaires";
25
}
26
else {
27
  $l_title1 = "Domain names and URL filtering";
28
  $l_dnsfilter_on="Actually, the WEB filter is on";
29
  $l_dnsfilter_off="Actually, the WEB filter is off";
30
  $l_switch_filtering_on="Switch the WebFilter on";
31
  $l_switch_filtering_off="Switch the WebFilter off";
32
  $l_main_bl="Main blacklist (current version : ";
33
  $l_download="Download the last version";
34
  $l_warning="<B>Be carefull</B> : this download is estimate to fiew minutes.";
35
  $l_secondary_bl="Secondary blacklist and whitelist";
36
}
37
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
38
switch ($choix)
39
{
40
case 'BL_On' :
41
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -on");
42
	break;
43
case 'BL_Off' :
44
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -off");
45
	break;
46
case 'MAJ_bl' :
47
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -download");
48
	break;
49
case 'MAJ_OSSI' :
50
	$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/domains","w+");
51
	fputs($fichier, $_POST['OSSI_bl_domains']);
52
	fclose($fichier);
53
	unset($_POST['OSSI_bl_domains']);
54
	$fichier=fopen("/etc/dansguardian/lists/exceptionsitelist","w+");
55
	fputs($fichier, $_POST['OSSI_wl_domains']);
56
	fclose($fichier);
57
	unset($_POST['OSSI_wl_domains']);
58
	$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/urls","w+");
59
	fputs($fichier, $_POST['OSSI_bl_urls']);
60
	fclose($fichier);
61
	unset($_POST['OSSI_bl_urls']);
62
	$fichier=fopen("/etc/dansguardian/lists/exceptionurllist","w+");
63
	fputs($fichier, $_POST['OSSI_wl_urls']);
64
	fclose($fichier);
65
	unset($_POST['OSSI_wl_urls']);
66
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -reload");
67
	break;
68
}
69
?>
70
</TABLE>
71
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
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>
74
</TABLE>
75
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
76
	<tr><td valign="middle" align="left">
77
<?php
78
$pointeur = fopen("/etc/dansguardian/dansguardian.conf", "r");
79
$result_filter = false; $out=0;
80
if ($pointeur)
81
	{
82
  	while (!feof($pointeur))
83
		{
84
    		$ligne = fgets($pointeur);
85
    		if (preg_match("/^reportinglevel = 3/", $ligne, $r))
86
			{
87
			$result_filter = true;
88
			$out++;
89
			}
90
		if ($out == 2) break;
91
    		}
92
  	}
93
fclose($pointeur);
94
if ($result_filter)
95
	{
96
	echo "<CENTER><H3>$l_dnsfilter_on</H3></CENTER>";
97
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
98
	echo "<input type=hidden name='choix' value=\"BL_Off\">";
99
	echo "<input type=submit value=\"$l_switch_filtering_off\">";
100
}
101
else
102
	{
103
	echo "<CENTER><H3>$l_dnsfilter_off</H3></CENTER>";
104
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
105
	echo "<input type=hidden name='choix' value=\"BL_On\">";
106
	echo "<input type=submit value=\"$l_switch_filtering_on\">";
107
	}
108
echo "</FORM>";
109
echo "</td></tr>";
110
echo "</TABLE>";
111
if ($result_filter) require ('dns_filter2.php');
112
?>
113
</BODY>
114
</HTML>