Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1935 → Rev 1936

/web/acc/admin/bl_categories_help.php
8,7 → 8,6
$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']))
29,7 → 28,6
$l_example="Exemple(s) : ";
$l_error_cat = "Erreur de categorie";
$l_error_list = "Erreur de listing";
$l_tor_node = "Cette liste correspond au noeud du réseau Tor. Si cette liste est activée, les utilisateurs blacklistés ne pourront pas accéder au réseau Tor</br>";
}
else
{
36,8 → 34,8
$l_title = "Blacklist categories";
$l_error_open_file="Error opening the file";
$l_close="Close";
$l_description_cat="This category isn't describe";
$l_name_cat ="This category has not name";
$l_description_cat="This category isn't described";
$l_name_cat ="This category has no name";
$l_nb_domains="Number of filtered domain names :";
$l_nb_urls="Number of filtered URL :";
$l_nb_ip="Number of filtered IP :";
44,7 → 42,6
$l_example="Example(s) : ";
$l_error_cat = "Error category";
$l_error_list = "Error listing";
$l_tor_node = "This list is Tor's nodes. If you enable this list, users won't reach Tor network.</br> ";
 
}
if(isset($_GET['cat']))
64,63 → 61,19
$liste = $l_error_list;
}
if($liste == "bl")
{
if(isset($ossi))
{
if(isset($_GET['state']) && $_GET['state']=='disable')
{
$bl_categorie_domain_file = "/usr/local/share/dnsmasq-bl/".$categorie;
$bl_categorie_ip_file = "/usr/local/share/iptables-bl/".$categorie;
}
else
{
$bl_categorie_domain_file = "/usr/local/share/dnsmasq-bl-enabled/".$categorie;
$bl_categorie_ip_file = "/usr/local/share/iptables-bl-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($bl_categorie_domain_file))
{
$nb_domains = exec("wc -l $bl_categorie_domain_file | cut -d ' ' -f1");
}
else
{
if($categorie!='ossi-tor_node_ip')
{
$nb_domains = $l_error_open_file." ".$bl_categorie_domain_file;
}
else
{
$nb_domains = "";
$_GET["titre"] = 'ip';
}
}
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;
if(isset($_GET['nb_domains']) && isset($_GET['nb_urls']) && isset($_GET['nb_ip']))
{
//don't calc again on reload (click on the number of domain/urls/ip)
if (isset ($_GET['nb_domains']) && isset($_GET['nb_urls']) && isset($_GET['nb_ip']))
{
$nb_domains = $_GET['nb_domains'];
$nb_urls = $_GET['nb_urls'];
$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
133,65 → 86,25
$nb_ip = exec("wc -l $bl_categorie_ip_file | cut -d ' ' -f1");
else
$nb_ip = $l_error_open_file." ".$bl_categorie_ip_file;
}
}
}
}
else
{
if(isset($ossi))
{
if(isset($_GET['state']) && $_GET['state']=='disable')
{
$wl_categorie_domain_file = "/usr/local/share/dnsmasq-wl/".$categorie;
$wl_categorie_ip_file = "/usr/local/share/iptables-wl/".$categorie;
}
else
{
$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']))
{
$nb_domains = $_GET['nb_domains'];
$nb_urls = 0;
$nb_ip = 0;
}
if (file_exists($wl_categorie_domain_file))
$nb_domains = exec("wc -l $wl_categorie_domain_file | cut -d ' ' -f1");
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;
$nb_urls = 0;
$nb_ip = 0;
$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;
$nb_urls = 0; //no urls in WL
}
}
}
$global_usage = file($bl_dir."global_usage");
$langue = strtoupper($Language);
if(isset($categorie) && !isset($ossi))
if(isset($categorie))
{
$fin1 = 0; $fin2 = 0;
foreach($global_usage as $line)
206,7 → 119,6
$fin2 = 1;
}
if($fin2) break;
}
}
echo "<TITLE>$l_title</TITLE>";
229,41 → 141,15
{
$filtre = $liste == "bl" ? $bl_categorie_domain_file : $wl_categorie_domain_file;
}
if($categorie!='ossi-tor_node_ip')
$filtre_domain = $liste == "bl" ? $bl_categorie_domain_file : $wl_categorie_domain_file;
if(!isset($ossi))
$filtre_url = $liste == "bl" ? $bl_categorie_url_file : "";
$filtre_domain = $liste == "bl" ? $bl_categorie_domain_file : $wl_categorie_domain_file;
$filtre_ip = $liste == "bl" ? $bl_categorie_ip_file : $wl_categorie_ip_file;
$filtre_url = $liste == "bl" ? $bl_categorie_url_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
{
if($categorie=='ossi-tor_node_ip')
{
echo $l_tor_node;
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>";
}
else
{
if(isset($_GET['state']))
{
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&state=disable'>$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&state=disable'>$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>