Subversion Repositories ALCASAR

Compare Revisions

Regard whitespace Rev 2662 → Rev 2688

/web/acc/admin/wl_filter.php
76,7 → 76,7
$l_wl_categories="Sélectionnez les catégories à autoriser";
$l_specific_filtering="Filtrage special";
$l_add_to_wl="Noms de domaine ou adresses IP à ajouter à la liste blanche";
$l_one_dns_ip="Entrez un nom de domaine ou une adresse IP ou une adresse de réseau par ligne<br>exemple (domaine) : .domaine.org - exemple (ip) : 61.54.52.56 - exemple (réseau) : 172.16.0.0/16";
$l_one_dns_ip="Entrez un nom de domaine ou une adresse IP ou une adresse de réseau par ligne<br>exemple (domaine) : domaine.org. - exemple (ip) : 61.54.52.56 - exemple (réseau) : 172.16.0.0/16";
$l_record="Enregistrer les modifications";
$l_wait="Une fois validées, 10 secondes sont nécessaires pour traiter vos modifications";
$l_safe_searching="Activer le contrôle scolaire/parental pour 'YouTube' et pour les moteurs de recherche 'Google', 'Bing' et 'Qwant'.";
107,7 → 107,7
$l_specific_filtering="Specific filtering";
$l_allowed_dns="Allowed domain names";
$l_add_to_wl="Domain names or IP addresses to add to the whitelist";
$l_one_dns_ip="Enter one domain name or one IP address or one network address per row <br>example (domain): .domain.org - example (ip): 61.54.56.52 - example (network) : 172.16.0.0/16";
$l_one_dns_ip="Enter one domain name or one IP address or one network address per row <br>example (domain): domain.org. - example (ip): 61.54.56.52 - example (network) : 172.16.0.0/16";
$l_record="Save changes";
$l_wait="Once validated, 10 seconds are necessary to compute your modifications";
$l_safe_searching="Enabling school/parental control for 'YouTube' and for the search engines 'Google', 'Bing' and 'Qwant'";
135,15 → 135,16
$dir_blacklist=$dir_dg."blacklists/";
$dir_wl_ip="/usr/local/share/iptables-wl/";
$dir_wl_ip_enabled= "/usr/local/share/iptables-wl-enabled/";
$dir_wl_domain_names= "/usr/local/share/dnsmasq-wl/";
$dir_wl_domain_names_enabled= "/usr/local/share/dnsmasq-wl-enabled/";
$dir_wl_domain_names= "/usr/local/share/unbound-wl/";
$dir_wl_domain_names_enabled= "/usr/local/share/unbound-wl-enabled/";
$wl_categories=$dir_etc."alcasar-wl-categories";
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
$conf_file=$dir_etc."alcasar.conf";
$iptables_safesearch_file=$dir_wl_ip_enabled."ossi-ip-safesearch";
$domainfilter_file="/etc/unbound/conf.d/whitelist/domainfilter.conf";
$bannedsite_file=$dir_dg."bannedsitelist";
$dir_tmp="/tmp/blacklists";
 
$wl_safesearch="off";
 
# default values
if (is_file ($conf_file))
154,15 → 155,22
foreach ($tab as $line)
{
$field=explode("=", $line);
if ($field[0] == "PRIVATE_IP")
{
switch ($field[0]) {
case 'PRIVATE_IP':
$PRIVATE_IP_MASK=trim($field[1]);
$tmp = explode("/",$PRIVATE_IP_MASK);
$PRIVATE_IP=$tmp[0];
break;
 
case 'WL_SAFESEARCH':
if (strtolower(trim($field[1])) == 'on') {
$wl_safesearch='on';
}
break;
}
}
}
}
else { echo "$l_error_open_file $conf_file";}
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
switch ($choix)
201,12 → 209,14
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
break;
case 'Specific_filtering' :
$safesearch="-safesearch_off"; ;
$wl_safesearch='off';
foreach ($_POST as $key => $value)
{
if (strstr($key,'chk-safesearch')) $safesearch="-safesearch_on";
if (strstr($key,'chk-safesearch')) {
$wl_safesearch='on';
}
exec ("sudo /usr/local/bin/alcasar-url_filter_wl.sh $safesearch");
}
exec ("sudo /usr/local/bin/alcasar-url_filter_wl.sh -safesearch_$wl_safesearch");
break;
case 'MAJ_ossi_file' :
foreach($_POST as $fichier => $value)
269,9 → 279,9
<?php
echo "<center>";
// total number of IP, DNS & URLs
$nbDomainNames = exec("wc -l /usr/local/share/dnsmasq-wl/* | tail -n 1 | awk '{print $1}'");
$nbDomainNames = exec("wc -l $dir_wl_domain_names* | tail -n 1 | awk '{print $1}'");
$nbUrl = "0";
$nbIp = exec("wc -l /usr/local/share/iptables-wl/* | tail -n 1 | awk '{print $1}'");
$nbIp = exec("wc -l $dir_wl_ip* | 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>";
//read & display all WL categories (checked or not)
293,9 → 303,10
$cols++;
if ($cols > 10) {
echo "</tr>";
$cols=1; }
$cols=1;
}
}
}
else {
echo "$l_error_open_file $wl_categories";
}
350,17 → 361,11
<FORM action='wl_filter.php' method='POST'>
<input type='hidden' name='choix' value='Specific_filtering'>
<tr><td>
<input type='checkbox' name='chk-safesearch'
<?php
// verify "safesearch" filtering state
if (file_exists($iptables_safesearch_file))
{
echo " checked";
}
echo "> $l_safe_searching<tr><td>";
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_record'></td></tr>";
?>
</FORM>
<input type='checkbox' name='chk-safesearch' <?= $wl_safesearch == 'on' ? 'checked' : ''; ?>><?= $l_safe_searching; ?>
</tr></td>
<tr><td>
<?= "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_record'>"; ?>
</td></tr></FORM>
</TABLE>
</BODY>
</HTML>