Subversion Repositories ALCASAR

Rev

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

Rev 1042 Rev 1325
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
?>
19
?>
20
<table width="100%" border="0" cellspacing="0" cellpadding="0">
20
<table width="100%" border="0" cellspacing="0" cellpadding="0">
21
	<tr><th>
21
	<tr><th>
22
	<?php echo $l_list_version; echo date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README'));?>
22
	<?php echo $l_list_version; echo date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README'));?>
23
	</th></tr>
23
	</th></tr>
24
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
24
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
25
</table>
25
</table>
26
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
26
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
27
<tr><td valign="middle" align="left" colspan=10>
27
<tr><td valign="middle" align="left" colspan=10>
28
<FORM action='bl_filter.php' method=POST>
28
<FORM action='bl_filter.php' method=POST>
29
<?php
29
<?php
30
if ((file_exists("$dir_tmp/blacklists.tar.gz")) && (file_exists("$dir_tmp/md5sum")))
30
if ((file_exists("$dir_tmp/blacklists.tar.gz")) && (file_exists("$dir_tmp/md5sum")))
31
	{
31
	{
32
	echo "$l_fingerprint"; echo_file ("$dir_tmp/md5sum");
32
	echo "$l_fingerprint"; echo_file ("$dir_tmp/md5sum");
33
	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>";
33
	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>";
34
	echo "<input type='hidden' name='choix' value='Active_list'>";
34
	echo "<input type='hidden' name='choix' value='Active_list'>";
35
	echo "<input type='submit' value='$l_activate_bl'> ($l_warning)</FORM>";
35
	echo "<input type='submit' value='$l_activate_bl'> ($l_warning)</FORM>";
36
	echo "<FORM action='bl_filter.php' method=POST>";
36
	echo "<FORM action='bl_filter.php' method=POST>";
37
	echo "<input type='hidden' name='choix' value='Reject_list'>";
37
	echo "<input type='hidden' name='choix' value='Reject_list'>";
38
	echo "<input type='submit' value='$l_reject_bl'></form>";
38
	echo "<input type='submit' value='$l_reject_bl'></form>";
39
	}
39
	}
40
else
40
else
41
	{
41
	{
42
	echo "<input type='hidden' name='choix' value='Download_list'>";
42
	echo "<input type='hidden' name='choix' value='Download_list'>";
43
	echo "<input type='submit' value='$l_download_bl'>";
43
	echo "<input type='submit' value='$l_download_bl'>";
44
	echo " ($l_warning)";
44
	echo " ($l_warning)";
45
	}
45
	}
46
?>
46
?>
47
</FORM>
47
</FORM>
48
</td></tr>
48
</td></tr>
49
</table>
49
</table>
50
<table width="100%" border="0" cellspacing="0" cellpadding="0">
50
<table width="100%" border="0" cellspacing="0" cellpadding="0">
51
	<tr><th><?php echo $l_bl; ?></th></tr>
51
	<tr><th><?php echo $l_bl; ?></th></tr>
