Subversion Repositories ALCASAR

Rev

Rev 1041 | Rev 1339 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1041 Rev 1042
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
<HTML><!-- written by Rexy -->
2
<HTML><!-- written by Rexy -->
3
<HEAD>
3
<HEAD>
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
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)
10
function form_filter ($form_content)
11
{
11
{
12
// réencodage iso + format unix + rc fin de ligne (ouf...)
12
// réencodage iso + format unix + rc fin de ligne (ouf...)
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
# Choice of language
18
# Choice of language
19
$Language = 'en';
19
$Language = 'en';
20
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
20
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
21
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
21
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
22
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
22
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
23
if($Language == 'fr'){
23
if($Language == 'fr'){
24
  $l_title1="Filtrage de noms de domaine et d'URL";
24
  $l_title1="Filtrage de noms de domaine et d'URL";
25
  $l_dnsfilter_on="Le filtrage de noms de domaine et d'URL est actuellement activé";
25
  $l_dnsfilter_on="Le filtrage de noms de domaine et d'URL est actuellement activé";
26
  $l_dnsfilter_off="Le filtrage de noms de domaine et d'URL est actuellement désactivé";
26
  $l_dnsfilter_off="Le filtrage de noms de domaine et d'URL est actuellement désactivé";
27
  $l_switch_filtering_on="Activer le filtrage";
27
  $l_switch_filtering_on="Activer le filtrage";
28
  $l_switch_filtering_off="Désactiver le filtrage";
28
  $l_switch_filtering_off="Désactiver le filtrage";
29
  $l_bl="Liste noire";
29
  $l_bl="Liste noire";
30
  $l_wl="Liste blanche";
30
  $l_wl="Liste blanche";
31
  $l_list_version="Version de la liste : ";
31
  $l_list_version="Version de la liste : ";
32
  $l_bl_categories="Sélectionnez les catégories à filtrer";
32
  $l_bl_categories="Sélectionnez les catégories à filtrer";
33
  $l_wl_categories="Sélectionnez les catégories à autoriser";
33
  $l_wl_categories="Sélectionnez les catégories à autoriser";
34
  $l_download_bl="Télécharger la dernière version";
34
  $l_download_bl="Télécharger la dernière version";
35
  $l_fingerprint="L'empreinte numérique du fichier téléchargé est : ";
35
  $l_fingerprint="L'empreinte numérique du fichier téléchargé est : ";
36
  $l_fingerprint2="Vérifiez-là en suivant ce lien (ligne 'blacklists.tar.gz') : ";
36
  $l_fingerprint2="Vérifiez-là en suivant ce lien (ligne 'blacklists.tar.gz') : ";
37
  $l_activate_bl="Activer la nouvelle version";
37
  $l_activate_bl="Activer la nouvelle version";
38
  $l_reject_bl="Rejeter";
38
  $l_reject_bl="Rejeter";
39
  $l_warning="Temps estimé : une minute.";
39
  $l_warning="Temps estimé : une minute.";
40
  $l_specific_filtering="Filtrage special";
40
  $l_specific_filtering="Filtrage special";
41
  $l_forbidden_dns="Noms de domaine filtrés";
41
  $l_forbidden_dns="Noms de domaine filtrés";
42
  $l_forbidden_dns_explain="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
42
  $l_forbidden_dns_explain="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
43
  $l_allowed_dns="Noms de domaine autorisés";
43
  $l_allowed_dns="Noms de domaine autorisés";
44
  $l_one_dns="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
44
  $l_one_dns="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
45
  $l_maj_rehabilitated="Noms de domaine ou URLs réhabilités";
45
  $l_maj_rehabilitated="Noms de domaine ou URLs réhabilités";
46
  $l_rehabilitated_dns="Noms de domaine réhabilités";
46
  $l_rehabilitated_dns="Noms de domaine réhabilités";
47
  $l_rehabilitated_dns_explain="Entrez ici des noms de domaine bloqués par la liste noire <BR> que vous souhaitez réhabiliter.";
47
  $l_rehabilitated_dns_explain="Entrez ici des noms de domaine bloqués par la liste noire <BR> que vous souhaitez réhabiliter.";
48
  $l_add_to_bl="Noms de domaine ou URLs ajoutés à la liste noire";
48
  $l_add_to_bl="Noms de domaine ou URLs ajoutés à la liste noire";
49
  $l_add_to_wl="Noms de domaine ou URLs ajoutés à la liste blanche";
49
  $l_add_to_wl="Noms de domaine ou URLs ajoutés à la liste blanche";
50
  $l_forbidden_url="URL filtrés";
50
  $l_forbidden_url="URL filtrés";
51
  $l_forbidden_url_explain="Entrez une URL par ligne (exemple : www.domaine.org/perso/index.htm)";
51
  $l_forbidden_url_explain="Entrez une URL par ligne (exemple : www.domaine.org/perso/index.htm)";
52
  $l_allowed_url="URL authorisés";
52
  $l_allowed_url="URL authorisés";
53
  $l_rehabilitated_url="URL réhabilités";
53
  $l_rehabilitated_url="URL réhabilités";
54
  $l_rehabilitated_url_explain="Entrez ici des URL bloquées par la liste noire <BR> que vous souhaitez réhabiliter.";
54
  $l_rehabilitated_url_explain="Entrez ici des URL bloquées par la liste noire <BR> que vous souhaitez réhabiliter.";
55
  $l_one_url="Entrez une URL par ligne (exemple : www.domaine.org/perso/index.htm)";
55
  $l_one_url="Entrez une URL par ligne (exemple : www.domaine.org/perso/index.htm)";
56
  $l_record="Enregistrer les modifications";
56
  $l_record="Enregistrer les modifications";
57
  $l_wait="Une fois validées, 30 secondes sont nécessaires pour traiter vos modifications";
57
  $l_wait="Une fois validées, 30 secondes sont nécessaires pour traiter vos modifications";
58
  $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)";
58
  $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)";
59
  $l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche : google, yahoo, bing, metacrawler et Youtube.";
59
  $l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche : google, yahoo, bing, metacrawler et Youtube.";
60
  $l_safe_youtube="Pour Youtube, entrez votre identifiant ici : "; 
60
  $l_safe_youtube="Pour Youtube, entrez votre identifiant ici : "; 
61
  $l_youtube_id="(<a href='http://www.youtube.com/education_signup' target='cat_help' onclick=window.open('http://www.youtube.com/education_signup','cat_help','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes') title='Youtube for school'>lien pour créer un identifiant Youtube (Id)</a>)";
61
  $l_youtube_id="(<a href='http://www.youtube.com/education_signup' target='cat_help' onclick=window.open('http://www.youtube.com/education_signup','cat_help','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes') title='Youtube for school'>lien pour créer un identifiant Youtube (Id)</a>)";
62
}
62
}
63
else {
63
else {
64
  $l_title1="Domain names and URL filtering";
64
  $l_title1="Domain names and URL filtering";
65
  $l_dnsfilter_on="Actually, the Domain name and URL filter is on";
65
  $l_dnsfilter_on="Actually, the Domain name and URL filter is on";
66
  $l_dnsfilter_off="Actually, the Domain name and URL filter is off";
66
  $l_dnsfilter_off="Actually, the Domain name and URL filter is off";
67
  $l_switch_filtering_on="Switch the Filter on";
67
  $l_switch_filtering_on="Switch the Filter on";
68
  $l_switch_filtering_off="Switch the Filter off";
68
  $l_switch_filtering_off="Switch the Filter off";
69
  $l_bl="BlackList";
69
  $l_bl="BlackList";
70
  $l_wl="WhiteList";
70
  $l_wl="WhiteList";
71
  $l_list_version="List version : ";
71
  $l_list_version="List version : ";
72
  $l_bl_categories="Select the categories to filter";
72
  $l_bl_categories="Select the categories to filter";
73
  $l_wl_categories="Select the categories to allow";
73
  $l_wl_categories="Select the categories to allow";
74
  $l_download_bl="Download the last version";
74
  $l_download_bl="Download the last version";
75
  $l_fingerprint="The digital fingerprint of the downloaded blacklist is : ";
75
  $l_fingerprint="The digital fingerprint of the downloaded blacklist is : ";
76
  $l_fingerprint2="Verify it with this link (line 'blacklists.tar.gz') : ";
76
  $l_fingerprint2="Verify it with this link (line 'blacklists.tar.gz') : ";
77
  $l_activate_bl="Activate the new version";
77
  $l_activate_bl="Activate the new version";
78
  $l_reject_bl="Reject";
78
  $l_reject_bl="Reject";
79
  $l_warning="Estimated time : one minute.";
79
  $l_warning="Estimated time : one minute.";
80
  $l_specific_filtering="Specific filtering";
80
  $l_specific_filtering="Specific filtering";
81
  $l_forbidden_dns="Filtered domain names";
81
  $l_forbidden_dns="Filtered domain names";
82
  $l_forbidden_dns_explain="Enter one domain name per row (exemple : .domain.org)";
82
  $l_forbidden_dns_explain="Enter one domain name per row (exemple : .domain.org)";
83
  $l_allowed_dns="Allowed domain names";
83
  $l_allowed_dns="Allowed domain names";
84
  $l_one_dns="Enter one domain name per row (example : .domain.org)";
84
  $l_one_dns="Enter one domain name per row (example : .domain.org)";
85
  $l_maj_rehabilitated="Domain names or URLs rehabilitated";
85
  $l_maj_rehabilitated="Domain names or URLs rehabilitated";
86
  $l_rehabilitated_dns="Rehabilitated domain names";
86
  $l_rehabilitated_dns="Rehabilitated domain names";
87
  $l_rehabilitated_dns_explain="Enter here domain names that are blocked by the blacklist <BR> and you want to rehabilitate.";
87
  $l_rehabilitated_dns_explain="Enter here domain names that are blocked by the blacklist <BR> and you want to rehabilitate.";
88
  $l_add_to_bl="Domain names or URLs to add to blacklist";
88
  $l_add_to_bl="Domain names or URLs to add to blacklist";
89
  $l_add_to_wl="Domain names or URLs to add to whitelist";
89
  $l_add_to_wl="Domain names or URLs to add to whitelist";
90
  $l_forbidden_url="Filtered URL";
90
  $l_forbidden_url="Filtered URL";
91
  $l_forbidden_url_explain="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
91
  $l_forbidden_url_explain="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
92
  $l_allowed_url="Allowed URL";
92
  $l_allowed_url="Allowed URL";
93
  $l_rehabilitated_url="Rehabilitated URL";
93
  $l_rehabilitated_url="Rehabilitated URL";
94
  $l_rehabilitated_url_explain="Enter here URL that are blocked by the blacklist <BR> and you want to rehabilitate.";
94
  $l_rehabilitated_url_explain="Enter here URL that are blocked by the blacklist <BR> and you want to rehabilitate.";
95
  $l_one_url="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
95
  $l_one_url="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
96
  $l_record="Save changes";
96
  $l_record="Save changes";
97
  $l_wait="Once validated, 30 seconds is necessary to compute your modifications";
97
  $l_wait="Once validated, 30 seconds is necessary to compute your modifications";
98
  $l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
98
  $l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
99
  $l_safe_searching="Enabling school/parental control for the search engines google, yahoo, bing, metacrawler and Youtube."; 
99
  $l_safe_searching="Enabling school/parental control for the search engines google, yahoo, bing, metacrawler and Youtube."; 
100
  $l_safe_youtube="For Youtube, enter your ID here : "; 
100
  $l_safe_youtube="For Youtube, enter your ID here : "; 
101
  $l_youtube_id="(<a href='http://www.youtube.com/education_signup' target='cat_help' onclick=window.open('http://www.youtube.com/education_signup','cat_help','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes') title='Youtube for school'>link to create a Youtube Id</a>)";
101
  $l_youtube_id="(<a href='http://www.youtube.com/education_signup' target='cat_help' onclick=window.open('http://www.youtube.com/education_signup','cat_help','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes') title='Youtube for school'>link to create a Youtube Id</a>)";
102
}
102
}
103
$dir_etc="/usr/local/etc/";
103
$dir_etc="/usr/local/etc/";
104
$dir_dg="/etc/dansguardian/lists/";
104
$dir_dg="/etc/dansguardian/lists/";
105
$bl_categories=$dir_etc."alcasar-bl-categories";
105
$bl_categories=$dir_etc."alcasar-bl-categories";
106
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled";
106
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled";
107
$wl_categories=$dir_etc."alcasar-wl-categories";
107
$wl_categories=$dir_etc."alcasar-wl-categories";
108
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
108
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
109
$conf_file=$dir_etc."alcasar.conf";
109
$conf_file=$dir_etc."alcasar.conf";
110
$dir_blacklist=$dir_dg."blacklist/";
110
$dir_blacklist=$dir_dg."blacklist/";
111
$urlregex_file=$dir_dg."urlregexplist";
111
$urlregex_file=$dir_dg."urlregexplist";
112
$bannedsite_file=$dir_dg."bannedsitelist";
112
$bannedsite_file=$dir_dg."bannedsitelist";
113
$dir_tmp="/tmp/blacklists";
113
$dir_tmp="/tmp/blacklists";
114
# default values
114
# default values
115
if (is_file ($conf_file))
115
if (is_file ($conf_file))
116
	{
116
	{
117
	$tab=file($conf_file);
117
	$tab=file($conf_file);
118
	if ($tab)
118
	if ($tab)
119
		{
119
		{
120
		foreach ($tab as $line)
120
		foreach ($tab as $line)
121
			{
121
			{
122
			$field=explode("=", $line);
122
			$field=explode("=", $line);
123
			if ($field[0] == "DNS_FILTERING")	{$DNS_FILTERING=trim($field[1]);}
123
			if ($field[0] == "DNS_FILTERING")	{$DNS_FILTERING=trim($field[1]);}
124
			if ($field[0] == "YOUTUBE_ID")		{$YOUTUBE_ID=trim($field[1]);}
124
			if ($field[0] == "YOUTUBE_ID")		{$YOUTUBE_ID=trim($field[1]);}
125
			}
125
			}
126
		}
126
		}
127
	}
127
	}
