Subversion Repositories ALCASAR

Rev

Rev 879 | 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>";
878 richard 31
$dir_tmp="/tmp/blacklists";
882 richard 32
if ((file_exists("$dir_tmp/blacklists.tar.gz")) && (file_exists("$dir_tmp/md5sum")))
878 richard 33
	{
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>";
36
	echo "<input type='hidden' name='choix' value='Active_bl'>";
37
	echo "<input type='submit' value='$l_activate_bl'>";
38
	echo " ($l_warning)";
39
	}
40
else
41
	{
42
	echo "<input type='hidden' name='choix' value='Download_bl'>";
43
	echo "<input type='submit' value='$l_download_bl'>";
44
	echo " ($l_warning)";
45
	}
318 richard 46
?>
47
</FORM>
48
</td></tr>
49
<tr><td valign="middle" align="left" colspan=10>
50
<FORM action='dns_filter.php' method=POST>
51
<input type='hidden' name='choix' value='MAJ_cat'>
52
<?php
53
echo "<center>$l_bl_categories</center></td></tr>";
54
//on lit et on interprete le fichier de catégories
55
$cols=1; 
56
if (file_exists($bl_categories))
57
	{
58
	$pointeur=fopen($bl_categories,"r");
59
	while (!feof ($pointeur))
60
		{
61
		$ligne=fgets($pointeur, 4096);
62
		if ($ligne)
63
			{
64
			if ($cols == 1) { echo "<tr>";}
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>";
67
			echo "<input type='checkbox' name='chk-$categorie'";
68
			// si la ligne est commentée -> categorie non selectionnée
69
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
70
			else { echo "checked>"; }
71
			echo "</td>";
72
			$cols++;
73
			if ($cols > 10) {
74
				echo "</tr>";
75
				$cols=1; }
76
			}
77
		}
78
	fclose($pointeur);
79
	}
80
else	{
81
	echo "$l_error_open_file $bl_categories";
82
	}
878 richard 83
echo "</td></tr>";
84
echo "<tr><td valign='middle' align='left' colspan=10>";
876 richard 85
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
86
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 "<textarea name='OSSI_wl_domains' rows=5 cols=40>";
89
echo_file ("/etc/dansguardian/lists/exceptionsitelist");
90
echo "</textarea></td>";
91
echo "<td colspan=5 align=center>";
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>";
94
echo_file ("/etc/dansguardian/lists/exceptionurllist");
95
echo "</textarea></td></tr><tr><td colspan=10>";
878 richard 96
echo "<tr><td valign='middle' align='left' colspan=10>";
97
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
98
echo "<tr><td colspan=5 align=center>";
99
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
100
echo "<textarea name='OSSI_bl_domains' rows=5 cols=40>";
101
echo_file ("/etc/dansguardian/lists/blacklists/ossi/domains");
102
echo "</textarea></td>";
103
echo "<td colspan=5 align=center>";
104
echo "<H3>$l_forbidden_url</H3>$l_forbidden_url_explain<BR>";
105
echo "<textarea name='OSSI_bl_urls' rows=5 cols=40>";
106
echo_file ("/etc/dansguardian/lists/blacklists/ossi/urls");
107
echo "</textarea></td></tr><tr><td colspan=10>";
876 richard 108
echo "<input type='submit' value='$l_record'>";
109
echo "</form> ($l_wait)";
110
?>
111
</td></tr>
318 richard 112
</TABLE>
113
<table width="100%" border="0" cellspacing="0" cellpadding="0">
878 richard 114
	<tr><th><?php echo $l_specific_filtering; ?></th></tr>
318 richard 115
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
116
</table>
117
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
118
<FORM action='dns_filter.php' method='POST'>
878 richard 119
<input type='hidden' name='choix' value='Specific_filtering'>
879 richard 120
<tr><td>
121
<input type='checkbox' name='chk-ip'
876 richard 122
<?php
882 richard 123
// verify "pureip" filtering state
879 richard 124
if (file_exists($bannedsite_file))
125
	{
126
	$pointeur=fopen($bannedsite_file,"r");
127
	while (!feof ($pointeur))
128
		{
129
		$ligne=fgets($pointeur, 4096);
130
		if ($ligne)
131
			{
132
			if (preg_match('/^\*ip$/',$ligne, $r)) 
133
				{
134
				echo " checked";
135
				break;
136
				}
137
			}
138
		}
139
	fclose($pointeur);
140
	}
141
else	{
142
	echo "$l_error_open_file $bannedsite_file";
143
	}
144
echo "> $l_ip_filtering";
318 richard 145
?>
882 richard 146
</td></tr>
878 richard 147
<tr><td>
882 richard 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
?>
174
<input type='text' name='Youtube-ID' size='30'> 
878 richard 175
<tr><td>
359 richard 176
<input type='submit' value='<?php echo "$l_record"?>'>
878 richard 177
</form> 
318 richard 178
</td></tr>
179
</TABLE>