| Line 13... |
Line 13... |
| 13 |
$list = str_replace("\r\n", "\n", utf8_decode($form_content));
|
13 |
$list = str_replace("\r\n", "\n", utf8_decode($form_content));
|
| 14 |
if (strlen($list) != 0){
|
14 |
if (strlen($list) != 0){
|
| 15 |
if ($list[strlen($list)-1] != "\n") { $list[strlen($list)]="\n";} ;} ;
|
15 |
if ($list[strlen($list)-1] != "\n") { $list[strlen($list)]="\n";} ;} ;
|
| 16 |
return $list;
|
16 |
return $list;
|
| 17 |
}
|
17 |
}
|
| 18 |
|
- |
|
| 19 |
$bl_categories="/usr/local/etc/alcasar-bl-categories";
|
- |
|
| 20 |
$bl_categories_enabled="/usr/local/etc/alcasar-bl-categories-enabled";
|
- |
|
| 21 |
$dir_blacklist="/etc/dansguardian/lists/blacklist/";
|
- |
|
| 22 |
# Choice of language
|
18 |
# Choice of language
|
| 23 |
$Language = 'en';
|
19 |
$Language = 'en';
|
| 24 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
20 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
| 25 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
21 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
| 26 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
22 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
| Line 74... |
Line 70... |
| 74 |
$l_rehabilitated_url_explain="Enter here URL that are blocked by the main blacklist <BR> and which you want to rehabilitate.";
|
70 |
$l_rehabilitated_url_explain="Enter here URL that are blocked by the main blacklist <BR> and which you want to rehabilitate.";
|
| 75 |
$l_one_url="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
|
71 |
$l_one_url="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
|
| 76 |
$l_record="Save changes";
|
72 |
$l_record="Save changes";
|
| 77 |
$l_wait="Once validated, 30 seconds is necessary to compute your modifications";
|
73 |
$l_wait="Once validated, 30 seconds is necessary to compute your modifications";
|
| 78 |
}
|
74 |
}
|
| - |
|
75 |
$bl_categories="/usr/local/etc/alcasar-bl-categories";
|
| - |
|
76 |
$bl_categories_enabled="/usr/local/etc/alcasar-bl-categories-enabled";
|
| - |
|
77 |
$dir_blacklist="/etc/dansguardian/lists/blacklist/";
|
| - |
|
78 |
$conf_file="/usr/local/etc/alcasar.conf";
|
| 79 |
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
|
79 |
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
|
| 80 |
switch ($choix)
|
80 |
switch ($choix)
|
| 81 |
{
|
81 |
{
|
| 82 |
case 'BL_On' :
|
82 |
case 'BL_On' :
|
| 83 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh --on");
|
83 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh --on");
|
| Line 134... |
Line 134... |
| 134 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
|
134 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
|
| 135 |
</TABLE>
|
135 |
</TABLE>
|
| 136 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
|
136 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
|
| 137 |
<tr><td valign="middle" align="left">
|
137 |
<tr><td valign="middle" align="left">
|
| 138 |
<?php
|
138 |
<?php
|
| 139 |
$pointeur = fopen("/etc/dansguardian/dansguardian.conf", "r");
|
- |
|
| 140 |
$result_filter = false; $out=0;
|
139 |
# default values
|
| 141 |
if ($pointeur)
|
140 |
if (is_file ($conf_file))
|
| 142 |
{
|
141 |
{
|
| 143 |
while (!feof($pointeur))
|
142 |
$tab=file($conf_file);
|
| - |
|
143 |
if ($tab)
|
| 144 |
{
|
144 |
{
|
| 145 |
$ligne = fgets($pointeur);
|
145 |
foreach ($tab as $line)
|
| 146 |
if (preg_match("/^reportinglevel = 3/", $ligne, $r))
|
- |
|
| 147 |
{
|
146 |
{
|
| 148 |
$result_filter = true;
|
147 |
$field=explode("=", $line);
|
| 149 |
$out++;
|
148 |
if ($field[0] == "DNS_FILTERING") {$DNS_FILTERING=trim($field[1]);}
|
| 150 |
}
|
149 |
}
|
| 151 |
if ($out == 2) break;
|
- |
|
| 152 |
}
|
150 |
}
|
| 153 |
}
|
151 |
}
|
| 154 |
fclose($pointeur);
|
152 |
else { echo "$l_error_open_file $conf_file";}
|
| 155 |
if ($result_filter)
|
153 |
if ($DNS_FILTERING == "on")
|
| 156 |
{
|
154 |
{
|
| 157 |
echo "<CENTER><H3>$l_dnsfilter_on</H3></CENTER>";
|
155 |
echo "<CENTER><H3>$l_dnsfilter_on</H3></CENTER>";
|
| 158 |
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
|
156 |
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
|
| 159 |
echo "<input type=hidden name='choix' value=\"BL_Off\">";
|
157 |
echo "<input type=hidden name='choix' value=\"BL_Off\">";
|
| 160 |
echo "<input type=submit value=\"$l_switch_filtering_off\">";
|
158 |
echo "<input type=submit value=\"$l_switch_filtering_off\">";
|
| Line 167... |
Line 165... |
| 167 |
echo "<input type=submit value=\"$l_switch_filtering_on\">";
|
165 |
echo "<input type=submit value=\"$l_switch_filtering_on\">";
|
| 168 |
}
|
166 |
}
|
| 169 |
echo "</FORM>";
|
167 |
echo "</FORM>";
|
| 170 |
echo "</td></tr>";
|
168 |
echo "</td></tr>";
|
| 171 |
echo "</TABLE>";
|
169 |
echo "</TABLE>";
|
| 172 |
if ($result_filter) require ('dns_filter2.php');
|
170 |
if ($DNS_FILTERING == "on") require ('dns_filter2.php');
|
| 173 |
?>
|
171 |
?>
|
| 174 |
</BODY>
|
172 |
</BODY>
|
| 175 |
</HTML>
|
173 |
</HTML>
|