Line 85... |
Line 85... |
85 |
|
85 |
|
86 |
# Choice of language
|
86 |
# Choice of language
|
87 |
$Language = 'en';
|
87 |
$Language = 'en';
|
88 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
88 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
89 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
89 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
90 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
90 |
$Language = strtolower(substr(chop($Langue[0]),0,2));
|
- |
|
91 |
}
|
91 |
if($Language == 'fr'){
|
92 |
if($Language == 'fr'){
|
92 |
$l_bl="Liste noire générale";
|
93 |
$l_bl="Liste noire générale";
|
93 |
$l_load="Chargement...";
|
94 |
$l_load="Chargement...";
|
94 |
$l_list_version="Version de la liste : ";
|
95 |
$l_list_version="Version de la liste : ";
|
95 |
$l_bl_categories="Sélectionnez les catégories à filtrer";
|
96 |
$l_bl_categories="Sélectionnez les catégories à filtrer";
|
Line 133... |
Line 134... |
133 |
$l_nbUrl="Url :";
|
134 |
$l_nbUrl="Url :";
|
134 |
$l_nbIp="Ip :";
|
135 |
$l_nbIp="Ip :";
|
135 |
$l_update_cat="Mise a jour des catégories automatiquement?";
|
136 |
$l_update_cat="Mise a jour des catégories automatiquement?";
|
136 |
$l_no_update_cat = "Désactiver";
|
137 |
$l_no_update_cat = "Désactiver";
|
137 |
$l_yes_update_cat = "Activer (Toutes les 12 heures)";
|
138 |
$l_yes_update_cat = "Activer (Toutes les 12 heures)";
|
- |
|
139 |
$l_disable="Désactiver";
|
- |
|
140 |
$l_enable="Activer";
|
- |
|
141 |
$l_file_state="Etat";
|
138 |
}
|
142 |
}
|
139 |
else {
|
143 |
else {
|
140 |
$l_bl="BlackList";
|
144 |
$l_bl="BlackList";
|
141 |
$l_load="Loading...";
|
145 |
$l_load="Loading...";
|
142 |
$l_list_version="List version : ";
|
146 |
$l_list_version="List version : ";
|
Line 182... |
Line 186... |
182 |
$l_nbUrl="Url :";
|
186 |
$l_nbUrl="Url :";
|
183 |
$l_nbIp="Ip :";
|
187 |
$l_nbIp="Ip :";
|
184 |
$l_update_cat="Mise a jour des catégories automatiquement?";
|
188 |
$l_update_cat="Mise a jour des catégories automatiquement?";
|
185 |
$l_no_update_cat = "Disable";
|
189 |
$l_no_update_cat = "Disable";
|
186 |
$l_yes_update_cat = "Enable (Every 12 hours)";
|
190 |
$l_yes_update_cat = "Enable (Every 12 hours)";
|
- |
|
191 |
$l_disable="Disable";
|
- |
|
192 |
$l_enable="Enable";
|
- |
|
193 |
$l_file_state="State";
|
187 |
}
|
194 |
}
|
188 |
$dir_etc="/usr/local/etc/";
|
195 |
$dir_etc="/usr/local/etc/";
|
189 |
$dir_dg="/etc/dansguardian/lists/";
|
196 |
$dir_dg="/etc/dansguardian/lists/";
|
190 |
$dir_bl_ip="/usr/local/share/iptables-bl/";
|
197 |
$dir_bl_ip="/usr/local/share/iptables-bl/";
|
191 |
$bl_categories=$dir_etc."alcasar-bl-categories";
|
198 |
$bl_categories=$dir_etc."alcasar-bl-categories";
|
Line 195... |
Line 202... |
195 |
$urlregex_file=$dir_dg."urlregexplist";
|
202 |
$urlregex_file=$dir_dg."urlregexplist";
|
196 |
$bannedsite_file=$dir_dg."bannedsitelist";
|
203 |
$bannedsite_file=$dir_dg."bannedsitelist";
|
197 |
$dir_tmp="/tmp/blacklists";
|
204 |
$dir_tmp="/tmp/blacklists";
|
198 |
$upload_dir_ip = "/usr/local/share/iptables-bl-enabled/";
|
205 |
$upload_dir_ip = "/usr/local/share/iptables-bl-enabled/";
|
199 |
$upload_dir_domain_names = "/usr/local/share/dnsmasq-bl-enabled/";
|
206 |
$upload_dir_domain_names = "/usr/local/share/dnsmasq-bl-enabled/";
|
- |
|
207 |
$dir_ip = "/usr/local/share/iptables-bl/";
|
- |
|
208 |
$dir_domain_names = "/usr/local/share/dnsmasq-bl/";
|
200 |
$update_file_cat="/usr/local/etc/update_cat.conf";
|
209 |
$update_file_cat="/usr/local/etc/update_cat.conf";
|
201 |
|
210 |
|
202 |
|
211 |
|
203 |
# default values
|
212 |
# default values
|
204 |
if (is_file ($conf_file))
|
213 |
if (is_file ($conf_file))
|
Line 278... |
Line 287... |
278 |
if (strstr($key,'chk-ip')) $pureip="-pureip_on";
|
287 |
if (strstr($key,'chk-ip')) $pureip="-pureip_on";
|
279 |
if (strstr($key,'chk-safesearch')) $safesearch="-safesearch_on";
|
288 |
if (strstr($key,'chk-safesearch')) $safesearch="-safesearch_on";
|
280 |
}
|
289 |
}
|
281 |
exec ("sudo /usr/local/bin/alcasar-url_filter_bl.sh $safesearch $pureip");
|
290 |
exec ("sudo /usr/local/bin/alcasar-url_filter_bl.sh $safesearch $pureip");
|
282 |
break;
|
291 |
break;
|
283 |
case 'MAJ_ip_file_delete' :
|
292 |
case 'MAJ_ip_file' :
|
284 |
foreach($_POST as $fichier => $value)
|
293 |
foreach($_POST as $fichier => $value)
|
285 |
{
|
294 |
{
|
286 |
if($fichier != "choix")
|
295 |
if($fichier != "choix")
|
287 |
{
|
296 |
{
|
- |
|
297 |
$action=$_POST[$fichier];
|
- |
|
298 |
if($action == $l_remove) //delete
|
- |
|
299 |
{
|
288 |
exec("rm -rf $upload_dir_ip$fichier");
|
300 |
exec("rm -rf $upload_dir_ip$fichier");
|
289 |
exec("rm -rf $upload_dir_domain_names$fichier");
|
301 |
exec("rm -rf $upload_dir_domain_names$fichier");
|
290 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
302 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
291 |
}
|
303 |
}
|
- |
|
304 |
if($action == $l_disable) //disable
|
- |
|
305 |
{
|
- |
|
306 |
exec("mv -f $upload_dir_ip$fichier $dir_ip$fichier");
|
- |
|
307 |
exec("mv -f $upload_dir_domain_names$fichier $dir_domain_names$fichier");
|
- |
|
308 |
exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
- |
|
309 |
}
|
- |
|
310 |
if($action == $l_enable) //enable
|
- |
|
311 |
{
|
- |
|
312 |
exec("mv -f $dir_ip$fichier $upload_dir_ip$fichier");
|
- |
|
313 |
exec("mv -f $dir_domain_names$fichier $upload_dir_domain_names$fichier");
|
- |
|
314 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
- |
|
315 |
}
|
- |
|
316 |
}
|
292 |
}
|
317 |
}
|
293 |
break;
|
318 |
break;
|
294 |
case 'MAJ_ip_file_upload' :
|
319 |
case 'MAJ_ip_file_upload' :
|
295 |
$nom = str_replace (".", "_",basename($_FILES['fichier_ip']['name']));
|
320 |
$nom = str_replace (".", "_",basename($_FILES['fichier_ip']['name']));
|
296 |
# Si un fichier a été choisi
|
321 |
# Si un fichier a été choisi
|
Line 460... |
Line 485... |
460 |
<tr><th><?php echo $l_additional_file_title; ?></th></tr>
|
485 |
<tr><th><?php echo $l_additional_file_title; ?></th></tr>
|
461 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
|
486 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
|
462 |
</table>
|
487 |
</table>
|
463 |
<table width="100%" border=1 cellspacing=0 cellpadding=1>
|
488 |
<table width="100%" border=1 cellspacing=0 cellpadding=1>
|
464 |
<form action='bl_filter.php' method='POST'>
|
489 |
<form action='bl_filter.php' method='POST'>
|
465 |
<input type='hidden' name='choix' value='MAJ_ip_file_delete'>
|
490 |
<input type='hidden' name='choix' value='MAJ_ip_file'>
|
466 |
<?php
|
491 |
<?php
|
467 |
echo "<tr><td width=50% colspan=5 align=center>";
|
492 |
echo "<tr><td width=50% colspan=5 align=center>";
|
468 |
echo "<H3>$l_file_list</H3>";
|
493 |
echo "<H3>$l_file_list</H3>";
|
469 |
echo "<table cellspacing=2 cellpadding=3 border=1><tr><th>$l_file_name<th>$l_nb_ip<th>$l_nb_domain_names<th>$l_file_remove</tr>";
|
494 |
echo "<table cellspacing=2 cellpadding=3 border=1><tr><th>$l_file_name<th>$l_nb_ip<th>$l_nb_domain_names<th>$l_file_state<th>$l_file_remove</tr>";
|
470 |
|
495 |
|
- |
|
496 |
//liste des fichiers activés
|
471 |
$fichiersIp = array_diff(scandir($upload_dir_ip), array('ossi','ossi-ip-safesearch','..','.'));
|
497 |
$fichiersIp = array_diff(scandir($upload_dir_ip), array('ossi','ossi-ip-safesearch','..','.'));
|
472 |
$fichiersIp = preg_grep("/^ossi-/",$fichiersIp);
|
498 |
$fichiersIp = preg_grep("/^ossi-/",$fichiersIp);
|
473 |
foreach($fichiersIp as $fichier => $value)
|
499 |
foreach($fichiersIp as $fichier => $value)
|
474 |
{
|
500 |
{
|
475 |
echo "<tr><td><center><a href='bl_categories_help.php?liste=bl&cat=$value&ossi=yes&filtre=domain' target='cat_help' onclick=window.open('bl_categories_help','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>".exec("sed 's/^.....//g' <<< $value")."</a></center></td><td><center>".exec("wc -l $upload_dir_ip$value | awk '{print $1}'")."</center></td><td><center>".exec("wc -l $upload_dir_domain_names$value | awk '{print $1}'")."</center></td><td><center><input type='submit' name='$value' value='$l_remove'></center></td></tr>";
|
501 |
echo "<tr><td><center><a href='bl_categories_help.php?liste=bl&cat=$value&ossi=yes&filtre=domain' target='cat_help' onclick=window.open('bl_categories_help','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>".exec("sed 's/^.....//g' <<< $value")."</a></center></td><td><center>".exec("wc -l $upload_dir_ip$value | awk '{print $1}'")."</center></td><td><center>".exec("wc -l $upload_dir_domain_names$value | awk '{print $1}'")."</center></td><td><center><input type='submit' name='$value' value='$l_disable'></center></td><td><center><input type='submit' name='$value' value='$l_remove'></center></td></tr>";
|
476 |
}
|
502 |
}
|
- |
|
503 |
//liste des fichiers desactivés
|
- |
|
504 |
$fichiersIp = array_diff(scandir($dir_ip), array('ossi','ossi-ip-safesearch','..','.'));
|
- |
|
505 |
$fichiersIp = preg_grep("/^ossi-/",$fichiersIp);
|
- |
|
506 |
foreach($fichiersIp as $fichier => $value)
|
- |
|
507 |
{
|
- |
|
508 |
echo "<tr><td bgcolor='BEBEBE'><center><a href='bl_categories_help.php?liste=bl&cat=$value&ossi=yes&filtre=domain&state=disable' target='cat_help' onclick=window.open('bl_categories_help','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>".exec("sed 's/^.....//g' <<< $value")."</a></center></td><td bgcolor='BEBEBE'><center>".exec("wc -l $upload_dir_ip$value | awk '{print $1}'")."</center></td><td bgcolor='BEBEBE'><center>".exec("wc -l $upload_dir_domain_names$value | awk '{print $1}'")."</center></td><td bgcolor='BEBEBE'><center><input type='submit' name='$value' value='$l_enable'></center></td><td bgcolor='BEBEBE'><center><input type='submit' name='$value' value='$l_remove'></center></td></tr>";
|
- |
|
509 |
}
|
- |
|
510 |
|
477 |
echo "</table><br/></td></form><form action='bl_filter.php' method='POST' enctype='multipart/form-data'>";
|
511 |
echo "</table><br/></td></form><form action='bl_filter.php' method='POST' enctype='multipart/form-data'>";
|
478 |
echo "<input type='hidden' name='choix' value='MAJ_ip_file_upload'><td width=50% colspan=5 align=center>";
|
512 |
echo "<input type='hidden' name='choix' value='MAJ_ip_file_upload'><td width=50% colspan=5 align=center>";
|
479 |
echo "<H3>$l_add_file</H3>";
|
513 |
echo "<H3>$l_add_file</H3>";
|
480 |
echo "$l_add_file_explain";
|
514 |
echo "$l_add_file_explain";
|
481 |
echo "<input type='file' name='fichier_ip'>";
|
515 |
echo "<input type='file' name='fichier_ip'>";
|