Subversion Repositories ALCASAR

Rev

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

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