Subversion Repositories ALCASAR

Rev

Rev 40 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

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