Line 27... |
Line 27... |
27 |
$new_list = $new_list.$value."\n";
|
27 |
$new_list = $new_list.$value."\n";
|
28 |
}
|
28 |
}
|
29 |
}
|
29 |
}
|
30 |
if($color == "white")
|
30 |
if($color == "white")
|
31 |
{
|
31 |
{
|
32 |
return preg_replace("/(.*)\n/", "add whitelist_ip_allowed $1\n", $new_list);
|
32 |
return preg_replace("/(.*)\n/", "add wl_ip_allowed $1\n", $new_list);
|
33 |
}
|
33 |
}
|
34 |
else
|
34 |
else
|
35 |
{
|
35 |
{
|
36 |
return preg_replace("/(.*)\n/", "add blacklist_ip_blocked $1\n", $new_list);
|
36 |
return preg_replace("/(.*)\n/", "add bl_ip_blocked $1\n", $new_list);
|
37 |
}
|
37 |
}
|
38 |
}
|
38 |
}
|
39 |
function echo_file ($filename)
|
39 |
function echo_file ($filename)
|
40 |
{
|
40 |
{
|
41 |
if (file_exists($filename))
|
41 |
if (file_exists($filename))
|
Line 252... |
Line 252... |
252 |
|
252 |
|
253 |
# Suppression des doublons
|
253 |
# Suppression des doublons
|
254 |
exec("sort -u $upload_dir_ip\ossi_ip > $upload_dir_ip\ossi-$nom && rm -f $upload_dir_ip\ossi_ip");
|
254 |
exec("sort -u $upload_dir_ip\ossi_ip > $upload_dir_ip\ossi-$nom && rm -f $upload_dir_ip\ossi_ip");
|
255 |
|
255 |
|
256 |
# On adapte le fichier à la sauvegarde du set
|
256 |
# On adapte le fichier à la sauvegarde du set
|
257 |
exec("sed -i \"s/^/add whitelist_ip_allowed /g\" $upload_dir_ip\ossi-$nom");
|
257 |
exec("sed -i \"s/^/add wl_ip_allowed /g\" $upload_dir_ip\ossi-$nom");
|
258 |
|
258 |
|
259 |
# On extrait uniquement les noms de domaine
|
259 |
# On extrait uniquement les noms de domaine
|
260 |
# max_tld() retourne le nombre max de charactere pour un top-level dns
|
260 |
# max_tld() retourne le nombre max de charactere pour un top-level dns
|
261 |
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");
|
261 |
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");
|
262 |
|
262 |
|
Line 352... |
Line 352... |
352 |
<input type='hidden' name='choix' value='MAJ_ip_file_delete'>
|
352 |
<input type='hidden' name='choix' value='MAJ_ip_file_delete'>
|
353 |
<?php
|
353 |
<?php
|
354 |
echo "<tr><td width=50% colspan=5 align=center>";
|
354 |
echo "<tr><td width=50% colspan=5 align=center>";
|
355 |
echo "<H3>$l_file_list</H3>";
|
355 |
echo "<H3>$l_file_list</H3>";
|
356 |
echo "<table cellspacing=2 cellpadding=3 border=1><tr><th>$l_file_name<th>$l_nb_ip<th>$l_nb_domain_names<th>$l_file_remove</tr>";
|
356 |
echo "<table cellspacing=2 cellpadding=3 border=1><tr><th>$l_file_name<th>$l_nb_ip<th>$l_nb_domain_names<th>$l_file_remove</tr>";
|
357 |
exec("cd $upload_dir_ip && ls | grep ossi-", $fichiersIp);
|
357 |
exec("cd $upload_dir_ip && ls ossi-*", $fichiersIp);
|
358 |
foreach($fichiersIp as $fichier => $value)
|
358 |
foreach($fichiersIp as $fichier => $value)
|
359 |
{
|
359 |
{
|
360 |
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>";
|
360 |
echo "<tr><td><center><a href='bl_categories_help.php?liste=wl&cat=$value&ossi=yes&filtre=domain' target='cat_help' onclick=window.open('bl_categories_help','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>".exec("sed 's/^.....//g' <<< $value")."</a></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>";
|
361 |
}
|
361 |
}
|
362 |
echo "</table><br/></td></form><form action='wl_filter.php' method='POST' enctype='multipart/form-data'>";
|
362 |
echo "</table><br/></td></form><form action='wl_filter.php' method='POST' enctype='multipart/form-data'>";
|
363 |
echo "<input type='hidden' name='choix' value='MAJ_ip_file_upload'><td width=50% colspan=5 align=center>";
|
363 |
echo "<input type='hidden' name='choix' value='MAJ_ip_file_upload'><td width=50% colspan=5 align=center>";
|
364 |
echo "<H3>$l_add_file</H3>";
|
364 |
echo "<H3>$l_add_file</H3>";
|
365 |
echo "$l_add_file_explain";
|
365 |
echo "$l_add_file_explain";
|