Subversion Repositories ALCASAR

Rev

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

Rev 1878 Rev 1899
Line 123... Line 123...
123
  $l_nbIp="Ip :";
123
	$l_nbIp="Ip :";
124
  $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)";
124
	$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)";
125
  $l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche : google, yahoo, bing, metacrawler et Youtube.";
125
	$l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche : google, yahoo, bing, metacrawler et Youtube.";
126
  $l_safe_youtube="Pour Youtube restreint, suivez les étapes ici pour chaque poste : "; 
126
	$l_safe_youtube="Pour Youtube restreint, suivez les étapes ici pour chaque poste : "; 
127
  $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>)";
127
	$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>)";
-
 
128
	$l_disable="Désactiver";
128
  
129
	$l_enable="Activer";
-
 
130
	$l_file_state="Etat";
129
}
131
}
130
else {
132
else {
131
  $l_wl="WhiteList";
133
	$l_wl="WhiteList";
132
  $l_load="Loading...";
134
	$l_load="Loading...";
133
  $l_list_version="List version : ";
135
	$l_list_version="List version : ";
Line 157... Line 159...
157
  $l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
159
	$l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
158
  $l_specific_filtering="Specific filtering";
160
	$l_specific_filtering="Specific filtering";
159
  $l_safe_youtube="For safe Youtube, follow steps here for each computer "; 
161
	$l_safe_youtube="For safe Youtube, follow steps here for each computer "; 
160
  $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>)";
162
	$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>)";
161
  $l_safe_searching="Enabling school/parental control for the search engines google."; 
163
	$l_safe_searching="Enabling school/parental control for the search engines google."; 
-
 
164
	$l_disable="Disable";
162
  
165
	$l_enable="Enable";
-
 
166
	$l_file_state="State";
163
}
167
}
164
$dir_etc="/usr/local/etc/";
168
$dir_etc="/usr/local/etc/";
165
$dir_dg="/etc/dansguardian/lists/";
169
$dir_dg="/etc/dansguardian/lists/";
166
$file_wl_domains="/usr/local/share/dnsmasq-wl/ossi.conf";
170
$file_wl_domains="/usr/local/share/dnsmasq-wl/ossi.conf";
167
$file_wl_ip="/usr/local/share/iptables-wl-enabled/ossi";
171
$file_wl_ip="/usr/local/share/iptables-wl-enabled/ossi";
Line 171... Line 175...
171
$tinyproxy_conf="/etc/tinyproxy/tinyproxy.conf";
175
$tinyproxy_conf="/etc/tinyproxy/tinyproxy.conf";
172
$dnsmasq_conf="/etc/dnsmasq-whitelist.conf";
176
$dnsmasq_conf="/etc/dnsmasq-whitelist.conf";
173
$dir_tmp="/tmp/";
177
$dir_tmp="/tmp/";
174
$upload_dir_ip = "/usr/local/share/iptables-wl-enabled/";
178
$upload_dir_ip = "/usr/local/share/iptables-wl-enabled/";
175
$upload_dir_domain_names = "/usr/local/share/dnsmasq-wl-enabled/";
179
$upload_dir_domain_names = "/usr/local/share/dnsmasq-wl-enabled/";
-
 
180
$dir_ip = "/usr/local/share/iptables-wl/";
-
 
