Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
28 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 WEB 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'){
142 richard 16
  $l_title1 = "Antivirus";
17
  $l_title2 = "Filtrage de noms de domaine et d'URL";
18
  $l_antivir_on="L'antivirus de flux WEB est actuellement activé";
19
  $l_antivir_off="L'antivirus de flux WEB est actuellement désactivé";
28 richard 20
  $l_webfilter_on="Le filtrage WEB est actuellement activé";
21
  $l_webfilter_off="Le filtrage WEB est actuellement désactivé";
142 richard 22
  $l_switch_antivir_on="Activer l'antivirus";
23
  $l_switch_antivir_off="Désactiver l'antivirus";
24
  $l_switch_filtering_on="Activer le filtrage";
25
  $l_switch_filtering_off="Désactiver le filtrage";
28 richard 26
  $l_main_bl="Liste noire principale (version actuelle : ";
27
  $l_download="Télécharger la dernière version";
154 franck 28
  $l_warning="<B>Attention</B> : ce téléchargement peut durer plusieurs minutes.";
165 franck 29
  $l_secondary_bl="Liste noire et liste blanche secondaires";
28 richard 30
}
31
else {
142 richard 32
  $l_title1 = "Antivirus";
33
  $l_title2 = "Domain names and URL filtering";
34
  $l_antivir_on="Actually, the antivirus is on";
35
  $l_antivir_off="Actually, the antivirus is off";
28 richard 36
  $l_webfilter_on="Actually, the WEB filter is on";
37
  $l_webfilter_off="Actually, the WEB filter is off";
142 richard 38
  $l_switch_antivir_on="Switch the antivirus on";
39
  $l_switch_antivir_off="Switch the antivirus off";
40
  $l_switch_filtering_on="Switch the WebFilter on";
41
  $l_switch_filtering_off="Switch the WebFilter off";
28 richard 42
  $l_main_bl="Main blacklist (current version : ";
43
  $l_download="Download the last version";
44
  $l_warning="<B>Be carefull</B> : this download is estimate to fiew minutes.";
45
  $l_secondary_bl="Secondary blacklist and whitelist";
46
}
47
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
48
switch ($choix)
49
{
142 richard 50
case 'AV_On' :
51
	exec ("sudo /usr/local/sbin/alcasar-havp.sh -on");
52
	break;
53
case 'AV_Off' :
54
	exec ("sudo /usr/local/sbin/alcasar-havp.sh -off");
55
	break;
28 richard 56
case 'BL_On' :
57
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -on");
58
	break;
59
case 'BL_Off' :
60
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -off");
61
	break;
62
case 'MAJ_bl' :
63
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -download");
64
	break;
65
case 'MAJ_OSSI' :
66
	$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/domains","w+");
67
	fputs($fichier, $_POST['OSSI_bl_domains']);
68
	fclose($fichier);
69
	unset($_POST['OSSI_bl_domains']);
70
	$fichier=fopen("/etc/dansguardian/lists/exceptionsitelist","w+");
71
	fputs($fichier, $_POST['OSSI_wl_domains']);
72
	fclose($fichier);
73
	unset($_POST['OSSI_wl_domains']);
74
	$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/urls","w+");
75
	fputs($fichier, $_POST['OSSI_bl_urls']);
76
	fclose($fichier);
77
	unset($_POST['OSSI_bl_urls']);
78
	$fichier=fopen("/etc/dansguardian/lists/exceptionurllist","w+");
79
	fputs($fichier, $_POST['OSSI_wl_urls']);
80
	fclose($fichier);
81
	unset($_POST['OSSI_wl_urls']);
82
	exec ("sudo /usr/local/sbin/alcasar-bl.sh -reload");
83
	break;
84
}
85
?>
142 richard 86
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
87
<tr><th><?php echo "$l_title1"; ?></th></tr>
88
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
89
</TABLE>
90
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
28 richard 91
	<tr><td valign="middle" align="left">
92
<?php
93
$pointeur = fopen("/etc/dansguardian/dansguardian.conf", "r");
142 richard 94
$result_antivir = false; $result_filter = false; $out=0;
28 richard 95
if ($pointeur)
96
	{
97
  	while (!feof($pointeur))
98
		{
99
    		$ligne = fgets($pointeur);
142 richard 100
    		if (preg_match("/^proxyport = 8090/", $ligne, $r))
101
			{
102
			$result_antivir = true;
103
			$out++;
104
			}
28 richard 105
    		if (preg_match("/^reportinglevel = 3/", $ligne, $r))
106
			{
142 richard 107
			$result_filter = true;
108
			$out++;
28 richard 109
			}
142 richard 110
		if ($out == 2) break;
28 richard 111
    		}
112
  	}
113
fclose($pointeur);
142 richard 114
if ($result_antivir)
28 richard 115
	{
142 richard 116
	echo "<CENTER><H3>$l_antivir_on</H3></CENTER>";
28 richard 117
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
142 richard 118
	echo "<input type=hidden name='choix' value=\"AV_Off\">";
119
	echo "<input type=submit value=\"$l_switch_antivir_off\">";
120
}
121
else
122
	{
123
	echo "<CENTER><H3>$l_antivir_off</H3></CENTER>";
124
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
125
	echo "<input type=hidden name='choix' value=\"AV_On\">";
126
	echo "<input type=submit value=\"$l_switch_antivir_on\">";
127
	}
128
?>
129
</FORM>
130
</td></tr>
131
</TABLE>
132
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
133
<tr><th><?php echo "$l_title2"; ?></th></tr>
134
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
135
</TABLE>
136
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
137
	<tr><td valign="middle" align="left">
138
<?php
139
if ($result_filter)
140
	{
141
	echo "<CENTER><H3>$l_webfilter_on</H3></CENTER>";
142
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
28 richard 143
	echo "<input type=hidden name='choix' value=\"BL_Off\">";
142 richard 144
	echo "<input type=submit value=\"$l_switch_filtering_off\">";
28 richard 145
}
146
else
147
	{
142 richard 148
	echo "<CENTER><H3>$l_webfilter_off</H3></CENTER>";
28 richard 149
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
150
	echo "<input type=hidden name='choix' value=\"BL_On\">";
142 richard 151
	echo "<input type=submit value=\"$l_switch_filtering_on\">";
28 richard 152
	}
153
echo "</FORM>";
154
echo "</td></tr>";
155
echo "</TABLE>";
142 richard 156
if ($result_filter) require ('web_filter2.php');
28 richard 157
?>
158
</BODY>
159
</HTML>