8,6 → 8,7 |
$wl_iptables_dir="/usr/local/share/iptables-wl/"; |
$bl_dnsmasq_dir="/usr/local/share/dnsmasq-bl/"; |
$wl_dnsmasq_dir="/usr/local/share/dnsmasq-wl/"; |
if(isset($_GET['ossi'])) $ossi = $_GET['ossi']; |
# Choice of language |
$Language = 'en'; |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) |
62,6 → 63,31 |
} |
if($liste == "bl") |
{ |
if(isset($ossi)) |
{ |
$bl_categorie_domain_file = $bl_dnsmasq_dir."-enabled/".$categorie; |
$bl_categorie_ip_file = $bl_iptables_dir.$categorie; |
if(isset($_GET['nb_domains']) && isset($_GET['nb_urls']) && isset($_GET['nb_ip'])) |
{ |
$nb_domains = $_GET['nb_domains']; |
$nb_ip = $_GET['nb_ip']; |
} |
else |
{ |
if (file_exists($bl_categorie_domain_file)) |
$nb_domains = exec("wc -l $bl_categorie_domain_file | cut -d ' ' -f1"); |
else |
$nb_domains = $l_error_open_file." ".$bl_categorie_domain_file; |
if(file_exists($bl_categorie_ip_file)) |
$nb_ip = exec("wc -l $bl_categorie_ip_file | cut -d ' ' -f1"); |
else |
$nb_ip = $l_error_open_file." ".$bl_categorie_ip_file; |
} |
} |
else |
{ |
|
|
$bl_categorie_domain_file = $bl_dnsmasq_dir.$categorie.".conf"; |
$bl_categorie_url_file = $bl_dir.$categorie."/urls"; |
$bl_categorie_ip_file = $bl_iptables_dir.$categorie; |
86,9 → 112,34 |
else |
$nb_ip = $l_error_open_file." ".$bl_categorie_ip_file; |
} |
} |
} |
else |
{ |
|
if(isset($ossi)) |
{ |
$wl_categorie_domain_file = "/usr/local/share/dnsmasq-wl-enabled/".$categorie; |
$wl_categorie_ip_file = "/usr/local/share/iptables-wl-enabled/".$categorie; |
if(isset($_GET['nb_domains']) && isset($_GET['nb_urls']) && isset($_GET['nb_ip'])) |
{ |
$nb_domains = $_GET['nb_domains']; |
$nb_ip = $_GET['nb_ip']; |
} |
else |
{ |
if (file_exists($wl_categorie_domain_file)) |
$nb_domains = exec("wc -l $wl_categorie_domain_file | cut -d ' ' -f1"); |
else |
$nb_domains = $l_error_open_file." ".$wl_categorie_domain_file; |
if(file_exists($wl_categorie_ip_file)) |
$nb_ip = exec("wc -l $wl_categorie_ip_file | cut -d ' ' -f1"); |
else |
$nb_ip = $l_error_open_file." ".$wl_categorie_ip_file; |
} |
} |
else |
{ |
$wl_categorie_domain_file = $wl_dnsmasq_dir.$categorie.".conf"; |
$wl_categorie_ip_file = $wl_iptables_dir.$categorie; |
if(isset($_GET['nb_domains'])) |
106,10 → 157,11 |
$nb_urls = 0; |
$nb_ip = 0; |
} |
} |
} |
$global_usage = file($bl_dir."global_usage"); |
$langue = strtoupper($Language); |
if(isset($categorie)) |
if(isset($categorie) && !isset($ossi)) |
{ |
$fin1 = 0; $fin2 = 0; |
foreach($global_usage as $line) |
151,11 → 203,20 |
$filtre_url = $liste == "bl" ? $bl_categorie_url_file : ""; |
$filtre_ip = $liste == "bl" ? $bl_categorie_ip_file : $wl_categorie_ip_file; |
$compat_categorie=strtr($categorie,"-","_"); |
if(!isset($ossi)) |
{ |
echo "<br><center><b>$l_name_cat</b></center>"; |
echo "<center><b>$l_description_cat</b></center><br>"; |
echo "$l_nb_domains <b><a href='?liste=$liste&cat=$categorie&filtre=$filtre_domain&titre=domain&nb_domains=$nb_domains&nb_urls=$nb_urls&nb_ip=$nb_ip'>$nb_domains</a></b><br>"; |
echo "$l_nb_urls <b><a href='?liste=$liste&cat=$categorie&filtre=$filtre_url&titre=url&nb_domains=$nb_domains&nb_urls=$nb_urls&nb_ip=$nb_ip'>$nb_urls</a></b><br>"; |
echo "$l_nb_ip <b><a href='?liste=$liste&cat=$categorie&filtre=$filtre_ip&titre=ip&nb_domains=$nb_domains&nb_urls=$nb_urls&nb_ip=$nb_ip'>$nb_ip</a></b><br>"; |
} |
else |
{ |
|
echo "$l_nb_domains <b><a href='?liste=$liste&cat=$categorie&filtre=$filtre_domain&titre=domain&nb_domains=$nb_domains&nb_ip=$nb_ip&ossi=yes'>$nb_domains</a></b><br>"; |
echo "$l_nb_ip <b><a href='?liste=$liste&cat=$categorie&filtre=$filtre_ip&titre=ip&nb_domains=$nb_domains&nb_ip=$nb_ip&ossi=yes'>$nb_ip</a></b><br>"; |
} |
?> |
</td></tr> |
</TABLE> |
178,13 → 239,16 |
</TABLE> |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1> |
<tr><td valign="middle" align="left"> |
<?php |
<?php |
if($titre == "domain") |
{ |
|
$filtre = $liste == "bl" ? $bl_categorie_domain_file : $wl_categorie_domain_file; |
exec("head -n 15 $filtre | cut -d '/' -f2", $resultat); |
} |
elseif($titre == "ip") |
{ |
$filtre = $liste == "bl" ? $bl_categorie_ip_file : $wl_categorie_ip_file; |
exec("head -n 15 $filtre | cut -d ' ' -f3", $resultat); |
} |
else |