181
$dir_domain_names = "/usr/local/share/dnsmasq-wl/";
176
# default values
182
# default values
177
if (is_file ($conf_file))
183
if (is_file ($conf_file))
178
	{
184
	{
179
	$tab=file($conf_file);
185
	$tab=file($conf_file);
180
	if ($tab)
186
	if ($tab)
Line 230... Line 236...
230
	case 'MAJ_ip_file_delete' :
236
	case 'MAJ_ip_file_delete' :
231
	foreach($_POST as $fichier => $value)
237
	foreach($_POST as $fichier => $value)
232
	{
238
	{
233
		if($fichier != "choix")
239
		if($fichier != "choix")
234
		{
240
		{
-
 
241
			$action=$_POST[$fichier];
-
 
242
			if($action == $l_remove) //delete
-
 
243
			{
235
			exec("rm -rf $upload_dir_ip$fichier");
244
				exec("rm -rf $upload_dir_ip$fichier");
236
			exec("rm -rf $upload_dir_domain_names$fichier");
245
				exec("rm -rf $upload_dir_domain_names$fichier");
237
			exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
246
				exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
238
		}
247
			}
-
 
248
			if($action == $l_disable) //disable
-
 
249
			{
-
 
250
				exec("mv -f $upload_dir_ip$fichier $dir_ip$fichier");
-
 
251
				exec("mv -f $upload_dir_domain_names$fichier $dir_domain_names$fichier");
-
 
252
				exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
-
 
253
			}
-
 
254
			if($action == $l_enable) //enable
-
 
255
			{
-
 
256
				exec("mv -f $dir_ip$fichier $upload_dir_ip$fichier");
-
 
257
				exec("mv -f $dir_domain_names$fichier $upload_dir_domain_names$fichier");
-
 
258
				exec ("sudo /usr/local/bin/alcasar-bl.sh --reload");
-
 
259
			}
-
 
260
		}
239
	}
261
	}
240
	break;
262
	break;
241
case 'MAJ_ip_file_upload' :
263
case 'MAJ_ip_file_upload' :
242
	$nom = str_replace (".", "_",basename($_FILES['fichier_ip']['name']));
264
	$nom = str_replace (".", "_",basename($_FILES['fichier_ip']['name']));
243
	# Si un fichier a été choisi
265
	# Si un fichier a été choisi
Line 351... Line 373...
351
<form action='wl_filter.php' method='POST'>
373
<form action='wl_filter.php' method='POST'>
352
<input type='hidden' name='choix' value='MAJ_ip_file_delete'>
374
<input type='hidden' name='choix' value='MAJ_ip_file_delete'>
353
<?php
375
<?php
354
echo "<tr><td width=50% colspan=5 align=center>";
376
echo "<tr><td width=50% colspan=5 align=center>";
355
echo "<H3>$l_file_list</H3>";
377
echo "<H3>$l_file_list</H3>";
356
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_remove</tr>";
378
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>";
357
 
379
 
-
 
380
//liste des fichiers activés
358
$fichiersIp = array_diff(scandir($upload_dir_ip), array('ossi','ossi-ip-safesearch','..','.'));
381
$fichiersIp = array_diff(scandir($upload_dir_ip), array('ossi','ossi-ip-safesearch','..','.'));
359
$fichiersIp = preg_grep("/^ossi-/",$fichiersIp);
382
$fichiersIp = preg_grep("/^ossi-/",$fichiersIp);
360
foreach($fichiersIp as $fichier => $value)
383
foreach($fichiersIp as $fichier => $value)
361
{
384
{
362
	echo "<tr><td><center><a href='bl_categories_help.php?liste=wl&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_remove'></center></td></tr>";
385
	echo "<tr><td><center><a href='bl_categories_help.php?liste=wl&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>";
-
 
386
}
-
 
387
//liste des fichiers desactivés
-
 
388
$fichiersIp = array_diff(scandir($dir_ip), array('ossi','ossi-ip-safesearch','..','.'));
-
 
389
$fichiersIp = preg_grep("/^ossi-/",$fichiersIp);
-
 
390
foreach($fichiersIp as $fichier => $value)
-
 
391
{
-
 
392
	echo "<tr><td bgcolor='BEBEBE'><center><a href='bl_categories_help.php?liste=wl&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 $upload_dir_ip$value | awk '{print $1}'")."</center></td><td bgcolor='BEBEBE'><center>".exec("wc -l $upload_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>";
363
}
393
}
-
 
394
 
-
 
395
 
364
echo "</table><br/></td></form><form action='wl_filter.php' method='POST' enctype='multipart/form-data'>";
396
echo "</table><br/></td></form><form action='wl_filter.php' method='POST' enctype='multipart/form-data'>";
365
echo "<input type='hidden' name='choix' value='MAJ_ip_file_upload'><td width=50% colspan=5 align=center>";
397
echo "<input type='hidden' name='choix' value='MAJ_ip_file_upload'><td width=50% colspan=5 align=center>";
366
echo "<H3>$l_add_file</H3>";
398
echo "<H3>$l_add_file</H3>";
367
echo "$l_add_file_explain";
399
echo "$l_add_file_explain";
368
echo "<input type='file' name='fichier_ip'>";
400
echo "<input type='file' name='fichier_ip'>";