Subversion Repositories ALCASAR

Rev

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

Rev 1344 Rev 1377
Line 40... Line 40...
40
$Language = 'en';
40
$Language = 'en';
41
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
41
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
42
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
42
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
43
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
43
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
44
if($Language == 'fr'){
44
if($Language == 'fr'){
45
  $l_title1="Filtrage de noms de domaine et d'URL";
-
 
46
  $l_dnsfilter_on="Le filtrage de noms de domaine et d'URL est actuellement activé";
-
 
47
  $l_dnsfilter_off="Le filtrage de noms de domaine et d'URL est actuellement désactivé";
-
 
48
  $l_switch_filtering_on="Activer le filtrage";
-
 
49
  $l_switch_filtering_off="Désactiver le filtrage";
-
 
50
  $l_bl="Liste noire";
45
  $l_bl="Liste noire";
51
  $l_wl="Liste blanche";
46
  $l_wl="Liste blanche";
52
  $l_list_version="Version de la liste : ";
47
  $l_list_version="Version de la liste : ";
53
  $l_bl_categories="Sélectionnez les catégories à filtrer";
48
  $l_bl_categories="Sélectionnez les catégories à filtrer";
54
  $l_wl_categories="Sélectionnez les catégories à autoriser";
49
  $l_wl_categories="Sélectionnez les catégories à autoriser";
Line 88... Line 83...
88
  $l_file_remove="Supprimer";
83
  $l_file_remove="Supprimer";
89
  $l_error_upload="Erreur d'envoi du fichier d'ip";
84
  $l_error_upload="Erreur d'envoi du fichier d'ip";
90
  $l_remove="Supprimer";
85
  $l_remove="Supprimer";
91
  $l_submit="Envoyer";
86
  $l_submit="Envoyer";
92
  $l_nb_ip="Nombre d'IP";
87
  $l_nb_ip="Nombre d'IP";
-
 
88
  $l_update_ip="Mettre à jour les IP";
-
 
89
  $l_update_ip_info="(Temps estimé : 3 min 30 sec)";
-
 
90
  $l_nbDomainNames="Noms de domaine :";
-
 
91
  $l_nbUrl="Url :";
-
 
92
  $l_nbIp="Ip :";
93
}
93
}
94
else {
94
else {
95
  $l_title1="Domain names and URL filtering";
-
 
96
  $l_dnsfilter_on="Actually, the Domain name and URL filter is on";
-
 
97
  $l_dnsfilter_off="Actually, the Domain name and URL filter is off";
-
 
98
  $l_switch_filtering_on="Switch the Filter on";
-
 
99
  $l_switch_filtering_off="Switch the Filter off";
-
 
100
  $l_bl="BlackList";
95
  $l_bl="BlackList";
101
  $l_wl="WhiteList";
96
  $l_wl="WhiteList";
102
  $l_list_version="List version : ";
97
  $l_list_version="List version : ";
103
  $l_bl_categories="Select the categories to filter";
98
  $l_bl_categories="Select the categories to filter";
104
  $l_wl_categories="Select the categories to allow";
99
  $l_wl_categories="Select the categories to allow";
Line 123... Line 118...
123
  $l_allowed_ip="Allowed IP";
118
  $l_allowed_ip="Allowed IP";
124
  $l_rehabilitated_ip="Rehabilitated IP";
119
  $l_rehabilitated_ip="Rehabilitated IP";
125
  $l_rehabilitated_ip_explain="Enter here IP that are blocked by the blacklist <BR> and you want to rehabilitate.";
120
  $l_rehabilitated_ip_explain="Enter here IP that are blocked by the blacklist <BR> and you want to rehabilitate.";
126
  $l_one_ip="Enter one IP per row (example : 123.123.123.123)";
121
  $l_one_ip="Enter one IP per row (example : 123.123.123.123)";
127
  $l_record="Save changes";
122
  $l_record="Save changes";
128
  $l_wait="Once validated, 10 seconds is necessary to compute your modifications";
123
  $l_wait="Once validated, 10 seconds are necessary to compute your modifications";
129
  $l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
124
  $l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
130
  $l_safe_searching="Enabling school/parental control for the search engines google, yahoo, bing, metacrawler and Youtube."; 
125
  $l_safe_searching="Enabling school/parental control for the search engines google, yahoo, bing, metacrawler and Youtube."; 
131
  $l_safe_youtube="For Youtube, enter your ID here : "; 
126
  $l_safe_youtube="For Youtube, enter your ID here : "; 
132
  $l_youtube_id="(<a href='http://www.youtube.com/education_signup' target='cat_help' onclick=window.open('http://www.youtube.com/education_signup','cat_help','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes') title='Youtube for school'>link to create a Youtube Id</a>)";
127
  $l_youtube_id="(<a href='http://www.youtube.com/education_signup' target='cat_help' onclick=window.open('http://www.youtube.com/education_signup','cat_help','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes') title='Youtube for school'>link to create a Youtube Id</a>)";
133
  $l_error_open_file="Error opening file";
128
  $l_error_open_file="Error opening file";
Line 138... Line 133...
138
  $l_file_remove="Remove";
133
  $l_file_remove="Remove";
139
  $l_error_upload="Error during the upload process";
134
  $l_error_upload="Error during the upload process";
140
  $l_remove="Delete";
135
  $l_remove="Delete";
141
  $l_submit="Submit";
136
  $l_submit="Submit";
142
  $l_nb_ip="Number of IP";
137
  $l_nb_ip="Number of IP";
-
 
138
  $l_update_ip="Update IPs";
-
 
139
  $l_update_ip_info="(Estimated time : 3 min 30 sec)";
-
 
140
  $l_nbDomainNames="Domain names :";
-
 
141
  $l_nbUrl="Url :";
-
 
142
  $l_nbIp="Ip :";
143
}
143
}
144
$dir_etc="/usr/local/etc/";
144
$dir_etc="/usr/local/etc/";
145
$dir_dg="/etc/dansguardian/lists/";
145
$dir_dg="/etc/dansguardian/lists/";
146
$dir_bl_ip="/usr/local/share/iptables-bl/";
146
$dir_bl_ip="/usr/local/share/iptables-bl/";
147
$file_wl_ip="/usr/local/share/ossi_wl";
147
$file_wl_ip="/usr/local/share/ossi-ip-wl";
148
$bl_categories=$dir_etc."alcasar-bl-categories";
148
$bl_categories=$dir_etc."alcasar-bl-categories";
149
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled";
149
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled";
150
$wl_categories=$dir_etc."alcasar-wl-categories";
150
$wl_categories=$dir_etc."alcasar-wl-categories";
151
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
151
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
152
$conf_file=$dir_etc."alcasar.conf";
152
$conf_file=$dir_etc."alcasar.conf";
Line 162... Line 162...
162
	if ($tab)
