Subversion Repositories ALCASAR

Rev

Rev 1390 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1390 Rev 1416
1
<?php
1
<?php
2
function echo_file ($filename)
2
function echo_file ($filename)
3
	{
3
	{
4
	if (file_exists($filename))
4
	if (file_exists($filename))
5
		{
5
		{
6
		if (filesize($filename) != 0)
6
		if (filesize($filename) != 0)
7
			{
7
			{
8
			$pointeur=fopen($filename,"r");
8
			$pointeur=fopen($filename,"r");
9
			$tampon = fread($pointeur, filesize($filename));
9
			$tampon = fread($pointeur, filesize($filename));
10
			fclose($pointeur);
10
			fclose($pointeur);
11
			echo $tampon;
11
			echo $tampon;
12
			}
12
			}
13
		}
13
		}
14
	else
14
	else
15
		{
15
		{
16
		echo "$filename doesn't exist";
16
		echo "$filename doesn't exist";
17
		}
17
		}
18
	}
18
	}
19
function echo_ip_file ($filename)
19
function echo_ip_file ($filename)
20
{
20
{
21
	exec("cat $filename | cut -d ' ' -f3", $resultat);
21
	exec("cat $filename | cut -d ' ' -f3", $resultat);
22
	for($i=0; $i<exec("wc -l $filename"); $i++)
22
	for($i=0; $i<exec("wc -l $filename"); $i++)
23
	{
23
	{
24
		echo $resultat[$i]."\n";
24
		echo $resultat[$i]."\n";
25
	}
25
	}
26
}
26
}
27
?>
27
?>
28
<table width="100%" border="0" cellspacing="0" cellpadding="0">
28
<table width="100%" border="0" cellspacing="0" cellpadding="0">
29
	<tr><th>
29
	<tr><th>
30
	<?php echo $l_list_version; echo date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README'));?>
30
	<?php echo $l_list_version; echo date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README'));?>
31
	</th></tr>
31
	</th></tr>
32
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
32
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
33
</table>
33
</table>
34
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
34
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
35
<tr><td valign="middle" align="left" colspan=10>
35
<tr><td valign="middle" align="left" colspan=10>
36
<FORM action='bl_filter.php' method=POST>
36
<FORM action='bl_filter.php' method=POST>
37
<?php
37
<?php
38
if ((file_exists("$dir_tmp/blacklists.tar.gz")) && (file_exists("$dir_tmp/md5sum")))
38
if ((file_exists("$dir_tmp/blacklists.tar.gz")) && (file_exists("$dir_tmp/md5sum")))
39
	{
39
	{
40
	echo "$l_fingerprint"; echo_file ("$dir_tmp/md5sum");
40
	echo "$l_fingerprint"; echo_file ("$dir_tmp/md5sum");
41
	echo "<br>$l_fingerprint2<a href='http://dsi.ut-capitole.fr/blacklists/download/MD5SUM.LST' target='cat_help' onclick=window.open('http://dsi.ut-capitole.fr/blacklists/download/MD5SUM.LST','cat_help','width=600,height=150,toolbar=no,scrollbars=yes,resizable=yes') title='verify fingerprint'>dsi.ut-capitole.fr/blacklists/download/MD5SUM.LST</a><br>";
41
	echo "<br>$l_fingerprint2<a href='http://dsi.ut-capitole.fr/blacklists/download/MD5SUM.LST' target='cat_help' onclick=window.open('http://dsi.ut-capitole.fr/blacklists/download/MD5SUM.LST','cat_help','width=600,height=150,toolbar=no,scrollbars=yes,resizable=yes') title='verify fingerprint'>dsi.ut-capitole.fr/blacklists/download/MD5SUM.LST</a><br>";
42
	echo "<input type='hidden' name='choix' value='Active_list'>";
42
	echo "<input type='hidden' name='choix' value='Active_list'>";
43
	echo "<input type='submit' value='$l_activate_bl'> ($l_warning)</FORM>";
43
	echo "<input type='submit' value='$l_activate_bl'> ($l_warning)</FORM>";
44
	echo "<FORM action='bl_filter.php' method=POST>";
44
	echo "<FORM action='bl_filter.php' method=POST>";
45
	echo "<input type='hidden' name='choix' value='Reject_list'>";
45
	echo "<input type='hidden' name='choix' value='Reject_list'>";
46
	echo "<input type='submit' value='$l_reject_bl'></form>";
46
	echo "<input type='submit' value='$l_reject_bl'></form>";
47
	}
47
	}
