Subversion Repositories ALCASAR

Rev

Rev 441 | Rev 470 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 441 Rev 449
Line 5... Line 5...
5
<TITLE>ALCASAR DNS filtering</TITLE>
5
<TITLE>ALCASAR DNS filtering</TITLE>
6
<link rel="stylesheet" href="/css/style.css" type="text/css">
6
<link rel="stylesheet" href="/css/style.css" type="text/css">
7
</HEAD>
7
</HEAD>
8
<body>
8
<body>
9
<?
9
<?
-
 
10
function form_filter ($form_content)
-
 
11
{
-
 
12
// réencodage iso + format unix + rc fin de ligne (ouf...)
-
 
13
	$list = str_replace("\r\n", "\n", utf8_decode($form_content));
-
 
14
	if (strlen($list) != 0){
-
 
15
		if ($list[strlen($list)-1] != "\n") { $list[strlen($list)]="\n";} ;} ;
-
 
16
	return $list;
-
 
17
}
-
 
18
 
10
$bl_categories="/usr/local/etc/alcasar-bl-categories";
19
$bl_categories="/usr/local/etc/alcasar-bl-categories";
11
$bl_categories_enabled="/usr/local/etc/alcasar-bl-categories-enabled";
20
$bl_categories_enabled="/usr/local/etc/alcasar-bl-categories-enabled";
12
$dir_blacklist="/etc/dansguardian/lists/blacklist/";
21
$dir_blacklist="/etc/dansguardian/lists/blacklist/";
13
# Choice of language
22
# Choice of language
14
$Language = 'en';
23
$Language = 'en';
Line 37... Line 46...
37
  $l_forbidden_url_explain="Entrez une URL par ligne (exemple : www.domaine.org/perso.index.htm)";
46
  $l_forbidden_url_explain="Entrez une URL par ligne (exemple : www.domaine.org/perso.index.htm)";
38
  $l_rehabilitated_url="URL réhabilités";
47
  $l_rehabilitated_url="URL réhabilités";
39
  $l_rehabilitated_url_explain="Entrez ici des URL bloquées par la liste noire principale <BR> que vous désirez réhabiliter.";
48
  $l_rehabilitated_url_explain="Entrez ici des URL bloquées par la liste noire principale <BR> que vous désirez réhabiliter.";
40
  $l_one_url="Entrez une URL par ligne (exemple : www.domaine.org/perso.index.htm)";
49
  $l_one_url="Entrez une URL par ligne (exemple : www.domaine.org/perso.index.htm)";
41
  $l_record="Enregistrer les modifications";
50
  $l_record="Enregistrer les modifications";
42
  $l_wait="cette modification dure environ 30\":w";
51
  $l_wait="cette modification dure environ 30 secondes";
43
}
52
}
44
else {
53
else {
45
  $l_title1 = "Domain names and URL filtering";
54
  $l_title1 = "Domain names and URL filtering";
46
  $l_error_open_file="Error opening the file";
55
  $l_error_open_file="Error opening the file";
47
  $l_dnsfilter_on="Actually, the Domain name and URL filter is on";
56
  $l_dnsfilter_on="Actually, the Domain name and URL filter is on";
Line 63... Line 72...
63
  $l_forbidden_url_explain="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
72
  $l_forbidden_url_explain="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
64
  $l_rehabilitated_url="Rehabilitated URL";
73
  $l_rehabilitated_url="Rehabilitated URL";
65
  $l_rehabilitated_url_explain="Enter here URL that are blocked by the main blacklist <BR> and which you want to rehabilitate.";
74
  $l_rehabilitated_url_explain="Enter here URL that are blocked by the main blacklist <BR> and which you want to rehabilitate.";
66
  $l_one_url="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
75
  $l_one_url="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
67
  $l_record="Save changes";
76
  $l_record="Save changes";
68
  $l_wait="these changes take about 30\"";
77
  $l_wait="these changes take about 30 seconds";
69
}
78
}
70
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
79
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
71
switch ($choix)
80
switch ($choix)
72
{
81
{
73
case 'BL_On' :
82
case 'BL_On' :
Line 98... Line 107...
98
	else {echo "$l_error_open_file $bl_categories_enabled";}
107
	else {echo "$l_error_open_file $bl_categories_enabled";}
99
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
108
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
100
	break;
109
	break;
101
case 'MAJ_OSSI' :
110
case 'MAJ_OSSI' :
102
	$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/domains","w+");
111
	$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/domains","w+");
103
	fputs($fichier, $_POST['OSSI_bl_domains']);
112
	fputs($fichier, form_filter($_POST['OSSI_bl_domains']));
104
	fclose($fichier);
113
	fclose($fichier);
105
	unset($_POST['OSSI_bl_domains']);
114
	unset($_POST['OSSI_bl_domains']);
106
	$fichier=fopen("/etc/dansguardian/lists/exceptionsitelist","w+");
115
	$fichier=fopen("/etc/dansguardian/lists/exceptionsitelist","w+");
107
	fputs($fichier, $_POST['OSSI_wl_domains']);
116
	fputs($fichier, form_filter($_POST['OSSI_wl_domains']));
108
	fclose($fichier);
117
	fclose($fichier);
109
	unset($_POST['OSSI_wl_domains']);
118
	unset($_POST['OSSI_wl_domains']);
110
	$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/urls","w+");
119
	$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/urls","w+");
111
	fputs($fichier, $_POST['OSSI_bl_urls']);
120
	fputs($fichier, form_filter($_POST['OSSI_bl_urls']));
112
	fclose($fichier);
121
	fclose($fichier);
113
	unset($_POST['OSSI_bl_urls']);
122
	unset($_POST['OSSI_bl_urls']);
114
	$fichier=fopen("/etc/dansguardian/lists/exceptionurllist","w+");
123
	$fichier=fopen("/etc/dansguardian/lists/exceptionurllist","w+");
115
	fputs($fichier, $_POST['OSSI_wl_urls']);
124
	fputs($fichier, form_filter($_POST['OSSI_wl_urls']));
116
	fclose($fichier);
125
	fclose($fichier);
117
	unset($_POST['OSSI_wl_urls']);
126
	unset($_POST['OSSI_wl_urls']);
118
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
127
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
119
	break;
128
	break;
120
}
129
}