Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 141 → Rev 142

/gestion/admin/web_filter.php
6,7 → 6,6
<link rel="stylesheet" href="/css/style.css" type="text/css">
</HEAD>
<body>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
<?
# Choice of language
$Language = 'en';
14,13 → 13,16
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
if($Language == 'fr'){
$l_title = "Filtrage WEB";
$l_title1 = "Antivirus";
$l_title2 = "Filtrage de noms de domaine et d'URL";
$l_antivir_on="L'antivirus de flux WEB est actuellement activé";
$l_antivir_off="L'antivirus de flux WEB est actuellement désactivé";
$l_webfilter_on="Le filtrage WEB est actuellement activé";
$l_webfilter_off="Le filtrage WEB est actuellement désactivé";
$l_switch_on="Activer le filtrage WEB";
$l_switch_off="Désactiver le filtrage WEB";
$l_comment_on="(la consultation WEB est filtrée selon les critères définis ci-dessous)";
$l_comment_off="(la consultation WEB est autorisée sans restriction)";
$l_switch_antivir_on="Activer l'antivirus";
$l_switch_antivir_off="Désactiver l'antivirus";
$l_switch_filtering_on="Activer le filtrage";
$l_switch_filtering_off="Désactiver le filtrage";
$l_main_bl="Liste noire principale (version actuelle : ";
$l_download="Télécharger la dernière version";
$l_warning="<B>Attention</B> : ce téléchargement dure plusieurs minutes.";
27,25 → 29,30
$l_secondary_bl="Liste noire et liste blanche secondaires";
}
else {
$l_title = "WEB Filter";
$l_title1 = "Antivirus";
$l_title2 = "Domain names and URL filtering";
$l_antivir_on="Actually, the antivirus is on";
$l_antivir_off="Actually, the antivirus is off";
$l_webfilter_on="Actually, the WEB filter is on";
$l_webfilter_off="Actually, the WEB filter is off";
$l_switch_on="Switch the WebFilter on";
$l_switch_off="Switch the WebFilter off";
$l_comment_on="(The WEB consultation is filtered as defined below)";
$l_comment_off="(The WEB consultation is allowed without any restriction)";
$l_switch_antivir_on="Switch the antivirus on";
$l_switch_antivir_off="Switch the antivirus off";
$l_switch_filtering_on="Switch the WebFilter on";
$l_switch_filtering_off="Switch the WebFilter off";
$l_main_bl="Main blacklist (current version : ";
$l_download="Download the last version";
$l_warning="<B>Be carefull</B> : this download is estimate to fiew minutes.";
$l_secondary_bl="Secondary blacklist and whitelist";
}
echo "
<tr><th>$l_title</th></tr>
<tr bgcolor=\"#FFCC66\"><td><img src=\"/images/pix.gif\" width=1 height=2></td></tr>
</TABLE>";
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 'BL_On' :
exec ("sudo /usr/local/sbin/alcasar-bl.sh -on");
break;
76,42 → 83,77
break;
}
?>
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
<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
$pointeur = fopen("/etc/dansguardian/dansguardian.conf", "r");
$result = false;
$result_antivir = false; $result_filter = false; $out=0;
if ($pointeur)
{
while (!feof($pointeur))
{
$ligne = fgets($pointeur);
if (preg_match("/^proxyport = 8090/", $ligne, $r))
{
$result_antivir = true;
$out++;
}
if (preg_match("/^reportinglevel = 3/", $ligne, $r))
{
$result = true;
break;
$result_filter = true;
$out++;
}
if ($out == 2) break;
}
}
fclose($pointeur);
if ($result)
if ($result_antivir)
{
echo "<CENTER><H3>$l_webfilter_on</H3>$l_comment_on</CENTER>";
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><?php echo "$l_title2"; ?></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 ($result_filter)
{
echo "<CENTER><H3>$l_webfilter_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_off\">";
echo "<input type=submit value=\"$l_switch_filtering_off\">";
}
else
{
echo "<CENTER><H3>$l_webfilter_off</H3>$l_comment_off</CENTER>";
echo "<CENTER><H3>$l_webfilter_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_on\">";
echo "<input type=submit value=\"$l_switch_filtering_on\">";
}
echo "</FORM>";
echo "</td></tr>";
echo "</TABLE>";
if ($result) require ('web_filter2.php');
if ($result_filter) require ('web_filter2.php');
?>
</BODY>
</HTML>