Subversion Repositories ALCASAR

Rev

Rev 2521 | Rev 2648 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 2521 Rev 2647
Line 77... Line 77...
77
	$l_specific_filtering="Filtrage special";
77
	$l_specific_filtering="Filtrage special";
78
	$l_add_to_wl="Noms de domaine ou adresses IP à ajouter à la liste blanche";
78
	$l_add_to_wl="Noms de domaine ou adresses IP à ajouter à la liste blanche";
79
	$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";
79
	$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";
80
	$l_record="Enregistrer les modifications";
80
	$l_record="Enregistrer les modifications";
81
	$l_wait="Une fois validées, 10 secondes sont nécessaires pour traiter vos modifications";
81
	$l_wait="Une fois validées, 10 secondes sont nécessaires pour traiter vos modifications";
82
	$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)";
-
 
83
	$l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche google.";
82
	$l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche google.";
84
	$l_safe_youtube="Pour un contrôle parental sur Youtube, suivez les étapes ici : "; 
83
	$l_safe_youtube="Pour un contrôle parental sur Youtube, suivez les étapes ici : ";
85
	$l_youtube_id="(<a href='https://support.google.com/youtube/answer/174084?hl=fr' target='cat_help' onclick=window.open('https://support.google.com/youtube/answer/174084?hl=fr','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>)";
84
	$l_youtube_id="(<a href='https://support.google.com/youtube/answer/174084?hl=fr' target='cat_help' onclick=window.open('https://support.google.com/youtube/answer/174084?hl=fr','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>)";
86
	$l_error_open_file="Erreur d'ouverture du fichier";
85
	$l_error_open_file="Erreur d'ouverture du fichier";
87
	$l_additional_file_title="Fichiers de 'listes blanches' additionnels";
86
	$l_additional_file_title="Fichiers de 'listes blanches' additionnels";
Line 111... Line 110...
111
	$l_allowed_dns="Allowed domain names";
110
	$l_allowed_dns="Allowed domain names";
112
	$l_add_to_wl="Domain names or IP addresses to add to the whitelist";
111
	$l_add_to_wl="Domain names or IP addresses to add to the whitelist";
113
	$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";
112
	$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";
114
	$l_record="Save changes";
113
	$l_record="Save changes";
115
	$l_wait="Once validated, 10 seconds are necessary to compute your modifications";
114
	$l_wait="Once validated, 10 seconds are necessary to compute your modifications";
116
	$l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
-
 
117
	$l_safe_searching="Enabling school/parental control for the search engines google"; 
115
	$l_safe_searching="Enabling school/parental control for the search engines google";
118
	$l_safe_youtube="For a safe Youtube search, follow these steps : "; 
116
	$l_safe_youtube="For a safe Youtube search, follow these steps : ";
119
	$l_youtube_id="(<a href='https://support.google.com/youtube/answer/174084?hl=en' target='cat_help' onclick=window.open('https://support.google.com/youtube/answer/174084?hl=en','cat_help','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes') title='Youtube for school'>link to create a Youtube Id</a>)";
117
	$l_youtube_id="(<a href='https://support.google.com/youtube/answer/174084?hl=en' target='cat_help' onclick=window.open('https://support.google.com/youtube/answer/174084?hl=en','cat_help','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes') title='Youtube for school'>link to create a Youtube Id</a>)";
120
	$l_error_open_file="Error opening file";
118
	$l_error_open_file="Error opening file";
121
	$l_additional_file_title="Additional WhiteList files";
119
	$l_additional_file_title="Additional WhiteList files";
Line 144... Line 142...
144
$dir_wl_domain_names= "/usr/local/share/dnsmasq-wl/";
142
$dir_wl_domain_names= "/usr/local/share/dnsmasq-wl/";
145
$dir_wl_domain_names_enabled= "/usr/local/share/dnsmasq-wl-enabled/";
143
$dir_wl_domain_names_enabled= "/usr/local/share/dnsmasq-wl-enabled/";
146
$wl_categories=$dir_etc."alcasar-wl-categories";
144
$wl_categories=$dir_etc."alcasar-wl-categories";
147
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
145
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
148
$conf_file=$dir_etc."alcasar.conf";
146
$conf_file=$dir_etc."alcasar.conf";
149
$urlregex_file=$dir_dg."urlregexplist";
147
$iptables_safesearch_file=$dir_wl_ip_enabled."ossi-ip-safesearch";
150
$bannedsite_file=$dir_dg."bannedsitelist";
148
$bannedsite_file=$dir_dg."bannedsitelist";
151
$dir_tmp="/tmp/blacklists";
149
$dir_tmp="/tmp/blacklists";
152
 