52
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
52
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
53
</table>
53
</table>
54
<table width="100%" border=1 cellspacing=0 cellpadding=1>
54
<table width="100%" border=1 cellspacing=0 cellpadding=1>
55
<tr><td valign="middle" align="left" colspan=10>
55
<tr><td valign="middle" align="left" colspan=10>
56
<FORM action='bl_filter.php' method=POST>
56
<FORM action='bl_filter.php' method=POST>
57
<input type='hidden' name='choix' value='MAJ_cat_bl'>
57
<input type='hidden' name='choix' value='MAJ_cat_bl'>
58
<?php
58
<?php
59
echo "<center>$l_bl_categories</center></td></tr>";
59
echo "<center>$l_bl_categories</center></td></tr>";
60
//on lit et on interprete le fichier de catégories
60
//on lit et on interprete le fichier de catégories
61
$cols=1; 
61
$cols=1; 
62
if (file_exists($bl_categories))
62
if (file_exists($bl_categories))
63
	{
63
	{
64
	$pointeur=fopen($bl_categories,"r");
64
	$pointeur=fopen($bl_categories,"r");
65
	while (!feof ($pointeur))
65
	while (!feof ($pointeur))
66
		{
66
		{
67
		$ligne=fgets($pointeur, 4096);
67
		$ligne=fgets($pointeur, 4096);
68
		if ($ligne)
68
		if ($ligne)
69
			{
69
			{
70
			if ($cols == 1) { echo "<tr>";}
70
			if ($cols == 1) { echo "<tr>";}
71
			$categorie=trim(basename($ligne));
71
			$categorie=trim(basename($ligne));
72
			echo "<td><a href='bl_categories_help.php?cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=150,toolbar=no,scrollbars=no,resizable=yes') title='categories help page'>$categorie</a><br>";
72
			echo "<td><a href='bl_categories_help.php?cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=450,toolbar=no,scrollbars=no,resizable=yes') title='categories help page'>$categorie</a><br>";
73
			echo "<input type='checkbox' name='chk-$categorie'";
73
			echo "<input type='checkbox' name='chk-$categorie'";
74
			// si la ligne est commentée -> categorie non selectionnée
74
			// si la ligne est commentée -> categorie non selectionnée
75
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
75
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
76
			else { echo "checked>"; }
76
			else { echo "checked>"; }
77
			echo "</td>";
77
			echo "</td>";
78
			$cols++;
78
			$cols++;
79
			if ($cols > 10) {
79
			if ($cols > 10) {
80
				echo "</tr>";
80
				echo "</tr>";
81
				$cols=1; }
81
				$cols=1; }
82
			}
82
			}
83
		}
83
		}
84
	fclose($pointeur);
84
	fclose($pointeur);
85
	}
85
	}
86
else	{
86
else	{
87
	echo "$l_error_open_file $bl_categories";
87
	echo "$l_error_open_file $bl_categories";
88
	}
88
	}
89
echo "</td></tr>";
89
echo "</td></tr>";
90
echo "<tr><td valign='middle' align='left' colspan=10>";
90
echo "<tr><td valign='middle' align='left' colspan=10>";
91
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
91
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
92
echo "<tr><td colspan=5 align=center>";
92
echo "<tr><td colspan=5 align=center>";
93
echo "<H3>$l_rehabilitated_dns</H3>$l_rehabilitated_dns_explain<BR>$l_one_dns<BR>";
93
echo "<H3>$l_rehabilitated_dns</H3>$l_rehabilitated_dns_explain<BR>$l_one_dns<BR>";
94
echo "<textarea name='BL_rehabilited_domains' rows=3 cols=40>";
94
echo "<textarea name='BL_rehabilited_domains' rows=3 cols=40>";
95
echo_file ($dir_dg."exceptionsitelist");
95
echo_file ($dir_dg."exceptionsitelist");
96
echo "</textarea></td>";
96
echo "</textarea></td>";
97
echo "<td colspan=5 align=center>";
97
echo "<td colspan=5 align=center>";
98
echo "<H3>$l_rehabilitated_url</H3>$l_rehabilitated_url_explain<BR>$l_one_url<BR>";
98
echo "<H3>$l_rehabilitated_url</H3>$l_rehabilitated_url_explain<BR>$l_one_url<BR>";
99
echo "<textarea name='BL_rehabilited_urls' rows=3 cols=40>";
99
echo "<textarea name='BL_rehabilited_urls' rows=3 cols=40>";
100
echo_file ($dir_dg."exceptionurllist");
100
echo_file ($dir_dg."exceptionurllist");
101
echo "</textarea></td></tr><tr><td colspan=10>";
101
echo "</textarea></td></tr><tr><td colspan=10>";
102
echo "<tr><td valign='middle' align='left' colspan=10>";
102
echo "<tr><td valign='middle' align='left' colspan=10>";
103
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
103
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
104
echo "<tr><td colspan=5 align=center>";
104
echo "<tr><td colspan=5 align=center>";
105
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
105
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
106
echo "<textarea name='OSSI_bl_domains' rows=3 cols=40>";
106
echo "<textarea name='OSSI_bl_domains' rows=3 cols=40>";
107
echo_file ($dir_dg."blacklists/ossi/domains");
107
echo_file ($dir_dg."blacklists/ossi/domains");
108
echo "</textarea></td>";
108
echo "</textarea></td>";
109
echo "<td colspan=5 align=center>";
109
echo "<td colspan=5 align=center>";
110
echo "<H3>$l_forbidden_url</H3>$l_forbidden_url_explain<BR>";
110
echo "<H3>$l_forbidden_url</H3>$l_forbidden_url_explain<BR>";
111
echo "<textarea name='OSSI_bl_urls' rows=3 cols=40>";
111
echo "<textarea name='OSSI_bl_urls' rows=3 cols=40>";
112
echo_file ($dir_dg."blacklists/ossi/urls");
112
echo_file ($dir_dg."blacklists/ossi/urls");
113
echo "</textarea></td></tr><tr><td colspan=10>";
113
echo "</textarea></td></tr><tr><td colspan=10>";
114
echo "<input type='submit' value='$l_record'>";
114
echo "<input type='submit' value='$l_record'>";
115
echo "</form> ($l_wait)";
115
echo "</form> ($l_wait)";
116
?>
116
?>
117
</td></tr>
117
</td></tr>
118
</TABLE>
118
</TABLE>
119
<table width="100%" border="0" cellspacing="0" cellpadding="0">
119
<table width="100%" border="0" cellspacing="0" cellpadding="0">
120
	<tr><th><?php echo $l_wl; ?></th></tr>
