15,6 → 15,12 |
if ($list[strlen($list)-1] != "\n") { $list[strlen($list)]="\n";} ;} ; |
return $list; |
} |
function form_filter_ip ($form_content) |
{ |
$list = form_filter($form_content); |
$list = preg_replace("/(.*)\n/", "add blacklist_ip_blocked $1\n", $list); |
return $list; |
} |
# Choice of language |
$Language = 'en'; |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){ |
42,24 → 48,33 |
$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 URLs réhabilités"; |
$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 URLs ajoutés à la liste noire"; |
$l_add_to_wl="Noms de domaine ou URLs ajoutés à la liste blanche"; |
$l_forbidden_url="URL filtrés"; |
$l_forbidden_url_explain="Entrez une URL par ligne (exemple : www.domaine.org/perso/index.htm)"; |
$l_allowed_url="URL authorisés"; |
$l_rehabilitated_url="URL réhabilités"; |
$l_rehabilitated_url_explain="Entrez ici des URL bloquées par la liste noire <BR> que vous souhaitez réhabiliter."; |
$l_one_url="Entrez une URL par ligne (exemple : www.domaine.org/perso/index.htm)"; |
$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)"; |
$l_record="Enregistrer les modifications"; |
$l_wait="Une fois validées, 30 secondes sont nécessaires pour traiter vos modifications"; |
$l_wait="Une fois validées, 10 secondes sont nécessaires pour traiter vos modifications"; |
$l_ip_filtering="Filtrer les URLs contenant une adresse IP au lieu d'un nom de domaine (ex: http://25.56.58.59/index.htm)"; |
$l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche : google, yahoo, bing, metacrawler et Youtube."; |
$l_safe_youtube="Pour Youtube, entrez votre identifiant ici : "; |
$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'>lien pour créer un identifiant Youtube (Id)</a>)"; |
$l_error_open_file="Erreur d'ouverture du fichier"; |
$l_ip_file_title="Fichier d'IP"; |
$l_file_list="Liste des fichiers IP"; |
$l_add_ip_file="Ajouter un fichier d'IP (une IP par ligne)"; |
$l_file_name="Nom du fichier"; |
$l_file_remove="Supprimer"; |
$l_error_upload="Erreur d'envoi du fichier d'ip"; |
$l_remove="Supprimer"; |
$l_submit="Envoyer"; |
$l_nb_ip="Nombre d'IP"; |
} |
else { |
$l_title1="Domain names and URL filtering"; |
83,27 → 98,37 |
$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 URLs rehabilitated"; |
$l_maj_rehabilitated="Domain names or IP rehabilitated"; |
$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 URLs to add to blacklist"; |
$l_add_to_wl="Domain names or URLs to add to whitelist"; |
$l_forbidden_url="Filtered URL"; |
$l_forbidden_url_explain="Enter one URL per row (example : www.domaine.org/perso/index.htm)"; |
$l_allowed_url="Allowed URL"; |
$l_rehabilitated_url="Rehabilitated URL"; |
$l_rehabilitated_url_explain="Enter here URL that are blocked by the blacklist <BR> and you want to rehabilitate."; |
$l_one_url="Enter one URL per row (example : www.domaine.org/perso/index.htm)"; |
$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)"; |
$l_record="Save changes"; |
$l_wait="Once validated, 30 seconds is necessary to compute your modifications"; |
$l_wait="Once validated, 10 seconds is necessary to compute your modifications"; |
$l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)"; |
$l_safe_searching="Enabling school/parental control for the search engines google, yahoo, bing, metacrawler and Youtube."; |
$l_safe_youtube="For Youtube, enter your ID here : "; |
$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>)"; |
$l_error_open_file="Error opening file"; |
$l_error_open_file="Error opening file"; |
$l_ip_file_title="IP files"; |
$l_file_list="IP files list"; |
$l_add_ip_file="Add a file of IP (one IP per line)"; |
$l_file_name="Filename"; |
$l_file_remove="Remove"; |
$l_error_upload="Error during the upload process"; |
$l_remove="Delete"; |
$l_submit="Submit"; |
$l_nb_ip="Number of IP"; |
} |
$dir_etc="/usr/local/etc/"; |
$dir_dg="/etc/dansguardian/lists/"; |
$dir_bl_ip="/usr/local/share/iptables-bl/"; |
$bl_categories=$dir_etc."alcasar-bl-categories"; |
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled"; |
$wl_categories=$dir_etc."alcasar-wl-categories"; |
113,6 → 138,7 |
$urlregex_file=$dir_dg."urlregexplist"; |
$bannedsite_file=$dir_dg."bannedsitelist"; |
$dir_tmp="/tmp/blacklists"; |
$upload_dir = "/usr/local/share/iptables-bl-enabled/"; |
# default values |
if (is_file ($conf_file)) |
{ |
161,7 → 187,6 |
$line=str_replace('chk-','',$key)."\n"; |
fwrite($pointeur,$line); |
} |
echo "$key<br/>"; |
} |
fclose($pointeur); |
} |
174,14 → 199,14 |
fputs($fichier, form_filter($_POST['BL_rehabilited_domains'])); |
fclose($fichier); |
unset($_POST['BL_rehabilited_domains']); |
$fichier=fopen($dir_dg."blacklists/ossi/urls","w+"); |
fputs($fichier, form_filter($_POST['OSSI_bl_urls'])); |
$fichier=fopen($dir_bl_ip."ossi","w+"); |
fputs($fichier, form_filter_ip($_POST['OSSI_bl_ip'])); |
fclose($fichier); |
unset($_POST['OSSI_bl_urls']); |
$fichier=fopen($dir_dg."exceptionurllist","w+"); |
fputs($fichier, form_filter($_POST['BL_rehabilited_urls'])); |
unset($_POST['OSSI_bl_ip']); |
$fichier=fopen($dir_dg."exceptioniplist","w+"); |
fputs($fichier, form_filter($_POST['BL_rehabilited_ip'])); |
fclose($fichier); |
unset($_POST['BL_rehabilited_urls']); |
unset($_POST['BL_rehabilited_ip']); |
exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload"); |
break; |
case 'MAJ_cat_wl' : |
222,7 → 247,34 |
file_put_contents($conf_file, str_replace("YOUTUBE_ID=$YOUTUBE_ID", "YOUTUBE_ID=$New_ID", file_get_contents($conf_file))); |
$YOUTUBE_ID=$New_ID; |
exec ("sudo /usr/local/sbin/alcasar-url_filter.sh $safesearch $pureip"); |
break; |
break; |
case 'MAJ_ip_file_delete' : |
foreach($_POST as $fichier => $value) |
{ |
if($fichier != "choix") |
{ |
exec("rm -rf $upload_dir$fichier"); |
} |
} |
exec ("sudo /usr/local/bin/alcasar-iptables.sh"); |
break; |
case 'MAJ_ip_file_upload' : |
$nom = basename($_FILES['fichier_ip']['name']); |
# Si un fichier a été choisi |
if(!empty($nom)) |
{ |
# On l'upload |
if(move_uploaded_file($_FILES['fichier_ip']['tmp_name'], $upload_dir."ossi-".$nom)) |
{ |
exec("sed -i \"s/^/add blacklist_ip_blocked /g\" $upload_dir\ossi-$nom"); # On crée la sauvegarde du set |
} |
else |
{ |
echo $l_error_upload; |
} |
} |
exec ("sudo /usr/local/bin/alcasar-iptables.sh"); |
break; |
} |
?> |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0> |