48
else
48
else
49
	{
49
	{
50
	echo "<input type='hidden' name='choix' value='Download_list'>";
50
	echo "<input type='hidden' name='choix' value='Download_list'>";
51
	echo "<input type='submit' value='$l_download_bl'>";
51
	echo "<input type='submit' value='$l_download_bl'>";
52
	echo " ($l_warning)";
52
	echo " ($l_warning)";
53
	}
53
	}
54
?>
54
?>
55
</FORM>
55
</FORM>
56
</td></tr>
56
</td></tr>
57
</table><br/>
57
</table><br/>
58
<table width="100%" border="0" cellspacing="0" cellpadding="0">
58
<table width="100%" border="0" cellspacing="0" cellpadding="0">
59
	<tr><th><?php echo $l_bl; ?></th></tr>
59
	<tr><th><?php echo $l_bl; ?></th></tr>
60
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
60
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
61
</table>
61
</table>
62
<table width="100%" border=1 cellspacing=0 cellpadding=1>
62
<table width="100%" border=1 cellspacing=0 cellpadding=1>
63
<tr><td valign="middle" align="left" colspan=10>
63
<tr><td valign="middle" align="left" colspan=10>
64
<FORM action='bl_filter.php' method=POST>
64
<FORM action='bl_filter.php' method=POST>
65
<input type='hidden' name='choix' value='MAJ_cat_bl'>
65
<input type='hidden' name='choix' value='MAJ_cat_bl'>
66
<?php
66
<?php
67
echo "<center>";
67
echo "<center>";
68
$nbDomainNames = exec ("wc -l /usr/local/share/dnsmasq-bl/* | tail -n 1 | awk '{print $1}'");
68
$nbDomainNames = exec ("wc -l /usr/local/share/dnsmasq-bl/* | tail -n 1 | awk '{print $1}'");
69
$nbUrl = exec ("for file in `find /etc/dansguardian/lists/blacklists/ -name 'urls'`; do nb=$((nb+$(wc -l \$file | awk '{print $1}'))); done; echo \$nb");
69
$nbUrl = exec ("for file in `find /etc/dansguardian/lists/blacklists/ -name 'urls'`; do nb=$((nb+$(wc -l \$file | awk '{print $1}'))); done; echo \$nb");
70
$nbIp = exec ("wc -l /usr/local/share/iptables-bl/* | tail -n 1 | awk '{print $1}'");
70
$nbIp = exec ("wc -l /usr/local/share/iptables-bl/* | tail -n 1 | awk '{print $1}'");
71
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>";
71
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>";
72
echo "$l_bl_categories</center></td></tr>";	
72
echo "$l_bl_categories</center></td></tr>";	
73
//on lit et on interprete le fichier de catégories
73
//on lit et on interprete le fichier de catégories
74
$cols=1; 
74
$cols=1; 
75
if (file_exists($bl_categories))
75
if (file_exists($bl_categories))
76
	{
76
	{
77
	$pointeur=fopen($bl_categories,"r");
77
	$pointeur=fopen($bl_categories,"r");
78
	while (!feof ($pointeur))
78
	while (!feof ($pointeur))
79
		{
79
		{
80
		$ligne=fgets($pointeur, 4096);
80
		$ligne=fgets($pointeur, 4096);
81
		if ($ligne)
81
		if ($ligne)
82
			{
82
			{
83
			if ($cols == 1) { echo "<tr>";}
83
			if ($cols == 1) { echo "<tr>";}
84
				$categorie=trim(basename($ligne));
84
				$categorie=trim(basename($ligne));
85
			if($categorie != "ossi")
85
			if($categorie != "ossi")
86
			{
86
			{
87
				echo "<td><a href='bl_categories_help.php?liste=bl&cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>$categorie</a><br>";
87
				echo "<td><a href='bl_categories_help.php?liste=bl&cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>$categorie</a><br>";
88
				echo "<input type='checkbox' name='chk-$categorie'";
88
				echo "<input type='checkbox' name='chk-$categorie'";
89
				// si la ligne est commentée -> categorie non selectionnée
89
				// si la ligne est commentée -> categorie non selectionnée
90
				if (preg_match('/^#/',$ligne, $r)) { echo ">";}
90
				if (preg_match('/^#/',$ligne, $r)) { echo ">";}
91
				else { echo "checked>"; }
91
				else { echo "checked>"; }
92
				echo "</td>";
92
				echo "</td>";
93
				$cols++;
93
				$cols++;
94
			}
94
			}
95
			if ($cols > 10) {
95
			if ($cols > 10) {
96
				echo "</tr>";
96
				echo "</tr>";
97
				$cols=1; }
97
				$cols=1; }
98
			}
98
			}
99
		}
99
		}
100
	fclose($pointeur);
100
	fclose($pointeur);
101
	}
101
	}