120
	<tr><th><?php echo $l_wl; ?></th></tr>
121
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
121
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
122
</table>
122
</table>
123
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
123
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
124
<tr><td valign="middle" align="left" colspan=10>
124
<tr><td valign="middle" align="left" colspan=10>
125
<FORM action='bl_filter.php' method=POST>
125
<FORM action='bl_filter.php' method=POST>
126
<input type='hidden' name='choix' value='MAJ_cat_wl'>
126
<input type='hidden' name='choix' value='MAJ_cat_wl'>
127
<?php
127
<?php
128
echo "<center>$l_wl_categories</center></td></tr>";
128
echo "<center>$l_wl_categories</center></td></tr>";
129
//on lit et on interprete le fichier de catégories
129
//on lit et on interprete le fichier de catégories
130
$cols=1; 
130
$cols=1; 
131
if (file_exists($wl_categories))
131
if (file_exists($wl_categories))
132
	{
132
	{
133
	$pointeur=fopen($wl_categories,"r");
133
	$pointeur=fopen($wl_categories,"r");
134
	while (!feof ($pointeur))
134
	while (!feof ($pointeur))
135
		{
135
		{
136
		$ligne=fgets($pointeur, 4096);
136
		$ligne=fgets($pointeur, 4096);
137
		if ($ligne)
137
		if ($ligne)
138
			{
138
			{
139
			if ($cols == 1) { echo "<tr>";}
139
			if ($cols == 1) { echo "<tr>";}
140
			$categorie=trim(basename($ligne));
140
			$categorie=trim(basename($ligne));
141
			echo "<td><a href='bl_categories_help.php?cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=150,toolbar=no,scrollbars=no,resizable=yes') title='categories help page'>$categorie</a><br>";
141
			echo "<td><a href='bl_categories_help.php?cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=150,toolbar=no,scrollbars=no,resizable=yes') title='categories help page'>$categorie</a><br>";
142
			echo "<input type='checkbox' name='chk-$categorie'";
142
			echo "<input type='checkbox' name='chk-$categorie'";
143
			// si la ligne est commentée -> categorie non selectionnée
143
			// si la ligne est commentée -> categorie non selectionnée
144
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
144
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
145
			else { echo "checked>"; }
145
			else { echo "checked>"; }
146
			echo "</td>";
146
			echo "</td>";
147
			$cols++;
147
			$cols++;
148
			if ($cols > 10) {
148
			if ($cols > 10) {
149
				echo "</tr>";
149
				echo "</tr>";
150
				$cols=1; }
150
				$cols=1; }
151
			}
151
			}
152
		}
152
		}
153
	fclose($pointeur);
153
	fclose($pointeur);
154
	}
154
	}