128
else { echo "$l_error_open_file $conf_file";}
128
else { echo "$l_error_open_file $conf_file";}
129
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
129
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
130
switch ($choix)
130
switch ($choix)
131
{
131
{
132
case 'BL_On' :
132
case 'BL_On' :
133
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --on");
133
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --on");
134
	$DNS_FILTERING="on";
134
	$DNS_FILTERING="on";
135
	break;
135
	break;
136
case 'BL_Off' :
136
case 'BL_Off' :
137
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --off");
137
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --off");
138
	$DNS_FILTERING="off";
138
	$DNS_FILTERING="off";
139
	break;
139
	break;
140
case 'Download_list' :
140
case 'Download_list' :
141
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --download");
141
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --download");
142
	break;
142
	break;
143
case 'Active_list' :
143
case 'Active_list' :
144
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --adapt");
144
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --adapt");
145
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
145
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
146
	break;
146
	break;
147
case 'Reject_list' :
147
case 'Reject_list' :
148
	unlink ("$dir_tmp/blacklists.tar.gz"); unlink ("$dir_tmp/md5sum");
148
	unlink ("$dir_tmp/blacklists.tar.gz"); unlink ("$dir_tmp/md5sum");
149
	break;
149
	break;
150
case 'MAJ_cat_bl' :
150
case 'MAJ_cat_bl' :
151
	$tab=file($bl_categories_enabled);	
151
	$tab=file($bl_categories_enabled);	
152
	if ($tab)
152
	if ($tab)
153
		{
153
		{
154
		$pointeur=fopen($bl_categories_enabled, "w+");
154
		$pointeur=fopen($bl_categories_enabled, "w+");
155
		foreach ($_POST as $key => $value)
155
		foreach ($_POST as $key => $value)
156
			{
156
			{
157
			if (strstr($key,'chk-'))
157
			if (strstr($key,'chk-'))
158
				{	
158
				{	
159
				$line=str_replace('chk-','',$key)."\n";
159
				$line=str_replace('chk-','',$key)."\n";
160
				fwrite($pointeur,$line);
160
				fwrite($pointeur,$line);
161
				}
161
				}
162
			}
162
			}
163
		fclose($pointeur);
163
		fclose($pointeur);
164
		}
164
		}
165
	else {echo "$l_error_open_file $bl_categories_enabled";}
165
	else {echo "$l_error_open_file $bl_categories_enabled";}
166
	$fichier=fopen($dir_dg."blacklists/ossi/domains","w+");
166
	$fichier=fopen($dir_dg."blacklists/ossi/domains","w+");
167
	fputs($fichier, form_filter($_POST['OSSI_bl_domains']));
167
	fputs($fichier, form_filter($_POST['OSSI_bl_domains']));
168
	fclose($fichier);
168
	fclose($fichier);
169
	unset($_POST['OSSI_bl_domains']);
169
	unset($_POST['OSSI_bl_domains']);
170
	$fichier=fopen($dir_dg."exceptionsitelist","w+");
170
	$fichier=fopen($dir_dg."exceptionsitelist","w+");
171
	fputs($fichier, form_filter($_POST['BL_rehabilited_domains']));
171
	fputs($fichier, form_filter($_POST['BL_rehabilited_domains']));
172
	fclose($fichier);
172
	fclose($fichier);
173
	unset($_POST['BL_rehabilited_domains']);
173
	unset($_POST['BL_rehabilited_domains']);
174
	$fichier=fopen($dir_dg."blacklists/ossi/urls","w+");
174
	$fichier=fopen($dir_dg."blacklists/ossi/urls","w+");
175
	fputs($fichier, form_filter($_POST['OSSI_bl_urls']));
175
	fputs($fichier, form_filter($_POST['OSSI_bl_urls']));
176
	fclose($fichier);
176
	fclose($fichier);
177
	unset($_POST['OSSI_bl_urls']);
177
	unset($_POST['OSSI_bl_urls']);
178
	$fichier=fopen($dir_dg."exceptionurllist","w+");
178
	$fichier=fopen($dir_dg."exceptionurllist","w+");
179
	fputs($fichier, form_filter($_POST['BL_rehabilited_urls']));
179
	fputs($fichier, form_filter($_POST['BL_rehabilited_urls']));
180
	fclose($fichier);
180
	fclose($fichier);
181
	unset($_POST['BL_rehabilited_urls']);
181
	unset($_POST['BL_rehabilited_urls']);
182
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
182
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
183
	break;
183
	break;
184
case 'MAJ_cat_wl' :
184
case 'MAJ_cat_wl' :
185
	$tab=file($wl_categories_enabled);	
185
	$tab=file($wl_categories_enabled);	
186
	if ($tab)
186
	if ($tab)
187
		{
187
		{
188
		$pointeur=fopen($wl_categories_enabled, "w+");
188
		$pointeur=fopen($wl_categories_enabled, "w+");
189
		foreach ($_POST as $key => $value)
189
		foreach ($_POST as $key => $value)
190
			{
190
			{
191
			if (strstr($key,'chk-'))
191
			if (strstr($key,'chk-'))
192
				{	
192
				{	
193
				$line=str_replace('chk-','',$key)."\n";
193
				$line=str_replace('chk-','',$key)."\n";
194
				fwrite($pointeur,$line);
194
				fwrite($pointeur,$line);
195
				}
195
				}
196
			}
196
			}
197
		fclose($pointeur);
197
		fclose($pointeur);
198
		}
198
		}
199
	else {echo "$l_error_open_file $wl_categories_enabled";}
199
	else {echo "$l_error_open_file $wl_categories_enabled";}
200
	$fichier=fopen($dir_dg."blacklists/ossi/domains_wl","w+");
200
	$fichier=fopen($dir_dg."blacklists/ossi/domains_wl","w+");
201
	fputs($fichier, form_filter($_POST['OSSI_wl_domains']));
201
	fputs($fichier, form_filter($_POST['OSSI_wl_domains']));
202
	fclose($fichier);
202
	fclose($fichier);
203
	unset($_POST['OSSI_wl_domains']);
203
	unset($_POST['OSSI_wl_domains']);
204
	$fichier=fopen($dir_dg."blacklists/ossi/urls_wl","w+");
204
	$fichier=fopen($dir_dg."blacklists/ossi/urls_wl","w+");
205
	fputs($fichier, form_filter($_POST['OSSI_wl_urls']));
205
	fputs($fichier, form_filter($_POST['OSSI_wl_urls']));
206
	fclose($fichier);
206
	fclose($fichier);
207
	unset($_POST['OSSI_wl_urls']);
207
	unset($_POST['OSSI_wl_urls']);
-
 
208
	exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
208
	break;
209
	break;
209
case 'Specific_filtering' :
210
case 'Specific_filtering' :
210
	$pureip="-pureip_off"; $safesearch="-safesearch_off"; ;
211
	$pureip="-pureip_off"; $safesearch="-safesearch_off"; ;
211
	foreach ($_POST as $key => $value)
212
	foreach ($_POST as $key => $value)
212
	{
213
	{
213
		if (strstr($key,'chk-ip')) $pureip="-pureip_on";
214
		if (strstr($key,'chk-ip')) $pureip="-pureip_on";
214
		if (strstr($key,'chk-safesearch')) $safesearch="-safesearch_on";
215
		if (strstr($key,'chk-safesearch')) $safesearch="-safesearch_on";
215
	}
216
	}
216
	if ($_POST['Youtube_ID'] == '') { $New_ID="ABCD1234567890abcdef";} // default ID (no action) 
217
	if ($_POST['Youtube_ID'] == '') { $New_ID="ABCD1234567890abcdef";} // default ID (no action) 
217
	else {$New_ID=$_POST['Youtube_ID'];}
218
	else {$New_ID=$_POST['Youtube_ID'];}
218
	file_put_contents($conf_file, str_replace("YOUTUBE_ID=$YOUTUBE_ID", "YOUTUBE_ID=$New_ID", file_get_contents($conf_file)));
219
	file_put_contents($conf_file, str_replace("YOUTUBE_ID=$YOUTUBE_ID", "YOUTUBE_ID=$New_ID", file_get_contents($conf_file)));
219
	$YOUTUBE_ID=$New_ID;
220
	$YOUTUBE_ID=$New_ID;
220
	exec ("sudo /usr/local/sbin/alcasar-url_filter.sh $safesearch $pureip");
221
	exec ("sudo /usr/local/sbin/alcasar-url_filter.sh $safesearch $pureip");
221
       	break;
222
       	break;
222
}
223
}
223
?>
224
?>
224
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
225
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
225
<tr><th><?php echo "$l_title1"; ?></th></tr>
226
<tr><th><?php echo "$l_title1"; ?></th></tr>
226
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
227
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
227
</TABLE>
228
</TABLE>
228
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
229
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
229
	<tr><td valign="middle" align="left">
