Subversion Repositories ALCASAR

Rev

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

Rev 842 Rev 876
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
<input type='hidden' name='choix' value='MAJ_bl'>
27
<input type='hidden' name='choix' value='MAJ_bl'>
28
<?php
28
<?php
29
echo "<center>$l_bl_version";
29
echo "<center>$l_bl_version";
30
echo date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README'));
30
echo date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README'));
31
echo "</center><BR>";
31
echo "</center><BR>";
32
echo "<input type='submit' value='$l_download'>";
32
echo "<input type='submit' value='$l_download'>";
33
echo " ($l_warning)";
33
echo " ($l_warning)";
34
?>
34
?>
35
</FORM>
35
</FORM>
36
</td></tr>
36
</td></tr>
37
<tr><td valign="middle" align="left" colspan=10>
37
<tr><td valign="middle" align="left" colspan=10>
38
<FORM action='dns_filter.php' method=POST>
38
<FORM action='dns_filter.php' method=POST>
39
<input type='hidden' name='choix' value='MAJ_cat'>
39
<input type='hidden' name='choix' value='MAJ_cat'>
40
<?php
40
<?php
41
echo "<center>$l_bl_categories</center></td></tr>";
41
echo "<center>$l_bl_categories</center></td></tr>";
42
//on lit et on interprete le fichier de catégories
42
//on lit et on interprete le fichier de catégories
43
$cols=1; 
43
$cols=1; 
44
if (file_exists($bl_categories))
44
if (file_exists($bl_categories))
45
	{
45
	{
46
	$pointeur=fopen($bl_categories,"r");
46
	$pointeur=fopen($bl_categories,"r");
47
	while (!feof ($pointeur))
47
	while (!feof ($pointeur))
48
		{
48
		{
49
		$ligne=fgets($pointeur, 4096);
49
		$ligne=fgets($pointeur, 4096);
50
		if ($ligne)
50
		if ($ligne)
51
			{
51
			{
52
			if ($cols == 1) { echo "<tr>";}
52
			if ($cols == 1) { echo "<tr>";}
53
			$categorie=trim(basename($ligne));
53
			$categorie=trim(basename($ligne));
54
			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>";
54
			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>";
55
			echo "<input type='checkbox' name='chk-$categorie'";
55
			echo "<input type='checkbox' name='chk-$categorie'";
56
			// si la ligne est commentée -> categorie non selectionnée
56
			// si la ligne est commentée -> categorie non selectionnée
57
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
57
			if (preg_match('/^#/',$ligne, $r)) { echo ">";}
58
			else { echo "checked>"; }
58
			else { echo "checked>"; }
59
			echo "</td>";
59
			echo "</td>";
60
			$cols++;
60
			$cols++;
61
			if ($cols > 10) {
61
			if ($cols > 10) {
62
				echo "</tr>";
62
				echo "</tr>";
63
				$cols=1; }
63
				$cols=1; }
64
			}
64
			}
65
		}
65
		}
66
	fclose($pointeur);
66
	fclose($pointeur);
67
	echo "<tr><td colspan=10><input type='submit' value='$l_record'>";
67
	echo "<tr><td colspan=10><input type='submit' value='$l_record'>";
68
	}
68
	}
69
else	{
69
else	{
70
	echo "$l_error_open_file $bl_categories";
70
	echo "$l_error_open_file $bl_categories";
71
	}
71
	}
-
 
72
echo "</form> ($l_wait)";
-
 
73
?>
-
 
74
</td></tr>
-
 
75
<tr><td valign="middle" align="left" colspan=10>
-
 
76
<FORM action='dns_filter.php' method=POST>
-
 
77
<input type='hidden' name='choix' value='MAJ_rehabilited'>
-
 
78
<?php
-
 
79
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
-
 
80
echo "<tr><td colspan=5 align=center>";
-
 
81
echo "<H3>$l_rehabilitated_dns</H3>$l_rehabilitated_dns_explain<BR>$l_one_dns<BR>";
-
 
82
echo "<textarea name='OSSI_wl_domains' rows=5 cols=40>";
-
 
83
echo_file ("/etc/dansguardian/lists/exceptionsitelist");
-
 
84
echo "</textarea></td>";
-
 
85
echo "<td colspan=5 align=center>";
-
 
86
echo "<H3>$l_rehabilitated_url</H3>$l_rehabilitated_url_explain<BR>$l_one_url<BR>";
-
 
87
echo "<textarea name='OSSI_wl_urls' rows=5 cols=40>";
-
 
88
echo_file ("/etc/dansguardian/lists/exceptionurllist");
-
 
89
echo "</textarea></td></tr><tr><td colspan=10>";
-
 
90
echo "<input type='submit' value='$l_record'>";
-
 
91
echo "</form> ($l_wait)";
72
?>
92
?>
73
</FORM>
-
 
74
</td></tr>
93
</td></tr>
75
</TABLE>
94
</TABLE>
76
<table width="100%" border="0" cellspacing="0" cellpadding="0">
95
<table width="100%" border="0" cellspacing="0" cellpadding="0">
77
	<tr><th><?php echo $l_secondary_bl; ?></th></tr>
96
	<tr><th><?php echo $l_secondary_bl; ?></th></tr>
78
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
97
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
79
</table>
98
</table>
80
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
99
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
81
<FORM action='dns_filter.php' method='POST'>
100
<FORM action='dns_filter.php' method='POST'>
-
 
101
<?php
82
<tr><td width=50% align=center>
102
echo "<tr><td width=50% align=center>";
83
<?php echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
103
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
84
echo "<textarea name='OSSI_bl_domains' rows=5 cols=40>";
104
echo "<textarea name='OSSI_bl_domains' rows=5 cols=40>";
85
echo_file ("/etc/dansguardian/lists/blacklists/ossi/domains");
105
echo_file ("/etc/dansguardian/lists/blacklists/ossi/domains");
86
echo "</textarea></td><td  width=50% align=center>";
106
echo "</textarea></td><td  width=50% 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></tr><tr><td width=50% align=center>";
-
 
91
echo "<H3>$l_forbidden_url</H3>$l_forbidden_url_explain<BR>";
107
echo "<H3>$l_forbidden_url</H3>$l_forbidden_url_explain<BR>";
92
echo "<textarea name='OSSI_bl_urls' rows=5 cols=40>";
108
echo "<textarea name='OSSI_bl_urls' rows=5 cols=40>";
93
echo_file ("/etc/dansguardian/lists/blacklists/ossi/urls");
109
echo_file ("/etc/dansguardian/lists/blacklists/ossi/urls");
94
echo "</textarea></td><td  width=50% align=center>";
110
echo "</textarea></td></tr>";
95
echo "<H3>$l_rehabilitated_url</H3>$l_rehabilitated_url_explain<BR>$l_one_url<BR>";
-
 
96
echo "<textarea name='OSSI_wl_urls' rows=5 cols=40>";
-
 
97
echo_file ("/etc/dansguardian/lists/exceptionurllist");
-
 
98
?>
111
?>
99
</textarea>
-
 
100
</td></tr>
-
 
101
<tr><td colspan=2>
112
<tr><td colspan=2>
102
<input type='hidden' name='choix' value='MAJ_OSSI'>
113
<input type='hidden' name='choix' value='MAJ_OSSI'>
103
<input type='submit' value='<?php echo "$l_record"?>'>
114
<input type='submit' value='<?php echo "$l_record"?>'>
104
</form> <? echo "($l_wait)";?>
115
</form> <? echo "($l_wait)";?>
105
</td></tr>
116
</td></tr>
106
</TABLE>
117
</TABLE>
107
 
118