155
else	{
155
else	{
156
	echo "$l_error_open_file $wl_categories";
156
	echo "$l_error_open_file $wl_categories";
157
	}
157
	}
158
echo "<tr><td valign='middle' align='left' colspan=10>";
158
echo "<tr><td valign='middle' align='left' colspan=10>";
159
echo "<center><b>$l_add_to_wl</b></center></td></tr>";
159
echo "<center><b>$l_add_to_wl</b></center></td></tr>";
160
echo "<tr><td colspan=5 align=center>";
160
echo "<tr><td colspan=5 align=center>";
161
echo "<H3>$l_allowed_dns</H3>$l_forbidden_dns_explain<BR>";
161
echo "<H3>$l_allowed_dns</H3>$l_forbidden_dns_explain<BR>";
162
echo "<textarea name='OSSI_wl_domains' rows=3 cols=40>";
162
echo "<textarea name='OSSI_wl_domains' rows=3 cols=40>";
163
echo_file ($dir_dg."blacklists/ossi/domains_wl");
163
echo_file ($dir_dg."blacklists/ossi/domains_wl");
164
echo "</textarea></td>";
164
echo "</textarea></td>";
165
echo "<td colspan=5 align=center>";
165
echo "<td colspan=5 align=center>";
166
echo "<H3>$l_allowed_url</H3>$l_forbidden_url_explain<BR>";
166
echo "<H3>$l_allowed_url</H3>$l_forbidden_url_explain<BR>";
167
echo "<textarea name='OSSI_wl_urls' rows=3 cols=40>";
167
echo "<textarea name='OSSI_wl_urls' rows=3 cols=40>";
168
echo_file ($dir_dg."blacklists/ossi/urls_wl");
168
echo_file ($dir_dg."blacklists/ossi/urls_wl");
169
echo "</textarea></td></tr><tr><td colspan=10>";
169
echo "</textarea></td></tr><tr><td colspan=10>";
170
echo "<input type='submit' value='$l_record' disabled>";
170
echo "<input type='submit' value='$l_record' disabled>";
171
echo "</form> (Please wait for the next vesion of ALCASAR)";
171
echo "</form> (Please wait for the next vesion of ALCASAR)";
172
?>
172
?>
173
</td></tr>
173
</td></tr>
174
</TABLE>
174
</TABLE>
175
<table width="100%" border="0" cellspacing="0" cellpadding="0">
175
<table width="100%" border="0" cellspacing="0" cellpadding="0">
176
	<tr><th><?php echo $l_specific_filtering; ?></th></tr>
176
	<tr><th><?php echo $l_specific_filtering; ?></th></tr>