102
else	{
102
else	{
103
	echo "$l_error_open_file $bl_categories";
103
	echo "$l_error_open_file $bl_categories";
104
	}
104
	}
105
echo "</td></tr>";
105
echo "</td></tr>";
106
echo "<tr><td valign='middle' align='left' colspan=10>";
106
echo "<tr><td valign='middle' align='left' colspan=10>";
107
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
107
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
108
echo "<tr><td width=50% colspan=5 align=center>";
108
echo "<tr><td width=50% colspan=5 align=center>";
109
echo "<H3>$l_rehabilitated_dns</H3>$l_rehabilitated_dns_explain<BR>$l_one_dns<BR>";
109
echo "<H3>$l_rehabilitated_dns</H3>$l_rehabilitated_dns_explain<BR>$l_one_dns<BR>";
110
echo "<textarea name='BL_rehabilited_domains' rows=3 cols=40>";
110
echo "<textarea name='BL_rehabilited_domains' rows=3 cols=40>";
111
echo_file ($dir_dg."exceptionsitelist");
111
echo_file ($dir_dg."exceptionsitelist");
112
echo "</textarea></td>";
112
echo "</textarea></td>";
113
echo "<td width=50% colspan=5 align=center>";
113
echo "<td width=50% colspan=5 align=center>";
114
echo "<H3>$l_rehabilitated_ip</H3>$l_rehabilitated_ip_explain<BR>$l_one_ip<BR>";
114
echo "<H3>$l_rehabilitated_ip</H3>$l_rehabilitated_ip_explain<BR>$l_one_ip<BR>";
115
echo "<textarea name='BL_rehabilited_ip' rows=3 cols=40>";
115
echo "<textarea name='BL_rehabilited_ip' rows=3 cols=40>";
116
echo_file ($dir_dg."exceptioniplist");
116
echo_file ($dir_dg."exceptioniplist");
117
echo "</textarea></td></tr><tr><td width=50% colspan=10>";
117
echo "</textarea></td></tr><tr><td width=50% colspan=10>";
118
echo "<tr><td valign='middle' align='left' colspan=10>";
118
echo "<tr><td valign='middle' align='left' colspan=10>";
119
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
119
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
120
echo "<tr><td width=50% colspan=5 align=center>";
120
echo "<tr><td width=50% colspan=5 align=center>";
121
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
121
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
122
echo "<textarea name='OSSI_bl_domains' rows=3 cols=40>";
122
echo "<textarea name='OSSI_bl_domains' rows=3 cols=40>";
123
echo_file ($dir_dg."blacklists/ossi/domains");
123
echo_file ($dir_dg."blacklists/ossi/domains");
124
echo "</textarea></td>";
124
echo "</textarea></td>";
125
echo "<td width=50% colspan=5 align=center>";
125
echo "<td width=50% colspan=5 align=center>";
126
echo "<H3>$l_forbidden_ip</H3>$l_forbidden_ip_explain<BR>";
126
echo "<H3>$l_forbidden_ip</H3>$l_forbidden_ip_explain<BR>";
127
echo "<textarea name='OSSI_bl_ip' rows=3 cols=40>";
127
echo "<textarea name='OSSI_bl_ip' rows=3 cols=40>";
128
echo_ip_file ($dir_bl_ip."ossi");
128
echo_ip_file ($dir_bl_ip."ossi");
129
echo "</textarea></td></tr><tr><td colspan=10>";
129
echo "</textarea></td></tr><tr><td colspan=10>";
130
echo "<input type='submit' value='$l_record'>";
130
echo "<input type='submit' value='$l_record'>";
131
echo "</form> ($l_wait)";
131
echo "</form> ($l_wait)";
132
echo "</table></td><br/>";
132
echo "</table></td><br/>";
133
?>
133
?>
134
<table width="100%" border="0" cellspacing="0" cellpadding="0">
134
<table width="100%" border="0" cellspacing="0" cellpadding="0">
135
	<tr><th><?php echo $l_ip_file_title; ?></th></tr>
