Subversion Repositories ALCASAR

Compare Revisions

Regard whitespace Rev 1842 → Rev 1843

/web/acc/admin/wl_filter.php
69,6 → 69,7
if($Language == 'fr'){
$l_wl="Liste blanche";
$l_list_version="Version de la liste : ";
$l_specific_filtering="Filtrage special";
$l_wl_categories="Sélectionnez les catégories à autoriser";
$l_allowed_dns="Noms de domaine autorisés";
$l_one_dns="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
84,6 → 85,11
$l_nbDomainNames="Noms de domaine :";
$l_nbUrl="Url :";
$l_nbIp="Ip :";
$l_ip_filtering="Filtrer les URLs contenant une adresse IP au lieu d'un nom de domaine (ex: http://25.56.58.59/index.htm)";
$l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche : google, yahoo, bing, metacrawler et Youtube.";
$l_safe_youtube="Pour Youtube sain, suivez les étapes ici pour chaque poste : ";
$l_youtube_id="(<a href='http://www.youtube.com/education_signup' target='cat_help' onclick=window.open('http://www.youtube.com/education_signup','cat_help','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes') title='Youtube for school'>lien pour créer un identifiant Youtube (Id)</a>)";
}
else {
$l_wl="WhiteList";
103,6 → 109,12
$l_nbDomainNames="Domain names :";
$l_nbUrl="Url :";
$l_nbIp="Ip :";
$l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
$l_specific_filtering="Specific filtering";
$l_safe_youtube="For Safe Youtube, follow steps here for each computer ";
$l_youtube_id="(<a href='http://www.youtube.com/education_signup' target='cat_help' onclick=window.open('http://www.youtube.com/education_signup','cat_help','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes') title='Youtube for school'>link to create a Youtube Id</a>)";
$l_safe_searching="Enabling school/parental control for the search engines google, yahoo, bing, metacrawler and Youtube.";
}
$dir_etc="/usr/local/etc/";
$dir_dg="/etc/dansguardian/lists/";
110,9 → 122,39
$wl_categories=$dir_etc."alcasar-wl-categories";
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
$conf_file=$dir_etc."alcasar.conf";
$tinyproxy_conf="/etc/tinyproxy/tinyproxy.conf";
$dnsmasq_conf="/etc/dnsmasq-whitelist.conf";
# default values
if (is_file ($conf_file))
{
$tab=file($conf_file);
if ($tab)
{
foreach ($tab as $line)
{
$field=explode("=", $line);
if ($field[0] == "PRIVATE_IP")
{
$PRIVATE_IP_MASK=trim($field[1]);
$tmp = explode("/",$PRIVATE_IP_MASK);
$PRIVATE_IP=$tmp[0];
}
}
}
}
else { echo "$l_error_open_file $conf_file";}
 
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
switch ($choix)
{
case 'Specific_filtering' :
$safesearch="-safesearch_off"; ;
foreach ($_POST as $key => $value)
{
if (strstr($key,'chk-safesearch')) $safesearch="-safesearch_on";
}
exec ("sudo /usr/local/bin/alcasar-url_filter_wl.sh $safesearch");
break;
case 'MAJ_cat_wl' :
if (file_exists($wl_categories_enabled))
{
144,6 → 186,7
<tr><th><?php echo $l_wl; ?></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=1>
<tr><td valign="middle" align="left" colspan=10>
<FORM action='wl_filter.php' method=POST>
195,9 → 238,48
echo "<H3>$l_allowed_ip</H3>$l_forbidden_ip_explain<BR>";
echo "<textarea name='OSSI_wl_ip' rows=3 cols=40>";
echo_ip_file ($file_wl_ip);
echo "</textarea></td></tr><tr><td colspan=10>";
echo "</textarea></td></tr>";
echo "<tr><td colspan=10>";
echo "</table><br/>";
echo "<input type='submit' value='$l_record'></form></td></tr>";
?>
 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th><?php echo $l_specific_filtering; ?></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=1>
<FORM action='wl_filter.php' method='POST'>
<input type='hidden' name='choix' value='Specific_filtering'>
<tr><td>
 
<input type='checkbox' name='chk-safesearch'
<?php
//verification du safesearch
if(file_exists($dnsmasq_conf))
{
$f=fopen($dnsmasq_conf, 'r');
while(!feof($f))
{
$line=fgets($f,4096);
if($line && preg_match('/^address=\/\.google/',$line,$r))
{
echo "checked";
break;
}
}
fclose($f);
}
else
echo "$l_error_open_file $dnsmasq_conf";
echo "> $l_safe_searching";
 
echo "<br></br>$l_safe_youtube";
echo " $l_youtube_id<tr><td>";
 
echo "<input type='submit' value='$l_record'></form></td></tr>";
?>
 
</TABLE><br/>
</BODY>
</HTML>