67,7 → 67,7 |
{ |
$url_tld = "http://data.iana.org/TLD/tlds-alpha-by-domain.txt"; |
$result_tld = file_get_contents($url_tld,false); |
$max_tld = 18; #valeur de base si le site ne répond plus |
$max_tld = 18; #valeur de base si le site ne répond plus |
if($result_tld !== FALSE){ |
foreach(explode("\n", $result_tld) as $line) |
{ |
90,6 → 90,7 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); } |
if($Language == 'fr'){ |
$l_bl="Liste noire générale"; |
$l_load="Chargement..."; |
$l_list_version="Version de la liste : "; |
$l_bl_categories="Sélectionnez les catégories à filtrer"; |
$l_download_bl="Télécharger la dernière version"; |
113,9 → 114,9 |
$l_record="Enregistrer les 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, suivez les étapes ici : "; |
$l_youtube_id="(<a href='https://support.google.com/youtube/answer/174084?hl=fr' 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_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche google."; |
$l_safe_youtube="Pour un Youtube restreint, suivez les étapes ici : "; |
$l_youtube_id="(<a href='https://support.google.com/youtube/answer/174084?hl=fr' target='cat_help' onclick=window.open('https://support.google.com/youtube/answer/174084?hl=fr','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_additional_file_title="Fichiers de 'listes noires' additionnels"; |
$l_file_list="Liste des fichiers"; |
134,6 → 135,7 |
} |
else { |
$l_bl="BlackList"; |
$l_load="Loading..."; |
$l_list_version="List version : "; |
$l_bl_categories="Select the categories to filter"; |
$l_download_bl="Download the last version"; |
159,8 → 161,8 |
$l_wait="Once validated, 10 seconds are 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, follow these steps : "; |
$l_youtube_id="(<a href='https://support.google.com/youtube/answer/174084?hl=en' 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_safe_youtube="For safe Youtube, follow these steps : "; |
$l_youtube_id="(<a href='https://support.google.com/youtube/answer/174084?hl=en' target='cat_help' onclick=window.open('https://support.google.com/youtube/answer/174084?hl=en','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_additional_file_title="Additional blacklist files"; |
$l_file_list="Files list"; |
198,10 → 200,6 |
foreach ($tab as $line) |
{ |
$field=explode("=", $line); |
if ($field[0] == "YOUTUBE_ID") |
{ |
$YOUTUBE_ID=trim($field[1]); |
} |
if ($field[0] == "PRIVATE_IP") |
{ |
$PRIVATE_IP_MASK=trim($field[1]); |
287,10 → 285,10 |
if(move_uploaded_file($_FILES['fichier_ip']['tmp_name'], $upload_dir_ip.$nom)) |
{ |
# On extrait uniquement les ip du fichier |
exec("grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' $upload_dir_ip$nom > $upload_dir_ip\ossi-ip"); |
exec("grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' $upload_dir_ip$nom > $upload_dir_ip\ossi_ip"); |
|
# Suppression des doublons |
exec("sort -u $upload_dir_ip\ossi-ip > $upload_dir_ip\ossi-$nom && rm -f $upload_dir_ip\ossi-ip"); |
exec("sort -u $upload_dir_ip\ossi_ip > $upload_dir_ip\ossi-$nom && rm -f $upload_dir_ip\ossi_ip"); |
|
# On adapte le fichier à la sauvegarde du set |
exec("sed -i \"s/^/add blacklist_ip_blocked /g\" $upload_dir_ip\ossi-$nom"); |
298,10 → 296,10 |
|
# On extrait uniquement les noms de domaine |
# max_tld() retourne le nombre max de charactere pour un top-level dns |
exec("grep -Eo '([a-zA-Z0-9_-]+\.){1,2}[a-zA-Z]{2,".max_tld()."}' $upload_dir_ip$nom > $upload_dir_domain_names\ossi-domain_names"); |
exec("grep -Eo '([a-zA-Z0-9_-]+\.){1,2}[a-zA-Z]{2,".max_tld()."}' $upload_dir_ip$nom > $upload_dir_domain_names\ossi_domain_names"); |
|
# Suppression des doublons |
exec("sort -u $upload_dir_domain_names\ossi-domain_names > $upload_dir_domain_names\ossi-$nom && rm -f $upload_dir_domain_names\ossi-domain_names"); |
exec("sort -u $upload_dir_domain_names\ossi_domain_names > $upload_dir_domain_names\ossi-$nom && rm -f $upload_dir_domain_names\ossi_domain_names"); |
|
# On adapte le fichier pour Dnsmasq |
exec("sed -i \"s/^/address=\//g\" $upload_dir_domain_names\ossi-$nom"); |
315,6 → 313,7 |
echo $l_error_upload; |
} |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload"); |
exec ("sudo /usr/local/bin/alcasar-iptables.sh "); |
} |
break; |
} |
334,15 → 333,15 |
echo "$l_fingerprint"; echo_file ("$dir_tmp/md5sum"); |
echo "<br>$l_fingerprint2<a href='http://dsi.ut-capitole.fr/blacklists/download/MD5SUM.LST' target='cat_help' onclick=window.open('http://dsi.ut-capitole.fr/blacklists/download/MD5SUM.LST','cat_help','width=600,height=150,toolbar=no,scrollbars=yes,resizable=yes') title='verify fingerprint'>dsi.ut-capitole.fr/blacklists/download/MD5SUM.LST</a><br>"; |
echo "<input type='hidden' name='choix' value='Active_list'>"; |
echo "<input type='submit' value='$l_activate_bl'> ($l_warning)</FORM>"; |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';\" value='$l_activate_bl'> ($l_warning)</FORM>"; |
echo "<FORM action='bl_filter.php' method=POST>"; |
echo "<input type='hidden' name='choix' value='Reject_list'>"; |
echo "<input type='submit' value='$l_reject_bl'></form>"; |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';\" value='$l_reject_bl'></form>"; |
} |
else |
{ |
echo "<input type='hidden' name='choix' value='Download_list'>"; |
echo "<input type='submit' value='$l_download_bl'>"; |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';\" value='$l_download_bl'>"; |
echo " ($l_warning)"; |
} |
?> |
421,10 → 420,12 |
echo "<textarea name='OSSI_bl_ip' rows=3 cols=40>"; |
echo_ip_file ($dir_bl_ip."ossi"); |
echo "</textarea></td></tr><tr><td colspan=10>"; |
echo "<input type='submit' value='$l_record'>"; |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';\" value='$l_record'>"; |
echo "</form> ($l_wait)"; |
echo "</td></tr></table><br/>"; |
?> |
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th><?php echo $l_additional_file_title; ?></th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr> |
439,7 → 440,7 |
exec("cd $upload_dir_ip && ls ossi-*", $fichiersIp); |
foreach($fichiersIp as $fichier => $value) |
{ |
echo "<tr><td><center>".exec("sed 's/^.....//g' <<< $value")."</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>"; |
echo "<tr><td><center>".exec("sed 's/^.....//g' <<< $value")."</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' onClick=\"this.disabled=true; this.value='$l_load';\" name='$value' value='$l_remove'></center></td></tr>"; |
} |
echo "</table><br/></td></form><form action='bl_filter.php' method='POST' enctype='multipart/form-data'>"; |
echo "<input type='hidden' name='choix' value='MAJ_ip_file_upload'><td width=50% colspan=5 align=center>"; |
446,15 → 447,18 |
echo "<H3>$l_add_file</H3>"; |
echo "$l_add_file_explain"; |
echo "<input type='file' name='fichier_ip'>"; |
echo "<input type='submit' value='$l_submit'>"; |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';\" value='$l_submit'>"; |
echo "</td></tr>"; |
echo "</form>"; |
echo "</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> |
|
|
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1> |
<FORM action='bl_filter.php' method='POST'> |
<input type='hidden' name='choix' value='Specific_filtering'> |
512,7 → 516,7 |
echo "> $l_safe_searching"; |
echo "<br>$l_safe_youtube"; |
echo " $l_youtube_id<tr><td>"; |
echo "<input type='submit' value='$l_record'></td></tr>"; |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';\" value='$l_record'></td></tr>"; |
?> |
</FORM> |
</TABLE> |