67,7 → 67,7 |
$Language = 'en'; |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){ |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']); |
$Language = strtolower(substr(chop($Langue[0]),0,2)); |
$Language = strtolower(substr(chop($Langue[0]),0,2)); |
} |
if($Language == 'fr'){ |
$l_wl="Liste blanche générale"; |
79,15 → 79,14 |
$l_one_dns_ip="Entrez un nom de domaine ou une adresse IP ou une adresse de réseau par ligne<br>exemple (domaine) : .domaine.org - exemple (ip) : 61.54.52.56 - exemple (réseau) : 172.16.0.0/16"; |
$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."; |
$l_safe_youtube="Pour un contrôle parental sur Youtube, suivez les étapes ici : "; |
$l_safe_youtube="Pour un contrôle parental sur 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('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 blanches' additionnels"; |
$l_file_list="Liste des fichiers"; |
$l_add_file="Ajouter un fichier"; |
$l_add_file_explain="Chaque ligne du fichier doit être une adresse IP ou un nom de domaine"; |
$l_add_file_explain="Chaque ligne du fichier doit être une adresse IP ou un nom de domaine"; |
$l_file_name="Nom du fichier"; |
$l_file_action="Action"; |
$l_error_upload="Erreur d'envoi du fichier"; |
113,15 → 112,14 |
$l_one_dns_ip="Enter one domain name or one IP address or one network address per row <br>example (domain): .domain.org - example (ip): 61.54.56.52 - example (network) : 172.16.0.0/16"; |
$l_record="Save changes"; |
$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"; |
$l_safe_youtube="For a safe Youtube search, follow these steps : "; |
$l_safe_searching="Enabling school/parental control for the search engines google"; |
$l_safe_youtube="For a safe Youtube search, 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 WhiteList files"; |
$l_file_list="Files list"; |
$l_add_file="Add a file"; |
$l_add_file_explain="Each line of the file must be an IP address or a domain name"; |
$l_add_file_explain="Each line of the file must be an IP address or a domain name"; |
$l_file_name="Filename"; |
$l_file_action="Action"; |
$l_error_upload="Error during the upload process"; |
146,7 → 144,7 |
$wl_categories=$dir_etc."alcasar-wl-categories"; |
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled"; |
$conf_file=$dir_etc."alcasar.conf"; |
$urlregex_file=$dir_dg."urlregexplist"; |
$iptables_safesearch_file=$dir_wl_ip_enabled."ossi-ip-safesearch"; |
$bannedsite_file=$dir_dg."bannedsitelist"; |
$dir_tmp="/tmp/blacklists"; |
|
168,7 → 166,7 |
} |
} |
} |
} |
} |
else { echo "$l_error_open_file $conf_file";} |
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; } |
switch ($choix) |
191,12 → 189,12 |
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";} |
207,13 → 205,12 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload"); |
break; |
case 'Specific_filtering' : |
$pureip="-pureip_off"; $safesearch="-safesearch_off"; ; |
$safesearch="-safesearch_off"; ; |
foreach ($_POST as $key => $value) |
{ |
if (strstr($key,'chk-ip')) $pureip="-pureip_on"; |
if (strstr($key,'chk-safesearch')) $safesearch="-safesearch_on"; |
} |
exec ("sudo /usr/local/bin/alcasar-url_filter_bl.sh $safesearch $pureip"); |
exec ("sudo /usr/local/bin/alcasar-url_filter_wl.sh $safesearch"); |
break; |
case 'MAJ_ossi_file' : |
foreach($_POST as $fichier => $value) |
223,14 → 220,14 |
$action=$_POST[$fichier]; |
if($action == $l_remove) //delete |
{ |
exec("/bin/sed -i ".escapeshellarg("/^$fichier\$/d")." $wl_categories_enabled"); |
exec("/bin/sed -i ".escapeshellarg("/^$fichier\$/d")." $wl_categories"); |
exec("/bin/sed -i ".escapeshellarg("/^$fichier\$/d")." $wl_categories_enabled"); |
exec("/bin/sed -i ".escapeshellarg("/^$fichier\$/d")." $wl_categories"); |
exec("rm -rf ".escapeshellarg("$dir_blacklist$fichier")); |
exec("sudo /usr/local/bin/alcasar-bl.sh --reload"); |
} |
if($action == $l_disable) //disable |
{ |
exec("/bin/sed -i ".escapeshellarg("/^$fichier\$/d")." $wl_categories_enabled"); |
exec("/bin/sed -i ".escapeshellarg("/^$fichier\$/d")." $wl_categories_enabled"); |
exec("sudo /usr/local/bin/alcasar-bl.sh --reload"); |
} |
if($action == $l_enable) //enable |
244,7 → 241,7 |
case 'MAJ_ossi_file_upload' : |
$file_name = str_replace (".", "_",basename($_FILES['fichier_ip']['name'])); |
if(!empty($file_name)) |
{ |
{ |
$dest_dir = $dir_blacklist."ossi-wl-".$file_name; |
exec("mkdir ".escapeshellarg($dest_dir)); |
$file=$_FILES['fichier_ip']['tmp_name']; |
280,9 → 277,9 |
$nbUrl = "0"; |
$nbIp = exec("wc -l /usr/local/share/iptables-wl/* | tail -n 1 | awk '{print $1}'"); |
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>"; |
echo "$l_wl_categories</center></td></tr>"; |
echo "$l_wl_categories</center></td></tr>"; |
//read & display all WL categories (checked or not) |
$cols=1; |
$cols=1; |
if (file_exists($wl_categories)) |
{ |
$wl_files = file($wl_categories); |
357,64 → 354,19 |
<FORM action='wl_filter.php' method='POST'> |
<input type='hidden' name='choix' value='Specific_filtering'> |
<tr><td> |
<input type='checkbox' name='chk-ip' |
<?php |
// verify "pureip" filtering state |
if (file_exists($bannedsite_file)) |
{ |
$pointeur=fopen($bannedsite_file,"r"); |
while (!feof ($pointeur)) |
{ |
$ligne=fgets($pointeur, 4096); |
if ($ligne) |
{ |
if (preg_match('/^\*ip$/',$ligne, $r)) |
{ |
echo " checked"; |
break; |
} |
} |
} |
fclose($pointeur); |
} |
else { |
echo "$l_error_open_file $bannedsite_file"; |
} |
echo "> $l_ip_filtering"; |
?> |
</td></tr> |
<tr><td> |
<input type='checkbox' name='chk-safesearch' |
<?php |
// verify "safesearch" filtering state |
if (file_exists($urlregex_file)) |
{ |
$pointeur=fopen($urlregex_file,"r"); |
while (!feof ($pointeur)) |
{ |
$ligne=fgets($pointeur, 4096); |
if ($ligne) |
{ |
if (preg_match('/^\"\(\^http\:\/\/\[0\-9a\-z\]\+\\\.google/',$ligne, $r)) |
{ |
echo " checked"; |
break; |
} |
} |
} |
fclose($pointeur); |
} |
else { |
echo "$l_error_open_file $urlregex_file"; |
} |
if (file_exists($iptables_safesearch_file)) |
{ |
echo " checked"; |
} |
echo "> $l_safe_searching"; |
echo "<br>$l_safe_youtube"; |
echo " $l_youtube_id<tr><td>"; |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_record'></td></tr>"; |
?> |
</FORM> |
</FORM> |
</TABLE> |
</BODY> |
</HTML> |
|
|