135
	<tr><th><?php echo $l_personal_file_title; ?></th></tr>
136
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
136
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
137
</table>
137
</table>
138
<table width="100%" border=1 cellspacing=0 cellpadding=1>
138
<table width="100%" border=1 cellspacing=0 cellpadding=1>
139
<form action='bl_filter.php' method='POST'>
139
<form action='bl_filter.php' method='POST'>
140
<input type='hidden' name='choix' value='MAJ_ip_file_delete'>
140
<input type='hidden' name='choix' value='MAJ_ip_file_delete'>
141
<?php
141
<?php
142
echo "<tr><td width=50% colspan=5 align=center>";
142
echo "<tr><td width=50% colspan=5 align=center>";
143
echo "<H3>$l_file_list</H3>";
143
echo "<H3>$l_file_list</H3>";
144
echo "<table cellspacing=2 cellpadding=3 border=1><tr><th>$l_file_name<th>$l_nb_ip<th>$l_file_remove</tr>";
144
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>";
145
exec("cd $upload_dir && ls ossi-*", $fichiersIp);
145
exec("cd $upload_dir_ip && ls ossi-*", $fichiersIp);
146
foreach($fichiersIp as $fichier => $value)
146
foreach($fichiersIp as $fichier => $value)
147
{
147
{
148
	echo "<tr><td><center>".exec("sed 's/^.....//g' <<< $value")."</center></td><td><center>".exec("wc -l $upload_dir$value | awk '{print $1}'")."</center></td><td><center><input type='submit' name='$value' value='$l_remove'></center></td></tr>";
148
	echo "<tr><td><center>".exec("sed 's/^.....//g' <<< $value")."</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>";
149
}
149
}
150
echo "</table><br/></td></form><form action='bl_filter.php' method='POST' enctype='multipart/form-data'>";
150
echo "</table><br/></td></form><form action='bl_filter.php' method='POST' enctype='multipart/form-data'>";
151
echo "<input type='hidden' name='choix' value='MAJ_ip_file_upload'><td width=50% colspan=5 align=center>";
151
echo "<input type='hidden' name='choix' value='MAJ_ip_file_upload'><td width=50% colspan=5 align=center>";
152
echo "<H3>$l_add_ip_file</H3>";
152
echo "<H3>$l_add_file</H3>";
153
echo "<input type='file' name='fichier_ip'>";
153
echo "<input type='file' name='fichier_ip'>";
154
echo "<input type='submit' value='$l_submit'>";
154
echo "<input type='submit' value='$l_submit'>";
155
echo "</td></tr>";
155
echo "</td></tr>";
156
echo "</form>";
156
echo "</form>";
157
echo "</table><br/>";
157
echo "</table><br/>";
158
?>
158
?>
159
<table width="100%" border="0" cellspacing="0" cellpadding="0">
159
<table width="100%" border="0" cellspacing="0" cellpadding="0">
160
	<tr><th><?php echo $l_wl; ?></th></tr>
160
	<tr><th><?php echo $l_wl; ?></th></tr>