162
	if ($tab)
163
		{
163
		{
164
		foreach ($tab as $line)
164
		foreach ($tab as $line)
165
			{
165
			{
166
			$field=explode("=", $line);
166
			$field=explode("=", $line);
167
			if ($field[0] == "DNS_FILTERING")	{$DNS_FILTERING=trim($field[1]);}
-
 
168
			if ($field[0] == "YOUTUBE_ID")		{$YOUTUBE_ID=trim($field[1]);}
167
			if ($field[0] == "YOUTUBE_ID")		{$YOUTUBE_ID=trim($field[1]);}
169
			}
168
			}
170
		}
169
		}
171
	}
170
	}
172
else { echo "$l_error_open_file $conf_file";}
171
else { echo "$l_error_open_file $conf_file";}
173
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
172
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
174
switch ($choix)
173
switch ($choix)
175
{
174
{
176
case 'BL_On' :
-
 
177
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --on");
-
 
178
	$DNS_FILTERING="on";
-
 
179
	break;
-
 
180
case 'BL_Off' :
-
 
181
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --off");
-
 
182
	$DNS_FILTERING="off";
-
 
183
	break;
-
 
184
case 'Download_list' :
175
case 'Download_list' :
185
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --download");
176
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --download");
186
	break;
177
	break;
187
case 'Active_list' :
178
case 'Active_list' :
188
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --adapt");
179
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --adapt");
189
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
180
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
-
 
181
	shell_exec ("nohup nice -n 10 sudo /usr/local/sbin/alcasar-bl.sh --ip_retrieving > /dev/null 2>/dev/null &");
190
	break;
182
	break;
191
case 'Reject_list' :
183
case 'Reject_list' :
192
	unlink ("$dir_tmp/blacklists.tar.gz"); unlink ("$dir_tmp/md5sum");
184
	unlink ("$dir_tmp/blacklists.tar.gz"); unlink ("$dir_tmp/md5sum");
193
	break;
185
	break;
194
case 'MAJ_cat_bl' :
186
case 'MAJ_cat_bl' :
Line 247... Line 239...
247
	unset($_POST['OSSI_wl_domains']);
239
	unset($_POST['OSSI_wl_domains']);
248
	$fichier=fopen($file_wl_ip, "w+");
240
	$fichier=fopen($file_wl_ip, "w+");
249
	fputs($fichier, form_filter_ip($_POST['OSSI_wl_ip'], "white"));
241
	fputs($fichier, form_filter_ip($_POST['OSSI_wl_ip'], "white"));
250
	fclose($fichier);
242
	fclose($fichier);
251
	unset($_POST['OSSI_wl_ip']);
243
	unset($_POST['OSSI_wl_ip']);
-
 
244
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --ip_retrieving_ossi");
252
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
245
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
253
	break;
246
	break;
254
case 'Specific_filtering' :
247
case 'Specific_filtering' :
255
	$pureip="-pureip_off"; $safesearch="-safesearch_off"; ;
248
	$pureip="-pureip_off"; $safesearch="-safesearch_off"; ;
256
	foreach ($_POST as $key => $value)
249
	foreach ($_POST as $key => $value)
Line 292... Line 285...
292
			echo $l_error_upload;
285
			echo $l_error_upload;
293
		}
286
		}
