Subversion Repositories ALCASAR

Rev

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

Rev 1339 Rev 1377
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>";
-
 
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");
-
 
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/>";
67
echo "<center>$l_bl_categories</center></td></tr>";
72
echo "$l_bl_categories</center></td></tr>";	
68
//on lit et on interprete le fichier de catégories
73
//on lit et on interprete le fichier de catégories
69
$cols=1; 
74
$cols=1; 
70
if (file_exists($bl_categories))
75
if (file_exists($bl_categories))
71
	{
76
	{
72
	$pointeur=fopen($bl_categories,"r");
77
	$pointeur=fopen($bl_categories,"r");
73
	while (!feof ($pointeur))
78
	while (!feof ($pointeur))
74
		{
79
		{
75
		$ligne=fgets($pointeur, 4096);
80
		$ligne=fgets($pointeur, 4096);
76
		if ($ligne)
81
		if ($ligne)
77
			{
82
			{
78
			if ($cols == 1) { echo "<tr>";}
83
			if ($cols == 1) { echo "<tr>";}
79
				$categorie=trim(basename($ligne));
84
				$categorie=trim(basename($ligne));
80
			if($categorie != "ossi")
85
			if($categorie != "ossi")
81
			{
86
			{
82
				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>";
83
				echo "<input type='checkbox' name='chk-$categorie'";
88
				echo "<input type='checkbox' name='chk-$categorie'";
84
				// si la ligne est commentée -> categorie non selectionnée
89
				// si la ligne est commentée -> categorie non selectionnée
85
				if (preg_match('/^#/',$ligne, $r)) { echo ">";}
90
				if (preg_match('/^#/',$ligne, $r)) { echo ">";}
86
				else { echo "checked>"; }
91
				else { echo "checked>"; }
87
				echo "</td>";
92
				echo "</td>";
88
				$cols++;
93
				$cols++;
89
			}
94
			}
90
			if ($cols > 10) {
95
			if ($cols > 10) {
91
				echo "</tr>";
96
				echo "</tr>";
92
				$cols=1; }
97
				$cols=1; }
93
			}
98
			}
94
		}
99
		}
95
	fclose($pointeur);
100
	fclose($pointeur);
96
	}
101
	}
97
else	{
102
else	{
98
	echo "$l_error_open_file $bl_categories";
103
	echo "$l_error_open_file $bl_categories";
99
	}
104
	}
100
echo "</td></tr>";
105
echo "</td></tr>";
101
echo "<tr><td valign='middle' align='left' colspan=10>";
106
echo "<tr><td valign='middle' align='left' colspan=10>";
102
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
107
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
103
echo "<tr><td width=50% colspan=5 align=center>";
108
echo "<tr><td width=50% colspan=5 align=center>";
104
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>";
105
echo "<textarea name='BL_rehabilited_domains' rows=3 cols=40>";
110
echo "<textarea name='BL_rehabilited_domains' rows=3 cols=40>";
106
echo_file ($dir_dg."exceptionsitelist");
111
echo_file ($dir_dg."exceptionsitelist");
107
echo "</textarea></td>";
112
echo "</textarea></td>";
108
echo "<td width=50% colspan=5 align=center>";
113
echo "<td width=50% colspan=5 align=center>";
109
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>";
110
echo "<textarea name='BL_rehabilited_ip' rows=3 cols=40>";
115
echo "<textarea name='BL_rehabilited_ip' rows=3 cols=40>";
111
echo_file ($dir_dg."exceptioniplist");
116
echo_file ($dir_dg."exceptioniplist");
112
echo "</textarea></td></tr><tr><td width=50% colspan=10>";
117
echo "</textarea></td></tr><tr><td width=50% colspan=10>";
113
echo "<tr><td valign='middle' align='left' colspan=10>";
118
echo "<tr><td valign='middle' align='left' colspan=10>";
114
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
119
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
115
echo "<tr><td width=50% colspan=5 align=center>";
120
echo "<tr><td width=50% colspan=5 align=center>";
116
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
121
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
117
echo "<textarea name='OSSI_bl_domains' rows=3 cols=40>";
122
echo "<textarea name='OSSI_bl_domains' rows=3 cols=40>";
118
echo_file ($dir_dg."blacklists/ossi/domains");
123
echo_file ($dir_dg."blacklists/ossi/domains");
119
echo "</textarea></td>";
124
echo "</textarea></td>";
120
echo "<td width=50% colspan=5 align=center>";
125
echo "<td width=50% colspan=5 align=center>";
121
echo "<H3>$l_forbidden_ip</H3>$l_forbidden_ip_explain<BR>";
126
echo "<H3>$l_forbidden_ip</H3>$l_forbidden_ip_explain<BR>";
122
echo "<textarea name='OSSI_bl_ip' rows=3 cols=40>";
127
echo "<textarea name='OSSI_bl_ip' rows=3 cols=40>";
123
echo_ip_file ($dir_bl_ip."ossi");
128
echo_ip_file ($dir_bl_ip."ossi");
124
echo "</textarea></td></tr><tr><td colspan=10>";
129
echo "</textarea></td></tr><tr><td colspan=10>";
125
echo "<input type='submit' value='$l_record'>";
130
echo "<input type='submit' value='$l_record'>";
126
echo "</form> ($l_wait)";
131
echo "</form> ($l_wait)";
127
echo "</table></td><br/>";
132
echo "</table></td><br/>";
128
?>
133
?>
129
<table width="100%" border="0" cellspacing="0" cellpadding="0">
134
<table width="100%" border="0" cellspacing="0" cellpadding="0">
130
	<tr><th><?php echo $l_ip_file_title; ?></th></tr>