150
 
153
 
151
 
154
# default values
152
# default values
Line 205... Line 203...
205
	fclose($fichier);
203
	fclose($fichier);
206
	unset($_POST['OSSI_wl']);
204
	unset($_POST['OSSI_wl']);
207
	exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
205
	exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
208
	break;
206
	break;
209
case 'Specific_filtering' :
207
case 'Specific_filtering' :
210
	$pureip="-pureip_off"; $safesearch="-safesearch_off"; ;
208
	$safesearch="-safesearch_off"; ;
211
	foreach ($_POST as $key => $value)
209
	foreach ($_POST as $key => $value)
212
	{
210
	{
213
		if (strstr($key,'chk-ip')) $pureip="-pureip_on";
-
 
214
		if (strstr($key,'chk-safesearch')) $safesearch="-safesearch_on";
211
		if (strstr($key,'chk-safesearch')) $safesearch="-safesearch_on";
215
	}
212
	}
216
	exec ("sudo /usr/local/bin/alcasar-url_filter_bl.sh $safesearch $pureip");
213
	exec ("sudo /usr/local/bin/alcasar-url_filter_wl.sh $safesearch");
217
	break;
214
	break;
218
case 'MAJ_ossi_file' :
215
case 'MAJ_ossi_file' :
219
	foreach($_POST as $fichier => $value)
216
	foreach($_POST as $fichier => $value)
220
	{
217
	{
221
		if($fichier != "choix")
218
		if($fichier != "choix")
Line 355... Line 352...
355
</table>
352
</table>
356
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
353
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
357
<FORM action='wl_filter.php' method='POST'>
354
<FORM action='wl_filter.php' method='POST'>
358
<input type='hidden' name='choix' value='Specific_filtering'>
355
<input type='hidden' name='choix' value='Specific_filtering'>
359
<tr><td>
356
<tr><td>
360
<input type='checkbox' name='chk-ip'
-
 
361
<?php
-
 
362
// verify "pureip" filtering state
-
 
363
if (file_exists($bannedsite_file))
-
 
364
	{
-
 
365
	$pointeur=fopen($bannedsite_file,"r");
-
 
366
	while (!feof ($pointeur))
-
 
367
		{
-
 
368
		$ligne=fgets($pointeur, 4096);
-
 
369
		if ($ligne)
-
 
370
			{
-
 
371
			if (preg_match('/^\*ip$/',$ligne, $r)) 
-
 
372
				{
-
 
373
				echo " checked";
-
 
374
				break;
-
 
375
				}
-
 
376
			}
-
 
377
		}
-
 
378
	fclose($pointeur);
-
 
379
	}
-
 
380
else	{
-
 
381
	echo "$l_error_open_file $bannedsite_file";
-
 
382
	}
-
 
383
echo "> $l_ip_filtering";
-
 
384
?>
-
 
385
</td></tr>
-
 
386
<tr><td>
-
 
387
<input type='checkbox' name='chk-safesearch'
357
<input type='checkbox' name='chk-safesearch'
388
<?php
358
<?php
389
// verify "safesearch" filtering state
359
// verify "safesearch" filtering state
390
if (file_exists($urlregex_file))
360
if (file_exists($iptables_safesearch_file))
391
	{
-
 
392
	$pointeur=fopen($urlregex_file,"r");
-
 
393
	while (!feof ($pointeur))
-
 
394
		{
-
 
395
		$ligne=fgets($pointeur, 4096);
-
 
396
		if ($ligne)
-
 
397
			{
-
 
398
			if (preg_match('/^\"\(\^http\:\/\/\[0\-9a\-z\]\+\\\.google/',$ligne, $r))
-
 
399
				{
361
{
400
				echo " checked";
362
	echo " checked";
401
				break;
-
 
402
				}
-
 
403
			}
-
 
404
		}
-
 
405
	fclose($pointeur);
-
 
406
	}
-
 
407
else	{
-
 
408
	echo "$l_error_open_file $urlregex_file";
-
 
409
	}
363
}
410
echo "> $l_safe_searching";
364
echo "> $l_safe_searching";
411
echo "<br>$l_safe_youtube";
365
echo "<br>$l_safe_youtube";
412
echo " $l_youtube_id<tr><td>";
366
echo " $l_youtube_id<tr><td>";
413
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_record'></td></tr>";
367
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_record'></td></tr>";
414
?>
368
?>
415
</FORM> 
369
</FORM>
416
</TABLE>
370
</TABLE>
417
</BODY>
371
</BODY>
418
</HTML>
372
</HTML>
419
 
-
 
420
 
-