Subversion Repositories ALCASAR

Rev

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

Rev 879 Rev 882
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 "$l_error_openfile $filename";
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><?php echo $l_main_bl; ?></th></tr>
21
	<tr><th><?php echo $l_main_bl; ?></th></tr>
22
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
22
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
23
</table>
23
</table>
24
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
24
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
25
<tr><td valign="middle" align="left" colspan=10>
25
<tr><td valign="middle" align="left" colspan=10>
26
<FORM action='dns_filter.php' method=POST>
26
<FORM action='dns_filter.php' method=POST>
27
<?php
27
<?php
28
echo "<center>$l_bl_version";
28
echo "<center>$l_bl_version";
29
echo date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README'));
29
echo date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README'));
30
echo "</center><BR>";
30
echo "</center><BR>";
31
$dir_tmp="/tmp/blacklists";
31
$dir_tmp="/tmp/blacklists";
32
if (file_exists("$dir_tmp/blacklists.tar.gz"))
32
if ((file_exists("$dir_tmp/blacklists.tar.gz")) && (file_exists("$dir_tmp/md5sum")))
33
	{
33
	{
34
	echo "$l_fingerprint"; echo_file ("$dir_tmp/md5sum");
34
	echo "$l_fingerprint"; echo_file ("$dir_tmp/md5sum");
35
	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 "<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>";
36
	echo "<input type='hidden' name='choix' value='Active_bl'>";
36
	echo "<input type='hidden' name='choix' value='Active_bl'>";
37
	echo "<input type='submit' value='$l_activate_bl'>";
37
	echo "<input type='submit' value='$l_activate_bl'>";
38
	echo " ($l_warning)";
38
	echo " ($l_warning)";
39
	}
39
	}
