Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1376 → Rev 1377

/web/acc/admin/bl_categories_help.php
5,6 → 5,7
<?
$bl_dir="/etc/dansguardian/lists/blacklists/";
$bl_iptables_dir="/usr/local/share/iptables-bl/";
$wl_iptables_dir="/usr/local/share/iptables-wl/";
$bl_dnsmasq_dir="/usr/local/share/dnsmasq-bl/";
$wl_dnsmasq_dir="/usr/local/share/dnsmasq-wl/";
# Choice of language
76,14 → 77,25
else
{
$wl_categorie_domain_file = $wl_dnsmasq_dir.$categorie.".conf";
$wl_categorie_url_file = "";
$wl_categorie_ip_file = "";
if (file_exists($wl_categorie_domain_file))
$nb_domains = exec("wc -l $wl_categorie_domain_file | cut -d ' ' -f1");
$wl_categorie_ip_file = $wl_iptables_dir.$categorie;
if(isset($_GET['nb_domains']) && isset($_GET['nb_ip']))
{
$nb_domains = $_GET['nb_domains'];
$nb_urls = 0;
$nb_ip = $_GET['nb_ip'];
}
else
$nb_domains = $l_error_open_file." ".$wl_categorie_domain_file;
$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
$nb_domains = $l_error_open_file." ".$wl_categorie_domain_file;
$nb_urls = 0;
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;
}
}
$global_usage = file($bl_dir."global_usage");
$langue = strtoupper($Language);
/web/acc/admin/bl_filter.php
42,11 → 42,6
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
if($Language == 'fr'){
$l_title1="Filtrage de noms de domaine et d'URL";
$l_dnsfilter_on="Le filtrage de noms de domaine et d'URL est actuellement activé";
$l_dnsfilter_off="Le filtrage de noms de domaine et d'URL est actuellement désactivé";
$l_switch_filtering_on="Activer le filtrage";
$l_switch_filtering_off="Désactiver le filtrage";
$l_bl="Liste noire";
$l_wl="Liste blanche";
$l_list_version="Version de la liste : ";
90,13 → 85,13
$l_remove="Supprimer";
$l_submit="Envoyer";
$l_nb_ip="Nombre d'IP";
$l_update_ip="Mettre à jour les IP";
$l_update_ip_info="(Temps estimé : 3 min 30 sec)";
$l_nbDomainNames="Noms de domaine :";
$l_nbUrl="Url :";
$l_nbIp="Ip :";
}
else {
$l_title1="Domain names and URL filtering";
$l_dnsfilter_on="Actually, the Domain name and URL filter is on";
$l_dnsfilter_off="Actually, the Domain name and URL filter is off";
$l_switch_filtering_on="Switch the Filter on";
$l_switch_filtering_off="Switch the Filter off";
$l_bl="BlackList";
$l_wl="WhiteList";
$l_list_version="List version : ";
125,7 → 120,7
$l_rehabilitated_ip_explain="Enter here IP that are blocked by the blacklist <BR> and you want to rehabilitate.";
$l_one_ip="Enter one IP per row (example : 123.123.123.123)";
$l_record="Save changes";
$l_wait="Once validated, 10 seconds is necessary to compute your modifications";
$l_wait="Once validated, 10 seconds are necessary to compute your modifications";
$l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
$l_safe_searching="Enabling school/parental control for the search engines google, yahoo, bing, metacrawler and Youtube.";
$l_safe_youtube="For Youtube, enter your ID here : ";
140,11 → 135,16
$l_remove="Delete";
$l_submit="Submit";
$l_nb_ip="Number of IP";
$l_update_ip="Update IPs";
$l_update_ip_info="(Estimated time : 3 min 30 sec)";
$l_nbDomainNames="Domain names :";
$l_nbUrl="Url :";
$l_nbIp="Ip :";
}
$dir_etc="/usr/local/etc/";
$dir_dg="/etc/dansguardian/lists/";
$dir_bl_ip="/usr/local/share/iptables-bl/";
$file_wl_ip="/usr/local/share/ossi_wl";
$file_wl_ip="/usr/local/share/ossi-ip-wl";
$bl_categories=$dir_etc."alcasar-bl-categories";
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled";
$wl_categories=$dir_etc."alcasar-wl-categories";
164,7 → 164,6
foreach ($tab as $line)
{
$field=explode("=", $line);
if ($field[0] == "DNS_FILTERING") {$DNS_FILTERING=trim($field[1]);}
if ($field[0] == "YOUTUBE_ID") {$YOUTUBE_ID=trim($field[1]);}
}
}
173,14 → 172,6
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
switch ($choix)
{
case 'BL_On' :
exec ("sudo /usr/local/sbin/alcasar-bl.sh --on");
$DNS_FILTERING="on";
break;
case 'BL_Off' :
exec ("sudo /usr/local/sbin/alcasar-bl.sh --off");
$DNS_FILTERING="off";
break;
case 'Download_list' :
exec ("sudo /usr/local/sbin/alcasar-bl.sh --download");
break;
187,6 → 178,7
case 'Active_list' :
exec ("sudo /usr/local/sbin/alcasar-bl.sh --adapt");
exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
shell_exec ("nohup nice -n 10 sudo /usr/local/sbin/alcasar-bl.sh --ip_retrieving > /dev/null 2>/dev/null &");
break;
case 'Reject_list' :
unlink ("$dir_tmp/blacklists.tar.gz"); unlink ("$dir_tmp/md5sum");
249,6 → 241,7
fputs($fichier, form_filter_ip($_POST['OSSI_wl_ip'], "white"));
fclose($fichier);
unset($_POST['OSSI_wl_ip']);
exec ("sudo /usr/local/sbin/alcasar-bl.sh --ip_retrieving_ossi");
exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
break;
case 'Specific_filtering' :
294,33 → 287,14
}
exec ("sudo /usr/local/bin/alcasar-iptables.sh");
break;
case 'Update_IP_WL' :
shell_exec ("nohup nice -n 10 sudo /usr/local/sbin/alcasar-bl.sh --ip_retrieving > /dev/null 2>/dev/null &");
exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
break;
}
?>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><th><?php echo "$l_title1"; ?></th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
</TABLE>
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
<tr><td valign="middle" align="left">
<?php
if ($DNS_FILTERING == "on")
{
echo "<CENTER><H3>$l_dnsfilter_on</H3></CENTER>";
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
echo "<input type=hidden name='choix' value=\"BL_Off\">";
echo "<input type=submit value=\"$l_switch_filtering_off\">";
}
else
{
echo "<CENTER><H3>$l_dnsfilter_off</H3></CENTER>";
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
echo "<input type=hidden name='choix' value=\"BL_On\">";
echo "<input type=submit value=\"$l_switch_filtering_on\">";
}
echo "</FORM>";
echo "</td></tr>";
echo "</TABLE>";
if ($DNS_FILTERING == "on") require ('bl_filter2.php');
require ('bl_filter2.php');
?>
</BODY>
</HTML>
/web/acc/admin/bl_filter2.php
64,7 → 64,12
<FORM action='bl_filter.php' method=POST>
<input type='hidden' name='choix' value='MAJ_cat_bl'>
<?php
echo "<center>$l_bl_categories</center></td></tr>";
echo "<center>";
$nbDomainNames = exec ("wc -l /usr/local/share/dnsmasq-bl/* | tail -n 1 | awk '{print $1}'");
$nbUrl = exec ("for file in `find /etc/dansguardian/lists/blacklists/ -name 'urls'`; do nb=$((nb+$(wc -l \$file | awk '{print $1}'))); done; echo \$nb");
$nbIp = exec ("wc -l /usr/local/share/iptables-bl/* | tail -n 1 | awk '{print $1}'");
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>";
echo "$l_bl_categories</center></td></tr>";
//on lit et on interprete le fichier de catégories
$cols=1;
if (file_exists($bl_categories))
160,7 → 165,12
<FORM action='bl_filter.php' method=POST>
<input type='hidden' name='choix' value='MAJ_cat_wl'>
<?php
echo "<center>$l_wl_categories</center></td></tr>";
echo "<center>";
$nbDomainNames = exec ("wc -l /usr/local/share/dnsmasq-wl/* | tail -n 1 | awk '{print $1}'");
$nbUrl = 0;
$nbIp = exec ("wc -l /usr/local/share/iptables-wl/* | tail -n 1 | awk '{print $1}'");
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>";
echo "$l_wl_categories</center></td></tr>";
//on lit et on interprete le fichier de catégories
$cols=1;
if (file_exists($wl_categories))
200,12 → 210,10
echo "<td width=50% colspan=5 align=center>";
echo "<H3>$l_allowed_ip</H3>$l_forbidden_ip_explain<BR>";
echo "<textarea name='OSSI_wl_ip' rows=3 cols=40>";
echo_file ($dir_dg."blacklists/ossi/urls_wl");
echo "</textarea></td></tr><tr><td colspan=10>";
echo "<input type='submit' value='$l_record' disabled>";
echo "</form> (Wait for a next version of ALCASAR !)";
echo_ip_file ($file_wl_ip);
echo "</textarea></td></tr><tr><td colspan=5>";
echo "<input type='submit' value='$l_record'></form></td><form action='bl_filter.php' method='POST'><td valign='middle' align='left' colspan=5><input type='hidden' name='choix' value='Update_IP_WL'><input type='submit' value='$l_update_ip'> $l_update_ip_info</form></td></tr>";
?>
</td></tr>
</TABLE><br/>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th><?php echo $l_specific_filtering; ?></th></tr>
/web/acc/admin/net_filter.php
14,11 → 14,6
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
if($Language == 'fr'){
$l_title_antivir = "Antivirus de flux WEB";
$l_antivir_on="L'antivirus de flux WEB est actuellement activ&eacute;";
$l_antivir_off="L'antivirus de flux WEB est actuellement désactiv&eacute;";
$l_switch_antivir_on="Activer l'antivirus";
$l_switch_antivir_off="D&eacute;sactiver l'antivirus";
$l_remove="Retirer de la liste";
$l_title_proto = "Filtrage de protocoles r&eacute;seau";
$l_netfilter_on="Le filtrage de protocoles r&eacute;seau est actuellement activ&eacute;";
36,11 → 31,6
$l_save="Enregistrer les modifications";
}
else {
$l_title_antivir = "WEB antivirus";
$l_antivir_on="Actually, the WEB antivirus is on";
$l_antivir_off="Actually, the WEB antivirus is off";
$l_switch_antivir_on="Switch the antivirus on";
$l_switch_antivir_off="Switch the antivirus off";
$l_remove="Remove from list";
$l_title_proto = "Network protocols filter";
$l_netfilter_on="Actually, the network protocols filter is enable";
89,12 → 79,6
if (isset($_POST['choix'])){$choix=$_POST['choix'];} else {$choix="";}
switch ($choix)
{
case 'AV_On' :
exec ("sudo /usr/local/sbin/alcasar-havp.sh -on");
break;
case 'AV_Off' :
exec ("sudo /usr/local/sbin/alcasar-havp.sh -off");
break;
case 'NF_On' :
exec ("sudo /usr/local/sbin/alcasar-nf.sh -on");
break;
178,35 → 162,10
{
$field=explode("=", $line);
if ($field[0] == "PROTOCOLS_FILTERING") {$PROTOCOLS_FILTERING=trim($field[1]);}
if ($field[0] == "WEB_ANTIVIRUS") {$WEB_ANTIVIRUS=trim($field[1]);}
}
}
}
echo "<tr><th>$l_title_antivir</th></tr>";
?>
<tr bgcolor=#FFCC66><td><img src=/images/pix.gif width=1 height=2></td></tr>
</TABLE>
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
<tr><td valign="middle" align="left">
<?php
if ($WEB_ANTIVIRUS == "on")
{
echo "<CENTER><H3>$l_antivir_on</H3></CENTER>";
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
echo "<input type=hidden name='choix' value=\"AV_Off\">";
echo "<input type=submit value=\"$l_switch_antivir_off\">";
}
else
{
echo "<CENTER><H3>$l_antivir_off</H3></CENTER>";
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
echo "<input type=hidden name='choix' value=\"AV_On\">";
echo "<input type=submit value=\"$l_switch_antivir_on\">";
}
?>
</FORM>
</td></tr>
</table>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><th><?echo "$l_title_proto";?></th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>