Subversion Repositories ALCASAR

Rev

Rev 882 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

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