Line 99... |
Line 99... |
99 |
$l_fingerprint2="Vérifiez-là en suivant ce lien (ligne 'blacklists.tar.gz') : ";
|
99 |
$l_fingerprint2="Vérifiez-là en suivant ce lien (ligne 'blacklists.tar.gz') : ";
|
100 |
$l_activate_bl="Activer la nouvelle version";
|
100 |
$l_activate_bl="Activer la nouvelle version";
|
101 |
$l_reject_bl="Rejeter";
|
101 |
$l_reject_bl="Rejeter";
|
102 |
$l_warning="Temps estimé : une minute.";
|
102 |
$l_warning="Temps estimé : une minute.";
|
103 |
$l_specific_filtering="Filtrage special";
|
103 |
$l_specific_filtering="Filtrage special";
|
104 |
$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";
|
- |
|
105 |
$l_maj_rehabilitated="Noms de domaine ou IP réhabilités";
|
104 |
$l_maj_rehabilitated="Noms de domaine ou IP réhabilités";
|
106 |
$l_rehabilitated_dns="Noms de domaine réhabilités";
|
105 |
$l_rehabilitated_dns="Noms de domaine réhabilités";
|
107 |
$l_rehabilitated_dns_explain="Entrez ici des noms de domaine bloqués par la liste noire <BR> que vous souhaitez réhabiliter.";
|
106 |
$l_rehabilitated_dns_explain="Entrez ici des noms de domaine bloqués par la liste noire <BR> que vous souhaitez réhabiliter.";
|
108 |
$l_add_to_bl="Noms de domaine ou adresses IP à ajouter à la liste noire";
|
107 |
$l_add_to_bl="Noms de domaine ou adresses IP à ajouter à la liste noire";
|
109 |
$l_rehabilitated_ip="IP réhabilitées";
|
108 |
$l_rehabilitated_ip="IP réhabilitées";
|
110 |
$l_rehabilitated_ip_explain="Entrez ici des IP bloquées par la liste noire <BR> que vous souhaitez réhabiliter.";
|
109 |
$l_rehabilitated_ip_explain="Entrez ici des IP bloquées par la liste noire <BR> que vous souhaitez réhabiliter.";
|
- |
|
110 |
$l_one_dns="Entrez une adresse DNS par ligne (exemple : www.domaine.com)";
|
111 |
$l_one_ip="Entrez une IP par ligne (exemple : 123.123.123.123)";
|
111 |
$l_one_ip="Entrez une IP par ligne (exemple : 123.123.123.123)";
|
- |
|
112 |
$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";
|
112 |
$l_record="Enregistrer les modifications";
|
113 |
$l_record="Enregistrer les modifications";
|
113 |
$l_wait="Une fois validées, 10 secondes sont nécessaires pour traiter vos modifications";
|
114 |
$l_wait="Une fois validées, 10 secondes sont nécessaires pour traiter vos modifications";
|
114 |
$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)";
|
115 |
$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)";
|
115 |
$l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche google.";
|
116 |
$l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche google.";
|
116 |
$l_safe_youtube="Pour un contrôle parental sur Youtube, suivez les étapes ici : ";
|
117 |
$l_safe_youtube="Pour un contrôle parental sur Youtube, suivez les étapes ici : ";
|
Line 146... |
Line 147... |
146 |
$l_activate_bl="Activate the new version";
|
147 |
$l_activate_bl="Activate the new version";
|
147 |
$l_reject_bl="Reject";
|
148 |
$l_reject_bl="Reject";
|
148 |
$l_warning="Estimated time : one minute.";
|
149 |
$l_warning="Estimated time : one minute.";
|
149 |
$l_specific_filtering="Specific filtering";
|
150 |
$l_specific_filtering="Specific filtering";
|
150 |
$l_allowed_dns="Allowed domain names";
|
151 |
$l_allowed_dns="Allowed domain names";
|
151 |
$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";
|
- |
|
152 |
$l_maj_rehabilitated="Domain names or IP rehabilitated";
|
152 |
$l_maj_rehabilitated="Domain names or IP rehabilitated";
|
153 |
$l_rehabilitated_dns="Rehabilitated domain names";
|
153 |
$l_rehabilitated_dns="Rehabilitated domain names";
|
154 |
$l_rehabilitated_dns_explain="Enter here domain names that are blocked by the blacklist <BR> and you want to rehabilitate.";
|
154 |
$l_rehabilitated_dns_explain="Enter here domain names that are blocked by the blacklist <BR> and you want to rehabilitate.";
|
155 |
$l_add_to_bl="Domain names or IP addresses to add to the blacklist";
|
155 |
$l_add_to_bl="Domain names or IP addresses to add to the blacklist";
|
156 |
$l_rehabilitated_ip="Rehabilitated IP";
|
156 |
$l_rehabilitated_ip="Rehabilitated IP";
|
157 |
$l_rehabilitated_ip_explain="Enter here IP that are blocked by the blacklist <BR> and you want to rehabilitate.";
|
157 |
$l_rehabilitated_ip_explain="Enter here IP that are blocked by the blacklist <BR> and you want to rehabilitate.";
|
- |
|
158 |
$l_one_dns="Enter one DNS per row (example : www.domaine.com)";
|
158 |
$l_one_ip="Enter one IP per row (example : 123.123.123.123)";
|
159 |
$l_one_ip="Enter one IP per row (example : 123.123.123.123)";
|
- |
|
160 |
$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";
|
159 |
$l_record="Save changes";
|
161 |
$l_record="Save changes";
|
160 |
$l_wait="Once validated, 10 seconds are necessary to compute your modifications";
|
162 |
$l_wait="Once validated, 10 seconds are necessary to compute your modifications";
|
161 |
$l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
|
163 |
$l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
|
162 |
$l_safe_searching="Enabling school/parental control for the search engines google";
|
164 |
$l_safe_searching="Enabling school/parental control for the search engines google";
|
163 |
$l_safe_youtube="For a safe Youtube search, follow these steps : ";
|
165 |
$l_safe_youtube="For a safe Youtube search, follow these steps : ";
|
Line 182... |
Line 184... |
182 |
$l_enable="Enable";
|
184 |
$l_enable="Enable";
|
183 |
$l_file_state="State";
|
185 |
$l_file_state="State";
|
184 |
}
|
186 |
}
|
185 |
$dir_etc="/usr/local/etc/";
|
187 |
$dir_etc="/usr/local/etc/";
|
186 |
$dir_dg="/etc/dansguardian/lists/";
|
188 |
$dir_dg="/etc/dansguardian/lists/";
|
- |
|
189 |
$dir_blacklist=$dir_dg."blacklists/";
|
187 |
$dir_bl_ip="/usr/local/share/iptables-bl/";
|
190 |
$dir_bl_ip="/usr/local/share/iptables-bl/";
|
188 |
$dir_bl_dns="/usr/local/share/dnsmasq-bl/";
|
191 |
$dir_bl_dns="/usr/local/share/dnsmasq-bl/";
|
189 |
$bl_categories=$dir_etc."alcasar-bl-categories";
|
192 |
$bl_categories=$dir_etc."alcasar-bl-categories";
|
190 |
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled";
|
193 |
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled";
|
191 |
$conf_file=$dir_etc."alcasar.conf";
|
194 |
$conf_file=$dir_etc."alcasar.conf";
|
192 |
$dir_blacklist=$dir_dg."blacklists/";
|
- |
|
193 |
$urlregex_file=$dir_dg."urlregexplist";
|
195 |
$urlregex_file=$dir_dg."urlregexplist";
|
194 |
$bannedsite_file=$dir_dg."bannedsitelist";
|
196 |
$bannedsite_file=$dir_dg."bannedsitelist";
|
195 |
$dir_tmp="/tmp/blacklists";
|
197 |
$dir_tmp="/tmp/blacklists";
|
196 |
$upload_dir_ip = "/usr/local/share/iptables-bl-enabled/";
|
198 |
$dir_ip_enabled = "/usr/local/share/iptables-bl-enabled/";
|
197 |
$upload_dir_domain_names = "/usr/local/share/dnsmasq-bl-enabled/";
|
199 |
$dir_domain_names_enabled = "/usr/local/share/dnsmasq-bl-enabled/";
|
198 |
$dir_ip = "/usr/local/share/iptables-bl/";
|
200 |
$dir_ip = "/usr/local/share/iptables-bl/";
|
199 |
$dir_domain_names = "/usr/local/share/dnsmasq-bl/";
|
201 |
$dir_domain_names = "/usr/local/share/dnsmasq-bl/";
|
200 |
$update_file_cat="/usr/local/etc/update_cat.conf";
|
202 |
$update_file_cat="/usr/local/etc/update_cat.conf";
|
201 |
|
203 |
|
202 |
|
204 |
|
Line 251... |
Line 253... |
251 |
}
|
253 |
}
|
252 |
|
254 |
|
253 |
fclose($pointeur);
|
255 |
fclose($pointeur);
|
254 |
}
|
256 |
}
|
255 |
else {echo "$l_error_open_file $bl_categories_enabled";}
|
257 |
else {echo "$l_error_open_file $bl_categories_enabled";}
|
256 |
$fichier=fopen($dir_bl_dns."ossi.conf","w+");
|
258 |
$fichier=fopen($dir_blacklist."ossi-bl/domains","w+");
|
257 |
fputs($fichier, form_filter($_POST['OSSI_bl_domains']));
|
259 |
fputs($fichier, form_filter($_POST['OSSI_bl']));
|
258 |
fclose($fichier);
|
260 |
fclose($fichier);
|
259 |
unset($_POST['OSSI_bl_domains']);
|
261 |
unset($_POST['OSSI_bl']);
|
260 |
$fichier=fopen($dir_dg."exceptionsitelist","w+");
|
262 |
$fichier=fopen($dir_dg."exceptionsitelist","w+");
|
261 |
fputs($fichier, form_filter($_POST['BL_rehabilited_domains']));
|
263 |
fputs($fichier, form_filter($_POST['BL_rehabilited_domains']));
|
262 |
fclose($fichier);
|
264 |
fclose($fichier);
|
263 |
unset($_POST['BL_rehabilited_domains']);
|
265 |
unset($_POST['BL_rehabilited_domains']);
|
264 |
$fichier=fopen($dir_bl_ip."ossi","w+");
|
- |
|
265 |
fputs($fichier, form_filter_ip($_POST['OSSI_bl_ip'], "black"));
|
- |
|
266 |
fclose($fichier);
|
- |
|
267 |
unset($_POST['OSSI_bl_ip']);
|
- |
|
268 |
$fichier=fopen($dir_dg."exceptioniplist","w+");
|
266 |
$fichier=fopen($dir_dg."exceptioniplist","w+");
|
269 |
fputs($fichier, form_filter($_POST['BL_rehabilited_ip']));
|
267 |
fputs($fichier, form_filter($_POST['BL_rehabilited_ip']));
|
270 |
fclose($fichier);
|
268 |
fclose($fichier);
|
271 |
unset($_POST['BL_rehabilited_ip']);
|
269 |
unset($_POST['BL_rehabilited_ip']);
|
272 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
270 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
Line 278... |
Line 276... |
278 |
if (strstr($key,'chk-ip')) $pureip="-pureip_on";
|
276 |
if (strstr($key,'chk-ip')) $pureip="-pureip_on";
|
279 |
if (strstr($key,'chk-safesearch')) $safesearch="-safesearch_on";
|
277 |
if (strstr($key,'chk-safesearch')) $safesearch="-safesearch_on";
|
280 |
}
|
278 |
}
|
281 |
exec ("sudo /usr/local/bin/alcasar-url_filter_bl.sh $safesearch $pureip");
|
279 |
exec ("sudo /usr/local/bin/alcasar-url_filter_bl.sh $safesearch $pureip");
|
282 |
break;
|
280 |
break;
|
283 |
case 'MAJ_ip_file' :
|
281 |
case 'MAJ_ossi_file' :
|
284 |
foreach($_POST as $fichier => $value)
|
282 |
foreach($_POST as $fichier => $value)
|
285 |
{
|
283 |
{
|
286 |
if($fichier != "choix")
|
284 |
if($fichier != "choix")
|
287 |
{
|
285 |
{
|
288 |
$action=$_POST[$fichier];
|
286 |
$action=$_POST[$fichier];
|
289 |
if($action == $l_remove) //delete
|
287 |
if($action == $l_remove) //delete
|
290 |
{
|
288 |
{
|
291 |
exec("rm -rf $upload_dir_ip$fichier");
|
289 |
exec("rm -f $dir_ip_enabled$fichier");
|
292 |
exec("rm -rf $upload_dir_domain_names$fichier");
|
290 |
exec("rm -f $dir_domain_names_enabled$fichier");
|
293 |
exec("rm -rf $dir_ip$fichier");
|
291 |
exec("rm -f $dir_ip$fichier");
|
294 |
exec("rm -rf $dir_domain_names$fichier");
|
292 |
exec("rm -f $dir_domain_names$fichier");
|
- |
|
293 |
exec("rm -rf $dir_dg$fichier");
|
295 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
294 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
296 |
}
|
295 |
}
|
297 |
if($action == $l_disable) //disable
|
296 |
if($action == $l_disable) //disable
|
298 |
{
|
297 |
{
|
299 |
exec("mv -f $upload_dir_ip$fichier $dir_ip$fichier");
|
298 |
exec("rm -f $dir_ip_enabled$fichier");
|
300 |
if($fichier!='ossi-tor_node_ip')
|
- |
|
301 |
exec("mv -f $upload_dir_domain_names$fichier $dir_domain_names$fichier");
|
299 |
exec("rm -f $dir_domain_names_enabled$fichier");
|
302 |
exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
300 |
exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
303 |
}
|
301 |
}
|
304 |
if($action == $l_enable) //enable
|
302 |
if($action == $l_enable) //enable
|
305 |
{
|
303 |
{
|
306 |
exec("mv -f $dir_ip$fichier $upload_dir_ip$fichier");
|
304 |
exec("ln -s $dir_ip$fichier $dir_ip_enabled$fichier");
|
307 |
if($fichier!='ossi-tor_node_ip')
|
- |
|
308 |
exec("mv -f $dir_domain_names$fichier $upload_dir_domain_names$fichier");
|
305 |
exec("ln -s $dir_domain_names$fichier $dir_domain_names_enables$fichier");
|
309 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
306 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
310 |
}
|
307 |
}
|
311 |
}
|
308 |
}
|
312 |
}
|
309 |
}
|
313 |
break;
|
310 |
break;
|
314 |
case 'MAJ_ip_file_upload' :
|
311 |
case 'MAJ_ossi_file_upload' :
|
315 |
$nom = str_replace (".", "_",basename($_FILES['fichier_ip']['name']));
|
312 |
$nom = str_replace (".", "_",basename($_FILES['fichier_ip']['name']));
|
316 |
# Si un fichier a été choisi
|
313 |
# Si un fichier a été choisi
|
317 |
if(!empty($nom))
|
314 |
if(!empty($nom))
|
318 |
{
|
315 |
{
|
319 |
# On l'upload
|
316 |
# On l'upload
|
320 |
if(move_uploaded_file($_FILES['fichier_ip']['tmp_name'], $blacklist_dir."ossi-bl-".$nom))
|
317 |
if(move_uploaded_file($_FILES['fichier_ip']['tmp_name'], $blacklist_dir."ossi-bl-".$nom))
|
321 |
{
|
318 |
{
|
322 |
# On extrait uniquement les ip du fichier
|
- |
|
323 |
// exec("grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' $upload_dir_ip$nom > $upload_dir_ip\ossi_ip");
|
- |
|
324 |
|
- |
|
325 |
# Suppression des doublons
|
- |
|
326 |
// exec("sort -u $upload_dir_ip\ossi_ip > $upload_dir_ip\ossi-$nom && rm -f $upload_dir_ip\ossi_ip");
|
- |
|
327 |
|
- |
|
328 |
# On adapte le fichier à la sauvegarde du set
|
- |
|
329 |
// exec("sed -i \"s/^/add bl_ip_blocked /g\" $upload_dir_ip\ossi-$nom");
|
- |
|
330 |
|
- |
|
331 |
|
- |
|
332 |
# On extrait uniquement les noms de domaine
|
- |
|
333 |
# max_tld() retourne le nombre max de charactere pour un top-level dns
|
- |
|
334 |
// exec("grep -Eo '([a-zA-Z0-9_-]+\.){1,2}[a-zA-Z]{2,".max_tld()."}' $upload_dir_ip$nom > $upload_dir_domain_names\ossi_domain_names");
|
- |
|
335 |
|
- |
|
336 |
# Suppression des doublons
|
- |
|
337 |
// exec("sort -u $upload_dir_domain_names\ossi_domain_names > $upload_dir_domain_names\ossi-$nom && rm -f $upload_dir_domain_names\ossi_domain_names");
|
- |
|
338 |
|
- |
|
339 |
# On adapte le fichier pour Dnsmasq
|
- |
|
340 |
// exec("sed -i \"s/^/address=\//g\" $upload_dir_domain_names\ossi-$nom");
|
- |
|
341 |
// exec("sed -i \"s/$/\/$PRIVATE_IP/g\" $upload_dir_domain_names\ossi-$nom");
|
- |
|
342 |
|
- |
|
343 |
# Suppression du fichier
|
- |
|
344 |
// exec("rm -f $upload_dir_ip$nom");
|
- |
|
345 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
319 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
|
346 |
exec ("sudo /usr/local/bin/alcasar-iptables.sh ");
|
320 |
exec ("sudo /usr/local/bin/alcasar-iptables.sh ");
|
347 |
}
|
321 |
}
|
348 |
else
|
322 |
else
|
349 |
{
|
323 |
{
|
Line 391... |
Line 365... |
391 |
<tr><td valign="middle" align="left" colspan=10>
|
365 |
<tr><td valign="middle" align="left" colspan=10>
|
392 |
<FORM action='bl_filter.php' method=POST>
|
366 |
<FORM action='bl_filter.php' method=POST>
|
393 |
<input type='hidden' name='choix' value='MAJ_cat_bl'>
|
367 |
<input type='hidden' name='choix' value='MAJ_cat_bl'>
|
394 |
<?php
|
368 |
<?php
|
395 |
echo "<center>";
|
369 |
echo "<center>";
|
- |
|
370 |
// total nnumber of IP, DNS & URLs
|
396 |
$nbDomainNames = exec ("wc -l /usr/local/share/dnsmasq-bl/* | tail -n 1 | awk '{print $1}'");
|
371 |
$nbDomainNames = exec ("wc -l /usr/local/share/dnsmasq-bl/* | tail -n 1 | awk '{print $1}'");
|
397 |
$nbUrl = exec ("for file in `find /etc/dansguardian/lists/blacklists/ -name 'urls'`; do nb=$((nb+$(wc -l \$file | awk '{print $1}'))); done; echo \$nb");
|
372 |
$nbUrl = exec ("for file in `find /etc/dansguardian/lists/blacklists/ -name 'urls'`; do nb=$((nb+$(wc -l \$file | awk '{print $1}'))); done; echo \$nb");
|
398 |
$nbIp = exec ("wc -l /usr/local/share/iptables-bl/* | tail -n 1 | awk '{print $1}'");
|
373 |
$nbIp = exec ("wc -l /usr/local/share/iptables-bl/* | tail -n 1 | awk '{print $1}'");
|
399 |
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>";
|
374 |
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>";
|
400 |
echo "$l_bl_categories</center></td></tr>";
|
375 |
echo "$l_bl_categories</center></td></tr>";
|
401 |
//on lit et on interprete le fichier de catégories
|
376 |
//read & display all BL categories (checked or not)
|
402 |
$cols=1;
|
377 |
$cols=1;
|
403 |
if (file_exists($bl_categories))
|
378 |
if (file_exists($bl_categories))
|
404 |
{
|
379 |
{
|
405 |
$pointeur=fopen($bl_categories,"r");
|
380 |
$bl_files = file($bl_categories);
|
- |
|
381 |
$bl_files = preg_grep("/ossi-/", $bl_files, 1); // don't display ossi custom categories
|
406 |
while (!feof ($pointeur))
|
382 |
foreach($bl_files as $fichier => $value)
|
407 |
{
|
383 |
{
|
408 |
$ligne=fgets($pointeur, 4096);
|
- |
|
409 |
if ($ligne)
|
- |
|
410 |
{
|
- |
|
411 |
if ($cols == 1) { echo "<tr>";}
|
384 |
if ($cols == 1) { echo "<tr>";}
|
412 |
$categorie=trim(basename($ligne));
|
385 |
$categorie=trim(basename($value));
|
413 |
if($categorie != "ossi") // don't display ossi
|
- |
|
414 |
{
|
- |
|
415 |
echo "<td><a href='bl_categories_help.php?liste=bl&cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>$categorie</a><br>";
|
386 |
echo "<td><a href='bl_categories_help.php?liste=bl&cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>$categorie</a><br>";
|
416 |
echo "<input type='checkbox' name='chk-$categorie'";
|
387 |
echo "<input type='checkbox' name='chk-$categorie'";
|
417 |
// si la ligne est commentée -> categorie non selectionnée
|
388 |
// si la ligne est commentée -> categorie non selectionnée
|
418 |
if (preg_match('/^#/',$ligne, $r)) { echo ">";}
|
389 |
if (preg_match('/^#/',$value, $r)) { echo ">";}
|
419 |
else { echo "checked>"; }
|
390 |
else { echo "checked>"; }
|
420 |
echo "</td>";
|
391 |
echo "</td>";
|
421 |
$cols++;
|
392 |
$cols++;
|
422 |
}
|
- |
|
423 |
if ($cols > 10) {
|
393 |
if ($cols > 10) {
|
424 |
echo "</tr>";
|
394 |
echo "</tr>";
|
425 |
$cols=1; }
|
395 |
$cols=1; }
|
426 |
}
|
- |
|
427 |
}
|
396 |
}
|
428 |
fclose($pointeur);
|
- |
|
429 |
}
|
397 |
}
|
430 |
else {
|
398 |
else {
|
431 |
echo "$l_error_open_file $bl_categories";
|
399 |
echo "$l_error_open_file $bl_categories";
|
432 |
}
|
400 |
}
|
433 |
|
401 |
|
434 |
#update categories via rsync
|
402 |
//update categories with rsync
|
435 |
$update_select = array();
|
403 |
$update_select = array();
|
436 |
$update_select[0] = "";
|
404 |
$update_select[0] = "";
|
437 |
$update_select[1] = "";
|
405 |
$update_select[1] = "";
|
438 |
|
406 |
|
439 |
if ( 0 == filesize( $update_file_cat ) ) $update_select[0] = "checked";
|
407 |
if ( 0 == filesize( $update_file_cat ) ) $update_select[0] = "checked";
|
Line 455... |
Line 423... |
455 |
echo "</textarea></td>";
|
423 |
echo "</textarea></td>";
|
456 |
echo "<td width=50% colspan=5 align=center>";
|
424 |
echo "<td width=50% colspan=5 align=center>";
|
457 |
echo "<H3>$l_rehabilitated_ip</H3>$l_rehabilitated_ip_explain<BR>$l_one_ip<BR>";
|
425 |
echo "<H3>$l_rehabilitated_ip</H3>$l_rehabilitated_ip_explain<BR>$l_one_ip<BR>";
|
458 |
echo "<textarea name='BL_rehabilited_ip' rows=3 cols=40>";
|
426 |
echo "<textarea name='BL_rehabilited_ip' rows=3 cols=40>";
|
459 |
echo_file ($dir_dg."exceptioniplist");
|
427 |
echo_file ($dir_dg."exceptioniplist");
|
460 |
echo "</textarea></td></tr><tr><td width=50% colspan=10>";
|
428 |
echo "</textarea></td></tr>";
|
461 |
echo "<tr><td valign='middle' align='left' colspan=10>";
|
429 |
echo "<tr><td valign='middle' align='left' colspan=10>";
|
462 |
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
|
430 |
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
|
463 |
echo "<tr><td width=100% colspan=10 align=center>";
|
431 |
echo "<tr><td width=100% colspan=10 align=center>";
|
464 |
echo "$l_one_dns_ip<BR>";
|
432 |
echo "$l_one_dns_ip<BR>";
|
465 |
echo "<textarea name='OSSI_bl_domains' rows=3 cols=40>";
|
433 |
echo "<textarea name='OSSI_bl' rows=3 cols=40>";
|
466 |
echo_file ($dir_blacklist."ossi-bl/domain");
|
434 |
echo_file ($dir_blacklist."ossi-bl/domains");
|
467 |
echo "</textarea></td>";
|
435 |
echo "</textarea></td>";
|
468 |
//echo "<td width=50% colspan=5 align=center>";
|
- |
|
469 |
//echo "<H3>$l_forbidden_ip</H3>$l_forbidden_ip_explain<BR>";
|
- |
|
470 |
//echo "<textarea name='OSSI_bl_ip' rows=3 cols=40>";
|
- |
|
471 |
//echo_ip_file ($dir_blacklist."ossi");
|
- |
|
472 |
//echo "</textarea></td></tr>;
|
- |
|
473 |
echo "</tr><tr><td colspan=10>";
|
436 |
echo "</tr><tr><td colspan=10>";
|
474 |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';\" value='$l_record'>";
|
437 |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';\" value='$l_record'>";
|
475 |
echo "</form> ($l_wait)";
|
438 |
echo "</form> ($l_wait)";
|
476 |
echo "</td></tr></table><br/>";
|
439 |
echo "</td></tr></table><br/>";
|
477 |
?>
|
440 |
?>
|
478 |
|
- |
|
479 |
|
- |
|
480 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
441 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
481 |
<tr><th><?php echo $l_additional_file_title; ?></th></tr>
|
442 |
<tr><th><?php echo $l_additional_file_title; ?></th></tr>
|
482 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
|
443 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
|
483 |
</table>
|
444 |
</table>
|
484 |
<table width="100%" border=1 cellspacing=0 cellpadding=1>
|
445 |
<table width="100%" border=1 cellspacing=0 cellpadding=1>
|
485 |
<form action='bl_filter.php' method='POST'>
|
446 |
<form action='bl_filter.php' method='POST'>
|
486 |
<input type='hidden' name='choix' value='MAJ_ip_file'>
|
447 |
<input type='hidden' name='choix' value='MAJ_ossi_file'>
|
487 |
<?php
|
448 |
<?php
|
488 |
echo "<tr><td width=50% colspan=5 align=center>";
|
449 |
echo "<tr><td width=50% colspan=5 align=center>";
|
489 |
echo "<H3>$l_file_list</H3>";
|
450 |
echo "<H3>$l_file_list</H3>";
|
490 |
echo "<table cellspacing=2 cellpadding=3 border=1><tr><th>$l_file_name<th>$l_nb_ip<th>$l_nb_domain_names<th>$l_file_state<th>$l_file_remove</tr>";
|
451 |
echo "<table cellspacing=2 cellpadding=3 border=1><tr><th>$l_file_name<th>$l_nb_ip<th>$l_nb_domain_names<th>$l_file_state<th>$l_file_remove</tr>";
|
491 |
|
452 |
|
492 |
//liste des fichiers activés
|
453 |
//list OSSI custom categories
|
493 |
$fichiersbl = array_diff(scandir($dir_blacklist), array('..','.'));
|
454 |
$fichiersbl = array_diff(scandir($dir_blacklist), array('..','.','ossi-bl','ossi-wl'));
|
494 |
$fichiersbl = preg_grep("/^ossi-bl",$fichiersbl);
|
455 |
$fichiersbl = preg_grep("/^ossi-/",$fichiersbl);
|
495 |
foreach($fichiersbl as $fichier => $value)
|
456 |
foreach($fichiersbl as $fichier => $value)
|
496 |
{
|
457 |
{
|
497 |
if($value=='ossi-tor_node_ip')
|
- |
|
498 |
echo "<tr><td><center><a href='bl_categories_help.php?liste=bl&cat=$value&ossi=yes&filtre=domain' target='cat_help' onclick=window.open('bl_categories_help','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>".exec("sed 's/^.....//g' <<< $value")."</a></center></td><td><center>".exec("wc -l $upload_dir_ip$value | awk '{print $1}'")."</center></td><td><center>".exec("wc -l $upload_dir_domain_names$value | awk '{print $1}'")."</center></td><td><center><input type='submit' name='$value' value='$l_disable'></center></td><td><center><input type='submit' name='$value' value='$l_remove' disabled></center></td></tr>";
|
- |
|
499 |
else
|
- |
|
500 |
echo "<tr><td><center><a href='bl_categories_help.php?liste=bl&cat=$value&ossi=yes&filtre=domain' target='cat_help' onclick=window.open('bl_categories_help','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>".exec("sed 's/^.....//g' <<< $value")."</a></center></td><td><center>".exec("wc -l $upload_dir_ip$value | awk '{print $1}'")."</center></td><td><center>".exec("wc -l $upload_dir_domain_names$value | awk '{print $1}'")."</center></td><td><center><input type='submit' name='$value' value='$l_disable'></center></td><td><center><input type='submit' name='$value' value='$l_remove'></center></td></tr>";
|
458 |
echo "<tr><td><center><a href='bl_categories_help.php?liste=bl&cat=$value&filtre=domain' target='cat_help' onclick=window.open('bl_categories_help','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>".exec("sed 's/^.....//g' <<< $value")."</a></center></td><td><center>".exec("wc -l $dir_ip_enabled$value | awk '{print $1}'")."</center></td><td><center>".exec("wc -l $dir_domain_names_enabled$value | awk '{print $1}'")."</center></td><td><center><input type='submit' name='$value' value='$l_disable'></center></td><td><center><input type='submit' name='$value' value='$l_remove'></center></td></tr>";
|
501 |
|
- |
|
502 |
}
|
459 |
}
|
503 |
//liste des fichiers desactivés
|
- |
|
504 |
$fichiersIp = array_diff(scandir($dir_ip), array('ossi','ossi-ip-safesearch','..','.'));
|
- |
|
505 |
$fichiersIp = preg_grep("/^ossi-/",$fichiersIp);
|
- |
|
506 |
foreach($fichiersIp as $fichier => $value)
|
- |
|
507 |
{
|
- |
|
508 |
if($value=='ossi-tor_node_ip')
|
- |
|
509 |
echo "<tr><td bgcolor='BEBEBE'><center><a href='bl_categories_help.php?liste=bl&cat=$value&ossi=yes&filtre=domain&state=disable' target='cat_help' onclick=window.open('bl_categories_help','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>".exec("sed 's/^.....//g' <<< $value")."</a></center></td><td bgcolor='BEBEBE'><center>".exec("wc -l $dir_ip$value | awk '{print $1}'")."</center></td><td bgcolor='BEBEBE'><center>".exec("wc -l $dir_domain_names$value | awk '{print $1}'")."</center></td><td bgcolor='BEBEBE'><center><input type='submit' name='$value' value='$l_enable'></center></td><td bgcolor='BEBEBE'><center><input type='submit' name='$value' value='$l_remove' disabled></center></td></tr>";
|
- |
|
510 |
else
|
- |
|
511 |
echo "<tr><td bgcolor='BEBEBE'><center><a href='bl_categories_help.php?liste=bl&cat=$value&ossi=yes&filtre=domain&state=disable' target='cat_help' onclick=window.open('bl_categories_help','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>".exec("sed 's/^.....//g' <<< $value")."</a></center></td><td bgcolor='BEBEBE'><center>".exec("wc -l $dir_ip$value | awk '{print $1}'")."</center></td><td bgcolor='BEBEBE'><center>".exec("wc -l $dir_domain_names$value | awk '{print $1}'")."</center></td><td bgcolor='BEBEBE'><center><input type='submit' name='$value' value='$l_enable'></center></td><td bgcolor='BEBEBE'><center><input type='submit' name='$value' value='$l_remove'></center></td></tr>";
|
- |
|
512 |
}
|
- |
|
513 |
|
- |
|
514 |
echo "</table><br/></td></form><form action='bl_filter.php' method='POST' enctype='multipart/form-data'>";
|
460 |
echo "</table><br/></td></form><form action='bl_filter.php' method='POST' enctype='multipart/form-data'>";
|
515 |
echo "<input type='hidden' name='choix' value='MAJ_ip_file_upload'><td width=50% colspan=5 align=center>";
|
461 |
echo "<input type='hidden' name='choix' value='MAJ_ossi_file_upload'><td width=50% colspan=5 align=center>";
|
516 |
echo "<H3>$l_add_file</H3>";
|
462 |
echo "<H3>$l_add_file</H3>";
|
517 |
echo "$l_add_file_explain";
|
463 |
echo "$l_add_file_explain";
|
518 |
echo "<input type='file' name='fichier_ip'>";
|
464 |
echo "<input type='file' name='fichier_ip'>";
|
519 |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';\" value='$l_submit'>";
|
465 |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';\" value='$l_submit'>";
|
520 |
echo "</td></tr>";
|
466 |
echo "</td></tr>";
|