Subversion Repositories ALCASAR

Rev

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

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