161
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
161
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
162
</table>
162
</table>
163
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
163
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
164
<tr><td valign="middle" align="left" colspan=10>
164
<tr><td valign="middle" align="left" colspan=10>
165
<FORM action='bl_filter.php' method=POST>
165
<FORM action='bl_filter.php' method=POST>
166
<input type='hidden' name='choix' value='MAJ_cat_wl'>
166
<input type='hidden' name='choix' value='MAJ_cat_wl'>
167
<?php
167
<?php
168
echo "<center>";
168
echo "<center>";
169
$nbDomainNames = exec ("wc -l /usr/local/share/dnsmasq-wl/* | tail -n 1 | awk '{print $1}'");
169
$nbDomainNames = exec ("wc -l /usr/local/share/dnsmasq-wl/* | tail -n 1 | awk '{print $1}'");
170
$nbUrl = 0;
170
$nbUrl = 0;
171
$nbIp = 0;
171
$nbIp = 0;
172
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>";
172
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>";
173
echo "$l_wl_categories</center></td></tr>";
173
echo "$l_wl_categories</center></td></tr>";
174
//on lit et on interprete le fichier de catégories
174
//on lit et on interprete le fichier de catégories
175
$cols=1; 
175
$cols=1; 
176
if (file_exists($wl_categories))
176
if (file_exists($wl_categories))
177
	{
177
	{
178
	$pointeur=fopen($wl_categories,"r");
178
	$pointeur=fopen($wl_categories,"r");
179
	while (!feof ($pointeur))
179
	while (!feof ($pointeur))
180
		{
180
		{
181
		$ligne=fgets($pointeur, 4096);
181
		$ligne=fgets($pointeur, 4096);
182
		if ($ligne)
182
		if ($ligne)
183
			{
183
			{
184
			if ($cols == 1) { echo "<tr>";}
184
			if ($cols == 1) { echo "<tr>";}
185
			$categorie=trim(basename($ligne));
185
			$categorie=trim(basename($ligne));
186
			echo "<td><a href='bl_categories_help.php?liste=wl&cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>$categorie</a><br>";
186
			echo "<td><a href='bl_categories_help.php?liste=wl&cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=450,toolbar=no,scrollbars=yes,resizable=yes') title='categories help page'>$categorie</a><br>";
187
			echo "<input type='checkbox' name='chk-$categorie'";
187
			echo "<input type='checkbox' name='chk-$categorie'";
188
			// si la ligne est commentée -> categorie non selectionnée
188
			// si la ligne est commentée -> categorie non selectionnée
189
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
189
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
190
			else { echo "checked>"; }
190
			else { echo "checked>"; }
191
			echo "</td>";
191
			echo "</td>";
192
			$cols++;
192
			$cols++;
193
			if ($cols > 10) {
193
			if ($cols > 10) {
194
				echo "</tr>";
194
				echo "</tr>";
195
				$cols=1; }
195
				$cols=1; }
196
			}
196
			}
197
		}
197
		}
198
	fclose($pointeur);
198
	fclose($pointeur);
199
	}
199
	}
200
else	{
200
else	{
201
	echo "$l_error_open_file $wl_categories";
201
	echo "$l_error_open_file $wl_categories";
202
	}
202
	}
203
echo "<tr><td valign='middle' align='left' colspan=10>";
203
echo "<tr><td valign='middle' align='left' colspan=10>";
204
echo "<center><b>$l_add_to_wl</b></center></td></tr>";
204
echo "<center><b>$l_add_to_wl</b></center></td></tr>";
205
echo "<tr><td width=50% colspan=5 align=center>";
205
echo "<tr><td width=50% colspan=5 align=center>";
206
echo "<H3>$l_allowed_dns</H3>$l_forbidden_dns_explain<BR>";
206
echo "<H3>$l_allowed_dns</H3>$l_forbidden_dns_explain<BR>";
207
echo "<textarea name='OSSI_wl_domains' rows=3 cols=40>";
207
echo "<textarea name='OSSI_wl_domains' rows=3 cols=40>";
208
echo_file ($dir_dg."blacklists/ossi/domains_wl");
208
echo_file ($dir_dg."blacklists/ossi/domains_wl");
209
echo "</textarea></td>";
209
echo "</textarea></td>";
210
echo "<td width=50% colspan=5 align=center>";
210
echo "<td width=50% colspan=5 align=center>";
211
echo "<H3>$l_allowed_ip</H3>$l_forbidden_ip_explain<BR>";
211
echo "<H3>$l_allowed_ip</H3>$l_forbidden_ip_explain<BR>";
212
echo "<textarea name='OSSI_wl_ip' rows=3 cols=40>";
212
echo "<textarea name='OSSI_wl_ip' rows=3 cols=40>";
213
echo_ip_file ($file_wl_ip);
213
echo_ip_file ($file_wl_ip);
214
echo "</textarea></td></tr><tr><td colspan=10>";
214
echo "</textarea></td></tr><tr><td colspan=10>";
215
echo "<input type='submit' value='$l_record'></form></td></tr>";
215
echo "<input type='submit' value='$l_record'></form></td></tr>";
216
?>
216
?>
217
</TABLE><br/>
217
</TABLE><br/>
218
<table width="100%" border="0" cellspacing="0" cellpadding="0">
218
<table width="100%" border="0" cellspacing="0" cellpadding="0">
219
	<tr><th><?php echo $l_specific_filtering; ?></th></tr>
219
	<tr><th><?php echo $l_specific_filtering; ?></th></tr>