40
else
40
else
41
	{
41
	{
42
	echo "<input type='hidden' name='choix' value='Download_bl'>";
42
	echo "<input type='hidden' name='choix' value='Download_bl'>";
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
<tr><td valign="middle" align="left" colspan=10>
49
<tr><td valign="middle" align="left" colspan=10>
50
<FORM action='dns_filter.php' method=POST>
50
<FORM action='dns_filter.php' method=POST>
51
<input type='hidden' name='choix' value='MAJ_cat'>
51
<input type='hidden' name='choix' value='MAJ_cat'>
52
<?php
52
<?php
53
echo "<center>$l_bl_categories</center></td></tr>";
53
echo "<center>$l_bl_categories</center></td></tr>";
54
//on lit et on interprete le fichier de catégories
54
//on lit et on interprete le fichier de catégories
55
$cols=1; 
55
$cols=1; 
56
if (file_exists($bl_categories))
56
if (file_exists($bl_categories))
57
	{
57
	{
58
	$pointeur=fopen($bl_categories,"r");
58
	$pointeur=fopen($bl_categories,"r");
59
	while (!feof ($pointeur))
59
	while (!feof ($pointeur))
60
		{
60
		{
61
		$ligne=fgets($pointeur, 4096);
61
		$ligne=fgets($pointeur, 4096);
62
		if ($ligne)
62
		if ($ligne)
63
			{
63
			{
64
			if ($cols == 1) { echo "<tr>";}
64
			if ($cols == 1) { echo "<tr>";}
65
			$categorie=trim(basename($ligne));
65
			$categorie=trim(basename($ligne));
66
			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>";
66
			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>";
67
			echo "<input type='checkbox' name='chk-$categorie'";
67
			echo "<input type='checkbox' name='chk-$categorie'";
68
			// si la ligne est commentée -> categorie non selectionnée
68
			// si la ligne est commentée -> categorie non selectionnée
69
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
69
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
70
			else { echo "checked>"; }
70
			else { echo "checked>"; }
71
			echo "</td>";
71
			echo "</td>";
72
			$cols++;
72
			$cols++;
73
			if ($cols > 10) {
73
			if ($cols > 10) {
74
				echo "</tr>";
74
				echo "</tr>";
75
				$cols=1; }
75
				$cols=1; }
76
			}
76
			}
77
		}
77
		}
78
	fclose($pointeur);
78
	fclose($pointeur);
79
	}
79
	}
80
else	{
80
else	{
81
	echo "$l_error_open_file $bl_categories";
81
	echo "$l_error_open_file $bl_categories";
82
	}
82
	}
83
echo "</td></tr>";
83
echo "</td></tr>";
84
echo "<tr><td valign='middle' align='left' colspan=10>";
84
echo "<tr><td valign='middle' align='left' colspan=10>";
85
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
85
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
86
echo "<tr><td colspan=5 align=center>";
86
echo "<tr><td colspan=5 align=center>";
87
echo "<H3>$l_rehabilitated_dns</H3>$l_rehabilitated_dns_explain<BR>$l_one_dns<BR>";
87
echo "<H3>$l_rehabilitated_dns</H3>$l_rehabilitated_dns_explain<BR>$l_one_dns<BR>";
88
echo "<textarea name='OSSI_wl_domains' rows=5 cols=40>";
88
echo "<textarea name='OSSI_wl_domains' rows=5 cols=40>";
89
echo_file ("/etc/dansguardian/lists/exceptionsitelist");
89
echo_file ("/etc/dansguardian/lists/exceptionsitelist");
90
echo "</textarea></td>";
90
echo "</textarea></td>";
91
echo "<td colspan=5 align=center>";
91
echo "<td colspan=5 align=center>";
92
echo "<H3>$l_rehabilitated_url</H3>$l_rehabilitated_url_explain<BR>$l_one_url<BR>";
92
echo "<H3>$l_rehabilitated_url</H3>$l_rehabilitated_url_explain<BR>$l_one_url<BR>";
93
echo "<textarea name='OSSI_wl_urls' rows=5 cols=40>";
93
echo "<textarea name='OSSI_wl_urls' rows=5 cols=40>";
94
echo_file ("/etc/dansguardian/lists/exceptionurllist");
94
echo_file ("/etc/dansguardian/lists/exceptionurllist");
95
echo "</textarea></td></tr><tr><td colspan=10>";
95
echo "</textarea></td></tr><tr><td colspan=10>";
96
echo "<tr><td valign='middle' align='left' colspan=10>";
96
echo "<tr><td valign='middle' align='left' colspan=10>";
97
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
97
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
98
echo "<tr><td colspan=5 align=center>";
98
echo "<tr><td colspan=5 align=center>";
99
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
99
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
100
echo "<textarea name='OSSI_bl_domains' rows=5 cols=40>";
100
echo "<textarea name='OSSI_bl_domains' rows=5 cols=40>";
101
echo_file ("/etc/dansguardian/lists/blacklists/ossi/domains");
101
echo_file ("/etc/dansguardian/lists/blacklists/ossi/domains");
102
echo "</textarea></td>";
102
echo "</textarea></td>";
103
echo "<td colspan=5 align=center>";
103
echo "<td colspan=5 align=center>";
104
echo "<H3>$l_forbidden_url</H3>$l_forbidden_url_explain<BR>";
104
echo "<H3>$l_forbidden_url</H3>$l_forbidden_url_explain<BR>";
105
echo "<textarea name='OSSI_bl_urls' rows=5 cols=40>";
105
echo "<textarea name='OSSI_bl_urls' rows=5 cols=40>";
106
echo_file ("/etc/dansguardian/lists/blacklists/ossi/urls");
106
echo_file ("/etc/dansguardian/lists/blacklists/ossi/urls");
107
echo "</textarea></td></tr><tr><td colspan=10>";
107
echo "</textarea></td></tr><tr><td colspan=10>";
108
echo "<input type='submit' value='$l_record'>";
108
echo "<input type='submit' value='$l_record'>";
109
echo "</form> ($l_wait)";
109
echo "</form> ($l_wait)";
110
?>
110
?>
111
</td></tr>
111
</td></tr>
112
</TABLE>
112
</TABLE>
113
<table width="100%" border="0" cellspacing="0" cellpadding="0">
113
<table width="100%" border="0" cellspacing="0" cellpadding="0">
114
	<tr><th><?php echo $l_specific_filtering; ?></th></tr>
114
	<tr><th><?php echo $l_specific_filtering; ?></th></tr>
115
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
115
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
116
</table>
116
</table>
117
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
117
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
118
<FORM action='dns_filter.php' method='POST'>
118
<FORM action='dns_filter.php' method='POST'>
119
<input type='hidden' name='choix' value='Specific_filtering'>
119
<input type='hidden' name='choix' value='Specific_filtering'>
120
<tr><td>
120
<tr><td>
121
<input type='checkbox' name='chk-ip'
121
<input type='checkbox' name='chk-ip'
122
<?php
122
<?php
123
//on vérifie l'état du filtrage "pureip"
123
// verify "pureip" filtering state
124
if (file_exists($bannedsite_file))
124
if (file_exists($bannedsite_file))
125
	{
125
	{
126
	$pointeur=fopen($bannedsite_file,"r");
126
	$pointeur=fopen($bannedsite_file,"r");
127
	while (!feof ($pointeur))
127
	while (!feof ($pointeur))
128
		{
128
		{
129
		$ligne=fgets($pointeur, 4096);
129
		$ligne=fgets($pointeur, 4096);
130
		if ($ligne)
130
		if ($ligne)
131
			{
131
			{
132
			if (preg_match('/^\*ip$/',$ligne, $r)) 
132
			if (preg_match('/^\*ip$/',$ligne, $r)) 
133
				{
133
				{
134
				echo " checked";
134
				echo " checked";
135
				break;
135
				break;
136
				}
136
				}
137
			}
137
			}
138
		}
138
		}
139
	fclose($pointeur);
139
	fclose($pointeur);
140
	}
140
	}
141
else	{
141
else	{
142
	echo "$l_error_open_file $bannedsite_file";
142
	echo "$l_error_open_file $bannedsite_file";
143
	}
143
	}
144
echo "> $l_ip_filtering";
144
echo "> $l_ip_filtering";
145
echo "</td></tr>";
-
 
146
?>
145
?>
-
 
146
</td></tr>
147
<tr><td>
147
<tr><td>
148
<input type='checkbox' name='chk-safe-search'> <?php echo "$l_safe_searching"?>
148
<input type='checkbox' name='chk-safesearch'
-
 
149
<?php
-
 
150
// verify "safesearch" filtering state
-
 
151
if (file_exists($urlregex_file))
-
 
152
	{
-
 
153
	$pointeur=fopen($urlregex_file,"r");
-
 
154
	while (!feof ($pointeur))
-
 
155
		{
-
 
156
		$ligne=fgets($pointeur, 4096);
-
 
157
		if ($ligne)
-
 
158
			{
-
 
159
			if (preg_match('/^\"\(\^http\:\/\/\[0\-9a\-z\]\+\\\.google/',$ligne, $r))
-
 
160
				{
-
 
161
				echo " checked";
-
 
162
				break;
-
 
163
				}
-
 
164
			}
-
 
165
		}
-
 
166
	fclose($pointeur);
-
 
167
	}
-
 
168
else	{
-
 
169
	echo "$l_error_open_file $urlregex_file";
-
 
170
	}
-
 
171
echo "> $l_safe_searching";
-
 
172
echo "<br>$l_safe_youtube";
-
 
173
?>
149
<br><?php echo "$l_safe_youtube"?><input type='text' name='Youtube-ID' size='30'> 
174
<input type='text' name='Youtube-ID' size='30'> 
150
<tr><td>
175
<tr><td>
151
<input type='submit' value='<?php echo "$l_record"?>'>
176
<input type='submit' value='<?php echo "$l_record"?>'>
152
</form> 
177
</form> 
153
</td></tr>
178
</td></tr>
154
</TABLE>
179
</TABLE>
155
 
180