Subversion Repositories ALCASAR

Rev

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

Rev 1854 Rev 1855
Line 42... Line 42...
42
		{
42
		{
43
		if (filesize($filename) != 0)
43
		if (filesize($filename) != 0)
44
			{
44
			{
45
			$pointeur=fopen($filename,"r");
45
			$pointeur=fopen($filename,"r");
46
			$tampon = fread($pointeur, filesize($filename));
46
			$tampon = fread($pointeur, filesize($filename));
-
 
47
			$line = split("\n", $tampon);
-
 
48
			foreach( $line as $x)
-
 
49
			{
-
 
50
				if(isset(split('/',$x)[1]))
-
 
51
				echo split('/',$x)[1]."\n";
-
 
52
			}
47
			fclose($pointeur);
53
			fclose($pointeur);
48
			echo $tampon;
-
 
49
			}
54
			}
50
		}
55
		}
51
	else
56
	else
52
		{
57
		{
53
		echo "$filename doesn't exist";
58
		echo "$filename doesn't exist";
Line 156... Line 161...
156
  $l_safe_searching="Enabling school/parental control for the search engines google."; 
161
  $l_safe_searching="Enabling school/parental control for the search engines google."; 
157
  
162
  
158
}
163
}
159
$dir_etc="/usr/local/etc/";
164
$dir_etc="/usr/local/etc/";
160
$dir_dg="/etc/dansguardian/lists/";
165
$dir_dg="/etc/dansguardian/lists/";
-
 
166
$file_wl_domains="/usr/local/share/dnsmasq-wl/ossi.conf";
161
$file_wl_ip="/usr/local/share/iptables-wl-enabled/ossi";
167
$file_wl_ip="/usr/local/share/iptables-wl-enabled/ossi";
162
$wl_categories=$dir_etc."alcasar-wl-categories";
168
$wl_categories=$dir_etc."alcasar-wl-categories";
163
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
169
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
164
$conf_file=$dir_etc."alcasar.conf";
170
$conf_file=$dir_etc."alcasar.conf";
165
$tinyproxy_conf="/etc/tinyproxy/tinyproxy.conf";
171
$tinyproxy_conf="/etc/tinyproxy/tinyproxy.conf";
Line 209... Line 215...
209
				}
215
				}
210
			}
216
			}
211
		fclose($pointeur);
217
		fclose($pointeur);
212
		}
218
		}
213
	else {echo "$l_error_open_file $wl_categories_enabled";}
219
	else {echo "$l_error_open_file $wl_categories_enabled";}
214
	$fichier=fopen($dir_dg."blacklists/ossi/domains_wl","w+");
220
	$fichier=fopen($file_wl_domains,"w+");
215
	fputs($fichier, form_filter($_POST['OSSI_wl_domains']));
221
	fputs($fichier, form_filter($_POST['OSSI_wl_domains']));
216
	fclose($fichier);
222
	fclose($fichier);
217
	unset($_POST['OSSI_wl_domains']);
223
	unset($_POST['OSSI_wl_domains']);
218
	$fichier=fopen($file_wl_ip, "w+");
224
	$fichier=fopen($file_wl_ip, "w+");
219
	fputs($fichier, form_filter_ip($_POST['OSSI_wl_ip'], "white"));
225
	fputs($fichier, form_filter_ip($_POST['OSSI_wl_ip'], "white"));
Line 322... Line 328...
322
echo "<tr><td valign='middle' align='left' colspan=10>";
328
echo "<tr><td valign='middle' align='left' colspan=10>";
323
echo "<center><b>$l_add_to_wl</b></center></td></tr>";
329
echo "<center><b>$l_add_to_wl</b></center></td></tr>";
324
echo "<tr><td width=50% colspan=5 align=center>";
330
echo "<tr><td width=50% colspan=5 align=center>";
325
echo "<H3>$l_allowed_dns</H3>$l_one_dns<BR>";
331
echo "<H3>$l_allowed_dns</H3>$l_one_dns<BR>";
326
echo "<textarea name='OSSI_wl_domains' rows=3 cols=40>";
332
echo "<textarea name='OSSI_wl_domains' rows=3 cols=40>";
327
echo_file ($dir_dg."blacklists/ossi/domains_wl");
333
echo_file ($file_wl_domains);
328
echo "</textarea></td>";
334
echo "</textarea></td>";
329
echo "<td width=50% colspan=5 align=center>";
335
echo "<td width=50% colspan=5 align=center>";
330
echo "<H3>$l_allowed_ip</H3>$l_forbidden_ip_explain<BR>";
336
echo "<H3>$l_allowed_ip</H3>$l_forbidden_ip_explain<BR>";
331
echo "<textarea name='OSSI_wl_ip' rows=3 cols=40>";
337
echo "<textarea name='OSSI_wl_ip' rows=3 cols=40>";
332
echo_ip_file ($file_wl_ip);
338
echo_ip_file ($file_wl_ip);