230
	<tr><td valign="middle" align="left">
230
<?php
231
<?php
231
if ($DNS_FILTERING == "on")
232
if ($DNS_FILTERING == "on")
232
	{
233
	{
233
	echo "<CENTER><H3>$l_dnsfilter_on</H3></CENTER>";
234
	echo "<CENTER><H3>$l_dnsfilter_on</H3></CENTER>";
234
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
235
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
235
	echo "<input type=hidden name='choix' value=\"BL_Off\">";
236
	echo "<input type=hidden name='choix' value=\"BL_Off\">";
236
	echo "<input type=submit value=\"$l_switch_filtering_off\">";
237
	echo "<input type=submit value=\"$l_switch_filtering_off\">";
237
}
238
}
238
else
239
else
239
	{
240
	{
240
	echo "<CENTER><H3>$l_dnsfilter_off</H3></CENTER>";
241
	echo "<CENTER><H3>$l_dnsfilter_off</H3></CENTER>";
241
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
242
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
242
	echo "<input type=hidden name='choix' value=\"BL_On\">";
243
	echo "<input type=hidden name='choix' value=\"BL_On\">";
243
	echo "<input type=submit value=\"$l_switch_filtering_on\">";
244
	echo "<input type=submit value=\"$l_switch_filtering_on\">";
244
	}
245
	}
245
echo "</FORM>";
246
echo "</FORM>";
246
echo "</td></tr>";
247
echo "</td></tr>";
247
echo "</TABLE>";
248
echo "</TABLE>";
248
if ($DNS_FILTERING == "on") require ('bl_filter2.php');
249
if ($DNS_FILTERING == "on") require ('bl_filter2.php');
249
?>
250
?>
250
</BODY>
251
</BODY>
251
</HTML>
252
</HTML>
252
 
253