177
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
177
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
178
</table>
178
</table>
179
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
179
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
180
<FORM action='bl_filter.php' method='POST'>
180
<FORM action='bl_filter.php' method='POST'>
181
<input type='hidden' name='choix' value='Specific_filtering'>
181
<input type='hidden' name='choix' value='Specific_filtering'>
182
<tr><td>
182
<tr><td>
183
<input type='checkbox' name='chk-ip'
183
<input type='checkbox' name='chk-ip'
184
<?php
184
<?php
185
// verify "pureip" filtering state
185
// verify "pureip" filtering state
186
if (file_exists($bannedsite_file))
186
if (file_exists($bannedsite_file))
187
	{
187
	{
188
	$pointeur=fopen($bannedsite_file,"r");
188
	$pointeur=fopen($bannedsite_file,"r");
189
	while (!feof ($pointeur))
189
	while (!feof ($pointeur))
190
		{
190
		{
191
		$ligne=fgets($pointeur, 4096);
191
		$ligne=fgets($pointeur, 4096);
192
		if ($ligne)
192
		if ($ligne)
193
			{
193
			{
194
			if (preg_match('/^\*ip$/',$ligne, $r)) 
194
			if (preg_match('/^\*ip$/',$ligne, $r)) 
195
				{
195
				{
196
				echo " checked";
196
				echo " checked";
197
				break;
197
				break;
198
				}
198
				}
199
			}
199
			}
200
		}
200
		}
201
	fclose($pointeur);
201
	fclose($pointeur);
202
	}
202
	}
203
else	{
203
else	{
204
	echo "$l_error_open_file $bannedsite_file";
204
	echo "$l_error_open_file $bannedsite_file";
205
	}
205
	}
206
echo "> $l_ip_filtering";
206
echo "> $l_ip_filtering";
207
?>
207
?>
208
</td></tr>
208
</td></tr>
209
<tr><td>
209
<tr><td>
210
<input type='checkbox' name='chk-safesearch'
210
<input type='checkbox' name='chk-safesearch'
211
<?php
211
<?php
212
// verify "safesearch" filtering state
212
// verify "safesearch" filtering state
213
if (file_exists($urlregex_file))
213
if (file_exists($urlregex_file))
214
	{
214
	{
215
	$pointeur=fopen($urlregex_file,"r");
215
	$pointeur=fopen($urlregex_file,"r");
216
	while (!feof ($pointeur))
216
	while (!feof ($pointeur))
217
		{
217
		{
218
		$ligne=fgets($pointeur, 4096);
218
		$ligne=fgets($pointeur, 4096);
219
		if ($ligne)
219
		if ($ligne)
220
			{
220
			{
221
			if (preg_match('/^\"\(\^http\:\/\/\[0\-9a\-z\]\+\\\.google/',$ligne, $r))
221
			if (preg_match('/^\"\(\^http\:\/\/\[0\-9a\-z\]\+\\\.google/',$ligne, $r))
222
				{
222
				{
223
				echo " checked";
223
				echo " checked";
224
				break;
224
				break;
225
				}
225
				}
226
			}
226
			}
227
		}
227
		}
228
	fclose($pointeur);
228
	fclose($pointeur);
229
	}
229
	}
230
else	{
230
else	{
231
	echo "$l_error_open_file $urlregex_file";
231
	echo "$l_error_open_file $urlregex_file";
232
	}
232
	}
233
echo "> $l_safe_searching";
233
echo "> $l_safe_searching";
234
echo "<br>$l_safe_youtube";
234
echo "<br>$l_safe_youtube";
235
echo "<input type='text' name='Youtube_ID' size='30' value='";
235
echo "<input type='text' name='Youtube_ID' size='30' value='";
236
if ($YOUTUBE_ID == "ABCD1234567890abcdef") // generic ID (do nothing)
236
if ($YOUTUBE_ID == "ABCD1234567890abcdef") // generic ID (do nothing)
237
	{
237
	{
238
	echo "'>";
238
	echo "'>";
239
	}
239
	}
240
else {
240
else {
241
	echo "$YOUTUBE_ID'>";
241
	echo "$YOUTUBE_ID'>";
242
	} 
242
	} 
243
echo " $l_youtube_id<tr><td>";
243
echo " $l_youtube_id<tr><td>";
244
echo "<input type='submit' value='$l_record'>";
244
echo "<input type='submit' value='$l_record'>";
245
?>
245
?>
246
</form> 
246
</form> 
247
</td></tr>
247
</td></tr>
248
</TABLE>
248
</TABLE>
249
 
249