68,10 → 68,8 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); } |
if($Language == 'fr'){ |
$l_bl="Liste noire"; |
$l_wl="Liste blanche"; |
$l_list_version="Version de la liste : "; |
$l_bl_categories="Sélectionnez les catégories à filtrer"; |
$l_wl_categories="Sélectionnez les catégories à autoriser"; |
$l_download_bl="Télécharger la dernière version"; |
$l_fingerprint="L'empreinte numérique du fichier téléchargé est : "; |
$l_fingerprint2="Vérifiez-là en suivant ce lien (ligne 'blacklists.tar.gz') : "; |
80,17 → 78,13 |
$l_warning="Temps estimé : une minute."; |
$l_specific_filtering="Filtrage special"; |
$l_forbidden_dns="Noms de domaine filtrés"; |
$l_forbidden_dns_explain="Entrez un nom de domaine par ligne (exemple : .domaine.org)"; |
$l_allowed_dns="Noms de domaine autorisés"; |
$l_one_dns="Entrez un nom de domaine par ligne (exemple : .domaine.org)"; |
$l_maj_rehabilitated="Noms de domaine ou IP réhabilités"; |
$l_rehabilitated_dns="Noms de domaine réhabilités"; |
$l_rehabilitated_dns_explain="Entrez ici des noms de domaine bloqués par la liste noire <BR> que vous souhaitez réhabiliter."; |
$l_add_to_bl="Noms de domaine ou IP ajoutés à la liste noire"; |
$l_add_to_wl="Noms de domaine ou IP ajoutés à la liste blanche"; |
$l_forbidden_ip="IP filtrés"; |
$l_forbidden_ip_explain="Entrez une IP par ligne (exemple : 123.123.123.123)<br/>ou une ADRESSE RESEAU (exemple : 123.123.0.0/16)"; |
$l_allowed_ip="IP authorisées"; |
$l_rehabilitated_ip="IP réhabilitées"; |
$l_rehabilitated_ip_explain="Entrez ici des IP bloquées par la liste noire <BR> que vous souhaitez réhabiliter."; |
$l_one_ip="Entrez une IP par ligne (exemple : 123.123.123.123)"; |
117,10 → 111,8 |
} |
else { |
$l_bl="BlackList"; |
$l_wl="WhiteList"; |
$l_list_version="List version : "; |
$l_bl_categories="Select the categories to filter"; |
$l_wl_categories="Select the categories to allow"; |
$l_download_bl="Download the last version"; |
$l_fingerprint="The digital fingerprint of the downloaded blacklist is : "; |
$l_fingerprint2="Verify it with this link (line 'blacklists.tar.gz') : "; |
129,7 → 121,6 |
$l_warning="Estimated time : one minute."; |
$l_specific_filtering="Specific filtering"; |
$l_forbidden_dns="Filtered domain names"; |
$l_forbidden_dns_explain="Enter one domain name per row (exemple : .domain.org)"; |
$l_allowed_dns="Allowed domain names"; |
$l_one_dns="Enter one domain name per row (example : .domain.org)"; |
$l_maj_rehabilitated="Domain names or IP rehabilitated"; |
136,10 → 127,8 |
$l_rehabilitated_dns="Rehabilitated domain names"; |
$l_rehabilitated_dns_explain="Enter here domain names that are blocked by the blacklist <BR> and you want to rehabilitate."; |
$l_add_to_bl="Domain names or IP to add to blacklist"; |
$l_add_to_wl="Domain names or IP to add to whitelist"; |
$l_forbidden_ip="Filtered IP"; |
$l_forbidden_ip_explain="Enter one IP per row (example : 123.123.123.123)<br/>or a NETWORK ADDRESS (example : 123.123.0.0/16)"; |
$l_allowed_ip="Allowed IP"; |
$l_rehabilitated_ip="Rehabilitated IP"; |
$l_rehabilitated_ip_explain="Enter here IP that are blocked by the blacklist <BR> and you want to rehabilitate."; |
$l_one_ip="Enter one IP per row (example : 123.123.123.123)"; |
167,11 → 156,8 |
$dir_etc="/usr/local/etc/"; |
$dir_dg="/etc/dansguardian/lists/"; |
$dir_bl_ip="/usr/local/share/iptables-bl/"; |
$file_wl_ip="/usr/local/share/ossi-ip-wl"; |
$bl_categories=$dir_etc."alcasar-bl-categories"; |
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled"; |
$wl_categories=$dir_etc."alcasar-wl-categories"; |
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled"; |
$conf_file=$dir_etc."alcasar.conf"; |
$dir_blacklist=$dir_dg."blacklist/"; |
$urlregex_file=$dir_dg."urlregexplist"; |
240,32 → 226,6 |
unset($_POST['BL_rehabilited_ip']); |
exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload"); |
break; |
case 'MAJ_cat_wl' : |
$tab=file($wl_categories_enabled); |
if ($tab) |
{ |
$pointeur=fopen($wl_categories_enabled, "w+"); |
foreach ($_POST as $key => $value) |
{ |
if (strstr($key,'chk-')) |
{ |
$line=str_replace('chk-','',$key)."\n"; |
fwrite($pointeur,$line); |
} |
} |
fclose($pointeur); |
} |
else {echo "$l_error_open_file $wl_categories_enabled";} |
$fichier=fopen($dir_dg."blacklists/ossi/domains_wl","w+"); |
fputs($fichier, form_filter($_POST['OSSI_wl_domains'])); |
fclose($fichier); |
unset($_POST['OSSI_wl_domains']); |
$fichier=fopen($file_wl_ip, "w+"); |
fputs($fichier, form_filter_ip($_POST['OSSI_wl_ip'], "white")); |
fclose($fichier); |
unset($_POST['OSSI_wl_ip']); |
exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload"); |
break; |
case 'Specific_filtering' : |
$pureip="-pureip_off"; $safesearch="-safesearch_off"; ; |
foreach ($_POST as $key => $value) |
422,7 → 382,7 |
echo "<tr><td valign='middle' align='left' colspan=10>"; |
echo "<center><b>$l_add_to_bl</b></center></td></tr>"; |
echo "<tr><td width=50% colspan=5 align=center>"; |
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>"; |
echo "<H3>$l_forbidden_dns</H3>$l_one_dns<BR>"; |
echo "<textarea name='OSSI_bl_domains' rows=3 cols=40>"; |
echo_file ($dir_dg."blacklists/ossi/domains"); |
echo "</textarea></td>"; |
433,7 → 393,7 |
echo "</textarea></td></tr><tr><td colspan=10>"; |
echo "<input type='submit' value='$l_record'>"; |
echo "</form> ($l_wait)"; |
echo "</table></td><br/>"; |
echo "</td></tr></table><br/>"; |
?> |
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th><?php echo $l_personal_file_title; ?></th></tr> |
461,65 → 421,6 |
echo "</table><br/>"; |
?> |
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th><?php echo $l_wl; ?></th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr> |
</table> |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1> |
<tr><td valign="middle" align="left" colspan=10> |
<FORM action='bl_filter.php' method=POST> |
<input type='hidden' name='choix' value='MAJ_cat_wl'> |
<?php |
echo "<center>"; |
$nbDomainNames = exec ("wc -l /usr/local/share/dnsmasq-wl/* | tail -n 1 | awk '{print $1}'"); |
$nbUrl = 0; |
$nbIp = 0; |
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>"; |
echo "$l_wl_categories</center></td></tr>"; |
//on lit et on interprete le fichier de catégories |
$cols=1; |
if (file_exists($wl_categories)) |
{ |
$pointeur=fopen($wl_categories,"r"); |
while (!feof ($pointeur)) |
{ |
$ligne=fgets($pointeur, 4096); |
if ($ligne) |
{ |
if ($cols == 1) { echo "<tr>";} |
$categorie=trim(basename($ligne)); |
echo "<td><a href='bl_categories_help.php?liste=wl&cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>$categorie</a><br>"; |
echo "<input type='checkbox' name='chk-$categorie'"; |
// si la ligne est commentée -> categorie non selectionnée |
if (preg_match('/^#/',$ligne, $r)) { echo ">";} |
else { echo "checked>"; } |
echo "</td>"; |
$cols++; |
if ($cols > 10) { |
echo "</tr>"; |
$cols=1; } |
} |
} |
fclose($pointeur); |
} |
else { |
echo "$l_error_open_file $wl_categories"; |
} |
echo "<tr><td valign='middle' align='left' colspan=10>"; |
echo "<center><b>$l_add_to_wl</b></center></td></tr>"; |
echo "<tr><td width=50% colspan=5 align=center>"; |
echo "<H3>$l_allowed_dns</H3>$l_forbidden_dns_explain<BR>"; |
echo "<textarea name='OSSI_wl_domains' rows=3 cols=40>"; |
echo_file ($dir_dg."blacklists/ossi/domains_wl"); |
echo "</textarea></td>"; |
echo "<td width=50% colspan=5 align=center>"; |
echo "<H3>$l_allowed_ip</H3>$l_forbidden_ip_explain<BR>"; |
echo "<textarea name='OSSI_wl_ip' rows=3 cols=40>"; |
echo_ip_file ($file_wl_ip); |
echo "</textarea></td></tr><tr><td colspan=10>"; |
echo "<input type='submit' value='$l_record'></form></td></tr>"; |
?> |
</TABLE><br/> |
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th><?php echo $l_specific_filtering; ?></th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr> |
</table> |