135
	<tr><th><?php echo $l_ip_file_title; ?></th></tr>
131
	<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>
132
</table>
137
</table>
133
<table width="100%" border=1 cellspacing=0 cellpadding=1>
138
<table width="100%" border=1 cellspacing=0 cellpadding=1>
134
<form action='bl_filter.php' method='POST'>
139
<form action='bl_filter.php' method='POST'>
135
<input type='hidden' name='choix' value='MAJ_ip_file_delete'>
140
<input type='hidden' name='choix' value='MAJ_ip_file_delete'>
136
<?php
141
<?php
137
echo "<tr><td width=50% colspan=5 align=center>";
142
echo "<tr><td width=50% colspan=5 align=center>";
138
echo "<H3>$l_file_list</H3>";
143
echo "<H3>$l_file_list</H3>";
139
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_file_remove</tr>";
140
exec("cd $upload_dir && ls ossi-*", $fichiersIp);
145
exec("cd $upload_dir && ls ossi-*", $fichiersIp);
141
foreach($fichiersIp as $fichier => $value)
146
foreach($fichiersIp as $fichier => $value)
142
{
147
{
143
	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$value | awk '{print $1}'")."</center></td><td><center><input type='submit' name='$value' value='$l_remove'></center></td></tr>";
144
}
149
}
145
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'>";
146
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>";
147
echo "<H3>$l_add_ip_file</H3>";
152
echo "<H3>$l_add_ip_file</H3>";
148
echo "<input type='file' name='fichier_ip'>";
153
echo "<input type='file' name='fichier_ip'>";
149
echo "<input type='submit' value='$l_submit'>";
154
echo "<input type='submit' value='$l_submit'>";
150
echo "</td></tr>";
155
echo "</td></tr>";
151
echo "</form>";
156
echo "</form>";
152
echo "</table><br/>";
157
echo "</table><br/>";
153
?>
158
?>
154
<table width="100%" border="0" cellspacing="0" cellpadding="0">
159
<table width="100%" border="0" cellspacing="0" cellpadding="0">
155
	<tr><th><?php echo $l_wl; ?></th></tr>
160
	<tr><th><?php echo $l_wl; ?></th></tr>
156
	<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>
157
</table>
162
</table>
158
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
163
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
159
<tr><td valign="middle" align="left" colspan=10>
164
<tr><td valign="middle" align="left" colspan=10>
160
<FORM action='bl_filter.php' method=POST>
165
<FORM action='bl_filter.php' method=POST>
161
<input type='hidden' name='choix' value='MAJ_cat_wl'>
166
<input type='hidden' name='choix' value='MAJ_cat_wl'>
162
<?php
167
<?php
-
 
168
echo "<center>";
-
 
169
$nbDomainNames = exec ("wc -l /usr/local/share/dnsmasq-wl/* | tail -n 1 | awk '{print $1}'");
-
 
170
$nbUrl = 0;
-
 
171
$nbIp = exec ("wc -l /usr/local/share/iptables-wl/* | tail -n 1 | awk '{print $1}'");
-
 
