Line 65... |
Line 65... |
65 |
|
65 |
|
66 |
# Choice of language
|
66 |
# Choice of language
|
67 |
$Language = 'en';
|
67 |
$Language = 'en';
|
68 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
68 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
69 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
69 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
70 |
$Language = strtolower(substr(chop($Langue[0]),0,2));
|
70 |
$Language = strtolower(substr(chop($Langue[0]),0,2));
|
71 |
}
|
71 |
}
|
72 |
if($Language == 'fr'){
|
72 |
if($Language == 'fr'){
|
73 |
$l_bl="Liste noire générale";
|
73 |
$l_bl="Liste noire générale";
|
74 |
$l_load="Chargement...";
|
74 |
$l_load="Chargement...";
|
75 |
$l_list_version="Version de la liste : ";
|
75 |
$l_list_version="Version de la liste : ";
|
Line 91... |
Line 91... |
91 |
$l_one_ip="Entrez une IP par ligne (exemple : 123.123.123.123)";
|
91 |
$l_one_ip="Entrez une IP par ligne (exemple : 123.123.123.123)";
|
92 |
$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";
|
92 |
$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";
|
93 |
$l_record="Enregistrer les modifications";
|
93 |
$l_record="Enregistrer les modifications";
|
94 |
$l_wait="Une fois validées, 10 secondes sont nécessaires pour traiter vos modifications";
|
94 |
$l_wait="Une fois validées, 10 secondes sont nécessaires pour traiter vos modifications";
|
95 |
$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)";
|
95 |
$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)";
|
96 |
$l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche google.";
|
- |
|
97 |
$l_safe_youtube="Pour un contrôle parental sur Youtube, suivez les étapes ici : ";
|
- |
|
98 |
$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>)";
|
96 |
$l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche Google, Bing et Youtube.";
|
99 |
$l_error_open_file="Erreur d'ouverture du fichier";
|
97 |
$l_error_open_file="Erreur d'ouverture du fichier";
|
100 |
$l_additional_file_title="Fichiers de 'listes noires' additionnels";
|
98 |
$l_additional_file_title="Fichiers de 'listes noires' additionnels";
|
101 |
$l_file_list="Liste des fichiers";
|
99 |
$l_file_list="Liste des fichiers";
|
102 |
$l_add_file="Ajouter un fichier";
|
100 |
$l_add_file="Ajouter un fichier";
|
103 |
$l_add_file_explain="Chaque ligne du fichier doit être une adresse IP ou un nom de domaine";
|
101 |
$l_add_file_explain="Chaque ligne du fichier doit être une adresse IP ou un nom de domaine";
|
104 |
$l_file_name="Nom du fichier";
|
102 |
$l_file_name="Nom du fichier";
|
105 |
$l_file_action="Action";
|
103 |
$l_file_action="Action";
|
106 |
$l_error_upload="Erreur d'envoi du fichier";
|
104 |
$l_error_upload="Erreur d'envoi du fichier";
|
107 |
$l_remove="Supprimer";
|
105 |
$l_remove="Supprimer";
|
108 |
$l_submit="Envoyer";
|
106 |
$l_submit="Envoyer";
|
Line 139... |
Line 137... |
139 |
$l_one_ip="Enter one IP per row (example : 123.123.123.123)";
|
137 |
$l_one_ip="Enter one IP per row (example : 123.123.123.123)";
|
140 |
$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";
|
138 |
$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";
|
141 |
$l_record="Save changes";
|
139 |
$l_record="Save changes";
|
142 |
$l_wait="Once validated, 10 seconds are necessary to compute your modifications";
|
140 |
$l_wait="Once validated, 10 seconds are necessary to compute your modifications";
|
143 |
$l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
|
141 |
$l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
|
144 |
$l_safe_searching="Enabling school/parental control for the search engines google";
|
- |
|
145 |
$l_safe_youtube="For a safe Youtube search, follow these steps : ";
|
- |
|
146 |
$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>)";
|
142 |
$l_safe_searching="Enabling school/parental control for the search engines Google, Bing and Youtube";
|
147 |
$l_error_open_file="Error opening file";
|
143 |
$l_error_open_file="Error opening file";
|
148 |
$l_additional_file_title="Additional blacklist files";
|
144 |
$l_additional_file_title="Additional blacklist files";
|
149 |
$l_file_list="Files list";
|
145 |
$l_file_list="Files list";
|
150 |
$l_add_file="Add a file";
|
146 |
$l_add_file="Add a file";
|
151 |
$l_add_file_explain="Each line of the file must be an IP address or a domain name";
|
147 |
$l_add_file_explain="Each line of the file must be an IP address or a domain name";
|
152 |
$l_file_name="Filename";
|
148 |
$l_file_name="Filename";
|
153 |
$l_file_action="Action";
|
149 |
$l_file_action="Action";
|
154 |
$l_error_upload="Error during the upload process";
|
150 |
$l_error_upload="Error during the upload process";
|
155 |
$l_remove="Delete";
|
151 |
$l_remove="Delete";
|
156 |
$l_submit="Submit";
|
152 |
$l_submit="Submit";
|
Line 195... |
Line 191... |
195 |
$tmp = explode("/",$PRIVATE_IP_MASK);
|
191 |
$tmp = explode("/",$PRIVATE_IP_MASK);
|
196 |
$PRIVATE_IP=$tmp[0];
|
192 |
$PRIVATE_IP=$tmp[0];
|
197 |
}
|
193 |
}
|
198 |
}
|
194 |
}
|
199 |
}
|
195 |
}
|
200 |
}
|
196 |
}
|
201 |
else { echo "$l_error_open_file $conf_file";}
|
197 |
else { echo "$l_error_open_file $conf_file";}
|
202 |
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
|
198 |
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
|
203 |
switch ($choix)
|
199 |
switch ($choix)
|
204 |
{
|
200 |
{
|
205 |
case 'Download_list' :
|
201 |
case 'Download_list' :
|
Line 219... |
Line 215... |
219 |
$pointeur=fopen($bl_categories_enabled, "a+");
|
215 |
$pointeur=fopen($bl_categories_enabled, "a+");
|
220 |
$fichier=fopen($update_file_cat,"w+");
|
216 |
$fichier=fopen($update_file_cat,"w+");
|
221 |
foreach ($_POST as $key => $value)
|
217 |
foreach ($_POST as $key => $value)
|
222 |
{
|
218 |
{
|
223 |
if (strstr($key,'chk-'))
|
219 |
if (strstr($key,'chk-'))
|
224 |
{
|
220 |
{
|
225 |
$line=str_replace('chk-','',$key)."\n";
|
221 |
$line=str_replace('chk-','',$key)."\n";
|
226 |
fwrite($pointeur,$line);
|
222 |
fwrite($pointeur,$line);
|
227 |
if(trim($line) == 'malware' && $_POST['update_cat'] == 1) //auto-update of malware
|
223 |
if(trim($line) == 'malware' && $_POST['update_cat'] == 1) //auto-update of malware
|
228 |
{
|
224 |
{
|
229 |
fputs($fichier, "malware rsync://ftp.ut-capitole.fr/blacklist/dest/malware\n");
|
225 |
fputs($fichier, "malware rsync://ftp.ut-capitole.fr/blacklist/dest/malware\n");
|
Line 263... |
Line 259... |
263 |
if($fichier != "choix")
|
259 |
if($fichier != "choix")
|
264 |
{
|
260 |
{
|
265 |
$action=$_POST[$fichier];
|
261 |
$action=$_POST[$fichier];
|
266 |
if($action == $l_remove) //delete
|
262 |
if($action == $l_remove) //delete
|
267 |
{
|
263 |
{
|
268 |
exec("/bin/sed -i ".escapeshellarg("/^$fichier\$/d")." $bl_categories_enabled");
|
264 |
exec("/bin/sed -i ".escapeshellarg("/^$fichier\$/d")." $bl_categories_enabled");
|
269 |
exec("/bin/sed -i ".escapeshellarg("/$fichier\$/d")." $bl_categories");
|
265 |
exec("/bin/sed -i ".escapeshellarg("/$fichier\$/d")." $bl_categories");
|
270 |
exec("rm -rf $dir_blacklist".escapeshellarg($fichier));
|
266 |
exec("rm -rf $dir_blacklist".escapeshellarg($fichier));
|
271 |
exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
267 |
exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
272 |
}
|
268 |
}
|
273 |
if($action == $l_disable) //disable
|
269 |
if($action == $l_disable) //disable
|
274 |
{
|
270 |
{
|
275 |
exec("/bin/sed -i ".escapeshellarg("/^$fichier\$/d")." $bl_categories_enabled");
|
271 |
exec("/bin/sed -i ".escapeshellarg("/^$fichier\$/d")." $bl_categories_enabled");
|
276 |
exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
272 |
exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
277 |
}
|
273 |
}
|
278 |
if($action == $l_enable) //enable
|
274 |
if($action == $l_enable) //enable
|
279 |
{
|
275 |
{
|
280 |
file_put_contents ($bl_categories_enabled, $fichier."\n", FILE_APPEND);
|
276 |
file_put_contents ($bl_categories_enabled, $fichier."\n", FILE_APPEND);
|
Line 289... |
Line 285... |
289 |
if((!empty($file_name)) && (!file_exists($dest_dir)))
|
285 |
if((!empty($file_name)) && (!file_exists($dest_dir)))
|
290 |
{
|
286 |
{
|
291 |
exec("mkdir ".escapeshellarg($dest_dir));
|
287 |
exec("mkdir ".escapeshellarg($dest_dir));
|
292 |
$file=$_FILES['fichier_ip']['tmp_name'];
|
288 |
$file=$_FILES['fichier_ip']['tmp_name'];
|
293 |
exec('/usr/bin/dos2unix '.escapeshellarg($file));
|
289 |
exec('/usr/bin/dos2unix '.escapeshellarg($file));
|
294 |
if(move_uploaded_file($_FILES['fichier_ip']['tmp_name'], $dest_dir."/domains")) // copy in the file "domains" (containing @ip & domain names (like over Toulouse categories))
|
290 |
if(move_uploaded_file($_FILES['fichier_ip']['tmp_name'], $dest_dir."/domains")) // copy in the file "domains" (containing @ip & domain names (like over Toulouse categories))
|
295 |
{
|
291 |
{
|
296 |
touch ($dest_dir."/urls"); // create the URL file even if it isn't used
|
292 |
touch ($dest_dir."/urls"); // create the URL file even if it isn't used
|
297 |
file_put_contents ($bl_categories, $dest_dir."\n", FILE_APPEND); # add to the categories list
|
293 |
file_put_contents ($bl_categories, $dest_dir."\n", FILE_APPEND); # add to the categories list
|
298 |
file_put_contents ($bl_categories_enabled, "ossi-bl-".$file_name."\n", FILE_APPEND); //Enabled by default
|
294 |
file_put_contents ($bl_categories_enabled, "ossi-bl-".$file_name."\n", FILE_APPEND); //Enabled by default
|
299 |
exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
295 |
exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
Line 348... |
Line 344... |
348 |
// total number of IP, DNS & URLs
|
344 |
// total number of IP, DNS & URLs
|
349 |
$nbDomainNames = exec("wc -l /usr/local/share/dnsmasq-bl/* | tail -n 1 | awk '{print $1}'");
|
345 |
$nbDomainNames = exec("wc -l /usr/local/share/dnsmasq-bl/* | tail -n 1 | awk '{print $1}'");
|
350 |
$nbUrl = exec("for file in `find /etc/e2guardian/lists/blacklists/ -name 'urls'`; do nb=$((nb+$(wc -l \$file | awk '{print $1}'))); done; echo \$nb");
|
346 |
$nbUrl = exec("for file in `find /etc/e2guardian/lists/blacklists/ -name 'urls'`; do nb=$((nb+$(wc -l \$file | awk '{print $1}'))); done; echo \$nb");
|
351 |
$nbIp = exec("wc -l /usr/local/share/iptables-bl/* | tail -n 1 | awk '{print $1}'");
|
347 |
$nbIp = exec("wc -l /usr/local/share/iptables-bl/* | tail -n 1 | awk '{print $1}'");
|
352 |
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>";
|
348 |
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>";
|
353 |
echo "$l_bl_categories</center></td></tr>";
|
349 |
echo "$l_bl_categories</center></td></tr>";
|
354 |
//read & display all BL categories (checked or not)
|
350 |
//read & display all BL categories (checked or not)
|
355 |
$cols=1;
|
351 |
$cols=1;
|
356 |
if (file_exists($bl_categories))
|
352 |
if (file_exists($bl_categories))
|
357 |
{
|
353 |
{
|
358 |
$bl_files = file($bl_categories);
|
354 |
$bl_files = file($bl_categories);
|
359 |
$bl_files = preg_grep("/ossi-/", $bl_files, 1); // don't display ossi custom categories
|
355 |
$bl_files = preg_grep("/ossi-/", $bl_files, 1); // don't display ossi custom categories
|
360 |
foreach($bl_files as $fichier => $value)
|
356 |
foreach($bl_files as $fichier => $value)
|
Line 382... |
Line 378... |
382 |
$update_select[0] = "";
|
378 |
$update_select[0] = "";
|
383 |
$update_select[1] = "";
|
379 |
$update_select[1] = "";
|
384 |
|
380 |
|
385 |
if ( 0 == filesize( $update_file_cat ) ) $update_select[0] = "checked";
|
381 |
if ( 0 == filesize( $update_file_cat ) ) $update_select[0] = "checked";
|
386 |
else $update_select[1] = "checked";
|
382 |
else $update_select[1] = "checked";
|
387 |
|
383 |
|
388 |
echo "</tr>\n";
|
384 |
echo "</tr>\n";
|
389 |
echo "<tr><td valign='middle' align='left' colspan=10>";
|
385 |
echo "<tr><td valign='middle' align='left' colspan=10>";
|
390 |
echo "<center>$l_update_cat
|
386 |
echo "<center>$l_update_cat
|
391 |
<input type='radio' name='update_cat' value=0 $update_select[0]> $l_disable
|
387 |
<input type='radio' name='update_cat' value=0 $update_select[0]> $l_disable
|
392 |
<input type='radio' name='update_cat' value=1 $update_select[1]> $l_enable
|
388 |
<input type='radio' name='update_cat' value=1 $update_select[1]> $l_enable
|
393 |
<input type='submit' value='$l_record'></center>";
|
389 |
<input type='submit' value='$l_record'></center>";
|
394 |
echo "</td></tr>";
|
390 |
echo "</td></tr>";
|
395 |
echo "<tr><td valign='middle' align='left' colspan=10>";
|
391 |
echo "<tr><td valign='middle' align='left' colspan=10>";
|
396 |
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
|
392 |
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
|
397 |
echo "<tr><td width=50% colspan=5 align=center>";
|
393 |
echo "<tr><td width=50% colspan=5 align=center>";
|
Line 464... |
Line 460... |
464 |
while (!feof ($pointeur))
|
460 |
while (!feof ($pointeur))
|
465 |
{
|
461 |
{
|
466 |
$ligne=fgets($pointeur, 4096);
|
462 |
$ligne=fgets($pointeur, 4096);
|
467 |
if ($ligne)
|
463 |
if ($ligne)
|
468 |
{
|
464 |
{
|
469 |
if (preg_match('/^\*ip$/',$ligne, $r))
|
465 |
if (preg_match('/^\*ip$/',$ligne, $r))
|
470 |
{
|
466 |
{
|
471 |
echo " checked";
|
467 |
echo " checked";
|
472 |
break;
|
468 |
break;
|
473 |
}
|
469 |
}
|
474 |
}
|
470 |
}
|
Line 503... |
Line 499... |
503 |
fclose($pointeur);
|
499 |
fclose($pointeur);
|
504 |
}
|
500 |
}
|
505 |
else {
|
501 |
else {
|
506 |
echo "$l_error_open_file $urlregex_file";
|
502 |
echo "$l_error_open_file $urlregex_file";
|
507 |
}
|
503 |
}
|
508 |
echo "> $l_safe_searching";
|
504 |
echo "> $l_safe_searching<tr><td>";
|
509 |
echo "<br>$l_safe_youtube";
|
- |
|
510 |
echo " $l_youtube_id<tr><td>";
|
- |
|
511 |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_record'></td></tr>";
|
505 |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_record'></td></tr>";
|
512 |
?>
|
506 |
?>
|
513 |
</table>
|
507 |
</table>
|
514 |
</form>
|
508 |
</form>
|
515 |
</BODY>
|
509 |
</BODY>
|
516 |
</HTML>
|
510 |
</HTML>
|
517 |
|
- |
|
518 |
|
- |
|