Line 238... |
Line 238... |
238 |
if (file_exists($bl_categories_enabled))
|
238 |
if (file_exists($bl_categories_enabled))
|
239 |
{
|
239 |
{
|
240 |
$fichier=fopen($update_file_cat,"w+");
|
240 |
$fichier=fopen($update_file_cat,"w+");
|
241 |
$pointeur=fopen($bl_categories_enabled, "w+");
|
241 |
$pointeur=fopen($bl_categories_enabled, "w+");
|
242 |
foreach ($_POST as $key => $value)
|
242 |
foreach ($_POST as $key => $value)
|
243 |
{
|
243 |
{
|
244 |
if (strstr($key,'chk-'))
|
244 |
if (strstr($key,'chk-'))
|
245 |
{
|
245 |
{
|
246 |
$line=str_replace('chk-','',$key)."\n";
|
246 |
$line=str_replace('chk-','',$key)."\n";
|
247 |
fwrite($pointeur,$line);
|
247 |
fwrite($pointeur,$line);
|
248 |
if(trim($line) == 'malware' && $_POST['update_cat'] == 1)
|
248 |
if(trim($line) == 'malware' && $_POST['update_cat'] == 1)
|
249 |
{
|
249 |
{
|
250 |
fputs($fichier, "malware rsync://ftp.ut-capitole.fr/blacklist/dest/malware\n");
|
250 |
fputs($fichier, "malware rsync://ftp.ut-capitole.fr/blacklist/dest/malware\n");
|
251 |
}
|
251 |
}
|
252 |
}
|
252 |
}
|
253 |
}
|
253 |
}
|
254 |
|
254 |
|
255 |
fclose($pointeur);
|
255 |
fclose($pointeur);
|
256 |
}
|
256 |
}
|
257 |
else {echo "$l_error_open_file $bl_categories_enabled";}
|
257 |
else {echo "$l_error_open_file $bl_categories_enabled";}
|
258 |
$fichier=fopen($dir_blacklist."ossi-bl/domains","w+");
|
258 |
$fichier=fopen($dir_blacklist."ossi-bl/domains","w+");
|
259 |
fputs($fichier, form_filter($_POST['OSSI_bl']));
|
259 |
fputs($fichier, form_filter($_POST['OSSI_bl']));
|
260 |
fclose($fichier);
|
260 |
fclose($fichier);
|
261 |
unset($_POST['OSSI_bl']);
|
261 |
unset($_POST['OSSI_bl']);
|
Line 289... |
Line 289... |
289 |
exec("rm -rf $dir_blacklist$fichier");
|
289 |
exec("rm -rf $dir_blacklist$fichier");
|
290 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
290 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
291 |
}
|
291 |
}
|
292 |
if($action == $l_disable) //disable
|
292 |
if($action == $l_disable) //disable
|
293 |
{
|
293 |
{
|
- |
|
294 |
echo "$dir_ip_enabled$fichier";
|
294 |
exec("rm -f $dir_ip_enabled$fichier");
|
295 |
//exec("rm -f $dir_ip_enabled$fichier");
|
295 |
exec("rm -f $dir_domain_names_enabled$fichier");
|
296 |
//exec("rm -f $dir_domain_names_enabled$fichier");
|
- |
|
297 |
//exec("sed -i \"/$fichier/d\" $bl_categories_enabled");
|
296 |
exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
298 |
//exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
297 |
}
|
299 |
}
|
298 |
if($action == $l_enable) //enable
|
300 |
if($action == $l_enable) //enable
|
299 |
{
|
301 |
{
|
300 |
exec("ln -s $dir_ip$fichier $dir_ip_enabled$fichier");
|
302 |
exec("ln -s $dir_ip$fichier $dir_ip_enabled$fichier");
|
301 |
exec("ln -s $dir_domain_names$fichier $dir_domain_names_enables$fichier");
|
303 |
exec("ln -s $dir_domain_names$fichier $dir_domain_names_enables$fichier");
|
Line 443... |
Line 445... |
443 |
echo "<H3>$l_file_list</H3>";
|
445 |
echo "<H3>$l_file_list</H3>";
|
444 |
echo "<table cellspacing=2 cellpadding=3 border=1><tr><th>$l_file_name<th>$l_nb_ip<th>$l_nb_domain_names<th colspan=2>$l_file_action</tr>";
|
446 |
echo "<table cellspacing=2 cellpadding=3 border=1><tr><th>$l_file_name<th>$l_nb_ip<th>$l_nb_domain_names<th colspan=2>$l_file_action</tr>";
|
445 |
|
447 |
|
446 |
//list OSSI custom categories
|
448 |
//list OSSI custom categories
|
447 |
$fichiersbl = array_diff(scandir($dir_blacklist), array('..','.','ossi-bl','ossi-wl'));
|
449 |
$fichiersbl = array_diff(scandir($dir_blacklist), array('..','.','ossi-bl','ossi-wl'));
|
448 |
$fichiersbl = preg_grep("/^ossi-/",$fichiersbl);
|
450 |
$fichiersbl = preg_grep("/^ossi-bl-/",$fichiersbl);
|
449 |
foreach($fichiersbl as $fichier => $value)
|
451 |
foreach($fichiersbl as $fichier => $value)
|
450 |
{
|
452 |
{
|
451 |
echo "<tr><td><center><a href='bl_categories_help.php?liste=bl&cat=$value&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 $dir_ip_enabled$value | awk '{print $1}'")."</center></td><td><center>".exec("wc -l $dir_domain_names_enabled$value | awk '{print $1}'")."</center></td><td><center><input type='submit' name='$value' value='$l_disable'></center></td><td><center><input type='submit' name='$value' value='$l_remove'></center></td></tr>";
|
453 |
echo "<tr><td><center><a href='bl_categories_help.php?liste=bl&cat=$value&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'>".substr($value,8)."</a></center></td><td><center>".exec("wc -l $dir_ip$value | cut -d\" \" -f1")."</center></td><td><center>".exec("wc -l $dir_domain_names$value.conf | cut -d\" \" -f1")."</center></td><td><center><input type='submit' name='$value' value='$l_disable'></center></td><td><center><input type='submit' name='$value' value='$l_remove'></center></td></tr>";
|
452 |
}
|
454 |
}
|
453 |
echo "</table><br/></td></form><form action='bl_filter.php' method='POST' enctype='multipart/form-data'>";
|
455 |
echo "</table><br/></td></form><form action='bl_filter.php' method='POST' enctype='multipart/form-data'>";
|
454 |
echo "<input type='hidden' name='choix' value='MAJ_ossi_file_upload'><td width=50% colspan=5 align=center>";
|
456 |
echo "<input type='hidden' name='choix' value='MAJ_ossi_file_upload'><td width=50% colspan=5 align=center>";
|
455 |
echo "<H3>$l_add_file</H3>";
|
457 |
echo "<H3>$l_add_file</H3>";
|
456 |
echo "$l_add_file_explain";
|
458 |
echo "$l_add_file_explain";
|