172
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>";
163
echo "<center>$l_wl_categories</center></td></tr>";
173
echo "$l_wl_categories</center></td></tr>";
164
//on lit et on interprete le fichier de catégories
174
//on lit et on interprete le fichier de catégories
165
$cols=1; 
175
$cols=1; 
166
if (file_exists($wl_categories))
176
if (file_exists($wl_categories))
167
	{
177
	{
168
	$pointeur=fopen($wl_categories,"r");
178
	$pointeur=fopen($wl_categories,"r");
169
	while (!feof ($pointeur))
179
	while (!feof ($pointeur))
170
		{
180
		{
171
		$ligne=fgets($pointeur, 4096);
181
		$ligne=fgets($pointeur, 4096);
172
		if ($ligne)
182
		if ($ligne)
173
			{
183
			{
174
			if ($cols == 1) { echo "<tr>";}
184
			if ($cols == 1) { echo "<tr>";}
175
			$categorie=trim(basename($ligne));
185
			$categorie=trim(basename($ligne));
176
			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>";
177
			echo "<input type='checkbox' name='chk-$categorie'";
187
			echo "<input type='checkbox' name='chk-$categorie'";
178
			// si la ligne est commentée -> categorie non selectionnée
188
			// si la ligne est commentée -> categorie non selectionnée
179
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
189
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
180
			else { echo "checked>"; }
190
			else { echo "checked>"; }
181
			echo "</td>";
191
			echo "</td>";
182
			$cols++;
192
			$cols++;
183
			if ($cols > 10) {
193
			if ($cols > 10) {
184
				echo "</tr>";
194
				echo "</tr>";
185
				$cols=1; }
195
				$cols=1; }
186
			}
196
			}
187
		}
197
		}
188
	fclose($pointeur);
198
	fclose($pointeur);
189
	}
199
	}
190
else	{
200
else	{
191
	echo "$l_error_open_file $wl_categories";
201
	echo "$l_error_open_file $wl_categories";
192
	}
202
	}
193
echo "<tr><td valign='middle' align='left' colspan=10>";
203
echo "<tr><td valign='middle' align='left' colspan=10>";
194
echo "<center><b>$l_add_to_wl</b></center></td></tr>";
204
echo "<center><b>$l_add_to_wl</b></center></td></tr>";
195
echo "<tr><td width=50% colspan=5 align=center>";
205
echo "<tr><td width=50% colspan=5 align=center>";
196
echo "<H3>$l_allowed_dns</H3>$l_forbidden_dns_explain<BR>";
206
echo "<H3>$l_allowed_dns</H3>$l_forbidden_dns_explain<BR>";
197
echo "<textarea name='OSSI_wl_domains' rows=3 cols=40>";
207
echo "<textarea name='OSSI_wl_domains' rows=3 cols=40>";
198
echo_file ($dir_dg."blacklists/ossi/domains_wl");
208
echo_file ($dir_dg."blacklists/ossi/domains_wl");
199
echo "</textarea></td>";
209
echo "</textarea></td>";
200
echo "<td width=50% colspan=5 align=center>";
210
echo "<td width=50% colspan=5 align=center>";
201
echo "<H3>$l_allowed_ip</H3>$l_forbidden_ip_explain<BR>";
211
echo "<H3>$l_allowed_ip</H3>$l_forbidden_ip_explain<BR>";
202
echo "<textarea name='OSSI_wl_ip' rows=3 cols=40>";
212
echo "<textarea name='OSSI_wl_ip' rows=3 cols=40>";
203
echo_file ($dir_dg."blacklists/ossi/urls_wl");
213
echo_ip_file ($file_wl_ip);
204
echo "</textarea></td></tr><tr><td colspan=10>";
214
echo "</textarea></td></tr><tr><td colspan=5>";
205
echo "<input type='submit' value='$l_record' disabled>";
215
echo "<input type='submit' value='$l_record'></form></td><form action='bl_filter.php' method='POST'><td valign='middle' align='left' colspan=5><input type='hidden' name='choix' value='Update_IP_WL'><input type='submit' value='$l_update_ip'> $l_update_ip_info</form></td></tr>";
206
echo "</form> (Wait for a next version of ALCASAR !)";
-
 
207
?>
216
?>
208
</td></tr>
-
 
209
</TABLE><br/>
217
</TABLE><br/>
210
<table width="100%" border="0" cellspacing="0" cellpadding="0">
218
<table width="100%" border="0" cellspacing="0" cellpadding="0">
211
	<tr><th><?php echo $l_specific_filtering; ?></th></tr>
219
	<tr><th><?php echo $l_specific_filtering; ?></th></tr>
212
	<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>