294
	}
287
	}
295
	exec ("sudo /usr/local/bin/alcasar-iptables.sh");
288
	exec ("sudo /usr/local/bin/alcasar-iptables.sh");
296
	break;
289
	break;
-
 
290
case 'Update_IP_WL' :
-
 
291
	shell_exec ("nohup nice -n 10 sudo /usr/local/sbin/alcasar-bl.sh --ip_retrieving > /dev/null 2>/dev/null &");
-
 
292
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
-
 
293
	break;
297
}
294
}
298
?>
295
?>
299
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
-
 
300
<tr><th><?php echo "$l_title1"; ?></th></tr>
-
 
301
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
-
 
302
</TABLE>
-
 
303
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
-
 
304
	<tr><td valign="middle" align="left">
-
 
305
<?php
296
<?php
306
if ($DNS_FILTERING == "on")
-
 
307
	{
-
 
308
	echo "<CENTER><H3>$l_dnsfilter_on</H3></CENTER>";
-
 
309
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
-
 
310
	echo "<input type=hidden name='choix' value=\"BL_Off\">";
-
 
311
	echo "<input type=submit value=\"$l_switch_filtering_off\">";
-
 
312
}
-
 
313
else
-
 
314
	{
-
 
315
	echo "<CENTER><H3>$l_dnsfilter_off</H3></CENTER>";
-
 
316
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
-
 
317
	echo "<input type=hidden name='choix' value=\"BL_On\">";
-
 
318
	echo "<input type=submit value=\"$l_switch_filtering_on\">";
-
 
319
	}
-
 
320
echo "</FORM>";
-
 
321
echo "</td></tr>";
-
 
322
echo "</TABLE>";
-
 
323
if ($DNS_FILTERING == "on") require ('bl_filter2.php');
297
require ('bl_filter2.php');
324
?>
298
?>
325
</BODY>
299
</BODY>
326
</HTML>
300
</HTML>