220
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
220
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
221
</table>
221
</table>
222
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
222
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
223
<FORM action='bl_filter.php' method='POST'>
223
<FORM action='bl_filter.php' method='POST'>
224
<input type='hidden' name='choix' value='Specific_filtering'>
224
<input type='hidden' name='choix' value='Specific_filtering'>
225
<tr><td>
225
<tr><td>
226
<input type='checkbox' name='chk-ip'
226
<input type='checkbox' name='chk-ip'
227
<?php
227
<?php
228
// verify "pureip" filtering state
228
// verify "pureip" filtering state
229
if (file_exists($bannedsite_file))
229
if (file_exists($bannedsite_file))
230
	{
230
	{
231
	$pointeur=fopen($bannedsite_file,"r");
231
	$pointeur=fopen($bannedsite_file,"r");
232
	while (!feof ($pointeur))
232
	while (!feof ($pointeur))
233
		{
233
		{
234
		$ligne=fgets($pointeur, 4096);
234
		$ligne=fgets($pointeur, 4096);
235
		if ($ligne)
235
		if ($ligne)
236
			{
236
			{
237
			if (preg_match('/^\*ip$/',$ligne, $r)) 
237
			if (preg_match('/^\*ip$/',$ligne, $r)) 
238
				{
238
				{
239
				echo " checked";
239
				echo " checked";
240
				break;
240
				break;
241
				}
241
				}
242
			}
242
			}
243
		}
243
		}
244
	fclose($pointeur);
244
	fclose($pointeur);
245
	}
245
	}
246
else	{
246
else	{
247
	echo "$l_error_open_file $bannedsite_file";
247
	echo "$l_error_open_file $bannedsite_file";
248
	}
248
	}
249
echo "> $l_ip_filtering";
249
echo "> $l_ip_filtering";
250
?>
250
?>
251
</td></tr>
251
</td></tr>
252
<tr><td>
252
<tr><td>
253
<input type='checkbox' name='chk-safesearch'
253
<input type='checkbox' name='chk-safesearch'
254
<?php
254
<?php
255
// verify "safesearch" filtering state
255
// verify "safesearch" filtering state
256
if (file_exists($urlregex_file))
256
if (file_exists($urlregex_file))
257
	{
257
	{
258
	$pointeur=fopen($urlregex_file,"r");
258
	$pointeur=fopen($urlregex_file,"r");
259
	while (!feof ($pointeur))
259
	while (!feof ($pointeur))
260
		{
260
		{
261
		$ligne=fgets($pointeur, 4096);
261
		$ligne=fgets($pointeur, 4096);
262
		if ($ligne)
262
		if ($ligne)
263
			{
263
			{
264
			if (preg_match('/^\"\(\^http\:\/\/\[0\-9a\-z\]\+\\\.google/',$ligne, $r))
264
			if (preg_match('/^\"\(\^http\:\/\/\[0\-9a\-z\]\+\\\.google/',$ligne, $r))
265
				{
265
				{
266
				echo " checked";
266
				echo " checked";
267
				break;
267
				break;
268
				}
268
				}
269
			}
269
			}
270
		}
270
		}
271
	fclose($pointeur);
271
	fclose($pointeur);
272
	}
272
	}
273
else	{
273
else	{
274
	echo "$l_error_open_file $urlregex_file";
274
	echo "$l_error_open_file $urlregex_file";
275
	}
275
	}
276
echo "> $l_safe_searching";
276
echo "> $l_safe_searching";
277
echo "<br>$l_safe_youtube";
277
echo "<br>$l_safe_youtube";
278
echo "<input type='text' name='Youtube_ID' size='30' value='";
278
echo "<input type='text' name='Youtube_ID' size='30' value='";
279
if ($YOUTUBE_ID == "ABCD1234567890abcdef") // generic ID (do nothing)
279
if ($YOUTUBE_ID == "ABCD1234567890abcdef") // generic ID (do nothing)
280
	{
280
	{
281
	echo "'>";
281
	echo "'>";
282
	}
282
	}
283
else {
283
else {
284
	echo "$YOUTUBE_ID'>";
284
	echo "$YOUTUBE_ID'>";
285
	} 
285
	} 
286
echo " $l_youtube_id<tr><td>";
286
echo " $l_youtube_id<tr><td>";
287
echo "<input type='submit' value='$l_record'></td></tr>";
287
echo "<input type='submit' value='$l_record'></td></tr>";
288
?>
288
?>
289
</FORM> 
289
</FORM> 
290
</TABLE>
290
</TABLE>
291
 
291