/gestion/admin/dns_filter.php |
---|
7,6 → 7,9 |
</HEAD> |
<body> |
<? |
$bl_categories="/usr/local/etc/alcasar-bl-categories"; |
$bl_categories_enabled="/usr/local/etc/alcasar-bl-categories-enabled"; |
$dir_blacklist="/etc/dansguardian/lists/blacklist/"; |
# Choice of language |
$Language = 'en'; |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){ |
75,6 → 78,24 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -download"); |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -reload"); |
break; |
case 'MAJ_cat' : |
$tab=file($bl_categories_enabled); |
if ($tab) |
{ |
$pointeur=fopen($bl_categories_enabled, "w+"); |
foreach ($_POST as $key => $value) |
{ |
if (strstr($key,'chk-')) |
{ |
$line=str_replace('chk-','',$key)."\n"; |
fwrite($pointeur,$line); |
} |
} |
fclose($pointeur); |
} |
else {echo "$l_error_open_file $bl_categories_enabled";} |
exec ("sudo /usr/local/sbin/alcasar-bl.sh -reload"); |
break; |
case 'MAJ_OSSI' : |
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/domains","w+"); |
fputs($fichier, $_POST['OSSI_bl_domains']); |
/gestion/admin/categorie_help.php |
---|
0,0 → 1,41 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<HTML><!-- written by Rexy --> |
<HEAD> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<TITLE>ALCASAR Filter Exceptions</TITLE> |
<link rel="stylesheet" href="/css/style.css" type="text/css"> |
</HEAD> |
<body> |
<? |
# Choice of language |
$Language = 'en'; |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){ |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']); |
$Language = strtolower(substr(chop($Langue[0]),0,2)); } |
if (isset($_GET['cat'])){$categorie=$_GET['cat'];} |
switch ($categorie) |
{ |
case 'adult' : |
if ($Language == 'fr'){ |
$message="La catégorie 'adult' couvre ...";} |
else {$message="The 'adult' category ...";} |
break; |
default : |
if ($Language == 'fr'){ |
$message="Cette catégorie n'est pas connue";} |
else {$message="This categorie is unknown";} |
break; |
} |
?> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th><?php echo $categorie ;?></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"> |
<?php |
echo "$message";?> |
</td></tr> |
</TABLE> |
</BODY> |
</HTML> |
/gestion/admin/dns_filter2.php |
---|
36,14 → 36,14 |
</td></tr> |
<tr><td valign="middle" align="left" colspan=10> |
<FORM action='/admin/dns_filter.php' method=POST> |
<input type='hidden' name='choix' value='MAJ_OSSI'> |
<input type='hidden' name='choix' value='MAJ_cat'> |
<?php |
echo "<center>$l_bl_categories</center></td></tr>"; |
//on lit et on interprete le fichier de catégories |
$cols=1; $filename="/usr/local/etc/alcasar-bl-categories-available"; |
if (file_exists($filename)) |
$cols=1; |
if (file_exists($bl_categories)) |
{ |
$pointeur=fopen($filename,"r"); |
$pointeur=fopen($bl_categories,"r"); |
while (!feof ($pointeur)) |
{ |
$ligne=fgets($pointeur, 4096); |
51,20 → 51,16 |
{ |
if ($cols == 1) { echo "<tr>";} |
$categorie=trim(basename($ligne)); |
echo "<td>$categorie<br>"; |
echo "<td><a href='categorie_help.php?cat=$categorie' target='cat_help' onclick=window.open('categorie_help.php','cat_help','width=600','height=250','toolbar=no','scrollbars=no','resizable=yes') title='categories help page'>$categorie</a><br>"; |
echo "<input type='checkbox' name='chk-$categorie'"; |
// si la ligne est commentée -> categorie non selectionnée |
if (preg_match('/^#/',$ligne, $r)) { |
echo ">";} |
else { |
echo "checked>";} |
echo "</td>"; |
} |
if (preg_match('/^#/',$ligne, $r)) { echo ">";} |
else { echo "checked>"; } |
echo "</td>"; |
$cols++; |
if ($cols > 10){ |
if ($cols > 10) { |
echo "</tr>"; |
$cols=1; |
$cols=1; } |
} |
} |
fclose($pointeur); |
71,7 → 67,7 |
echo "<tr><td colspan=10><input type='submit' value='$l_record'>"; |
} |
else { |
echo "$l_error_open_file $filename"; |
echo "$l_error_open_file $bl_categories"; |
} |
?> |
</FORM> |