213
</table>
221
</table>
214
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
222
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
215
<FORM action='bl_filter.php' method='POST'>
223
<FORM action='bl_filter.php' method='POST'>
216
<input type='hidden' name='choix' value='Specific_filtering'>
224
<input type='hidden' name='choix' value='Specific_filtering'>
217
<tr><td>
225
<tr><td>
218
<input type='checkbox' name='chk-ip'
226
<input type='checkbox' name='chk-ip'
219
<?php
227
<?php
220
// verify "pureip" filtering state
228
// verify "pureip" filtering state
221
if (file_exists($bannedsite_file))
229
if (file_exists($bannedsite_file))
222
	{
230
	{
223
	$pointeur=fopen($bannedsite_file,"r");
231
	$pointeur=fopen($bannedsite_file,"r");
224
	while (!feof ($pointeur))
232
	while (!feof ($pointeur))
225
		{
233
		{
226
		$ligne=fgets($pointeur, 4096);
234
		$ligne=fgets($pointeur, 4096);
227
		if ($ligne)
235
		if ($ligne)
228
			{
236
			{
229
			if (preg_match('/^\*ip$/',$ligne, $r)) 
237
			if (preg_match('/^\*ip$/',$ligne, $r)) 
230
				{
238
				{
231
				echo " checked";
239
				echo " checked";
232
				break;
240
				break;
233
				}
241
				}
234
			}
242
			}
235
		}
243
		}
236
	fclose($pointeur);
244
	fclose($pointeur);
237
	}
245
	}
238
else	{
246
else	{
239
	echo "$l_error_open_file $bannedsite_file";
247
	echo "$l_error_open_file $bannedsite_file";
240
	}
248
	}
241
echo "> $l_ip_filtering";
249
echo "> $l_ip_filtering";
242
?>
250
?>
243
</td></tr>
251
</td></tr>
244
<tr><td>
252
<tr><td>
245
<input type='checkbox' name='chk-safesearch'
253
<input type='checkbox' name='chk-safesearch'
246
<?php
254
<?php
247
// verify "safesearch" filtering state
255
// verify "safesearch" filtering state
248
if (file_exists($urlregex_file))
256
if (file_exists($urlregex_file))
249
	{
257
	{
250
	$pointeur=fopen($urlregex_file,"r");
258
	$pointeur=fopen($urlregex_file,"r");
251
	while (!feof ($pointeur))
259
	while (!feof ($pointeur))
252
		{
260
		{
253
		$ligne=fgets($pointeur, 4096);
261
		$ligne=fgets($pointeur, 4096);
254
		if ($ligne)
262
		if ($ligne)
255
			{
263
			{
256
			if (preg_match('/^\"\(\^http\:\/\/\[0\-9a\-z\]\+\\\.google/',$ligne, $r))
264
			if (preg_match('/^\"\(\^http\:\/\/\[0\-9a\-z\]\+\\\.google/',$ligne, $r))
257
				{
265
				{
258
				echo " checked";
266
				echo " checked";
259
				break;
267
				break;
260
				}
268
				}
261
			}
269
			}
262
		}
270
		}
263
	fclose($pointeur);
271
	fclose($pointeur);
264
	}
272
	}
265
else	{
273
else	{
266
	echo "$l_error_open_file $urlregex_file";
274
	echo "$l_error_open_file $urlregex_file";
267
	}
275
	}
268
echo "> $l_safe_searching";
276
echo "> $l_safe_searching";
269
echo "<br>$l_safe_youtube";
277
echo "<br>$l_safe_youtube";
270
echo "<input type='text' name='Youtube_ID' size='30' value='";
278
echo "<input type='text' name='Youtube_ID' size='30' value='";
271
if ($YOUTUBE_ID == "ABCD1234567890abcdef") // generic ID (do nothing)
279
if ($YOUTUBE_ID == "ABCD1234567890abcdef") // generic ID (do nothing)
272
	{
280
	{
273
	echo "'>";
281
	echo "'>";
274
	}
282
	}
275
else {
283
else {
276
	echo "$YOUTUBE_ID'>";
284
	echo "$YOUTUBE_ID'>";
277
	} 
285
	} 
278
echo " $l_youtube_id<tr><td>";
286
echo " $l_youtube_id<tr><td>";
279
echo "<input type='submit' value='$l_record'></td></tr>";
287
echo "<input type='submit' value='$l_record'></td></tr>";
280
?>
288
?>
281
</FORM> 
289
</FORM> 
282
</TABLE>
290
</TABLE>
283
 
291