Subversion Repositories ALCASAR

Rev

Rev 504 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 504 Rev 859
Line 1... Line -...
1
<table width="100%" border=1 cellspacing=0 cellpadding=1>
-
 
2
<tr><td valign="middle" align="center">
1
<tr><td valign="middle" align="center">
3
<form action='net_filter.php' method='POST'>
2
<form action='net_filter.php' method='POST'>
4
<table cellspacing=2 cellpadding=3 border=1>
3
<table cellspacing=2 cellpadding=3 border=1>
5
<?
4
<?
6
echo "<tr><th>$l_proto / port<th>$l_enabled<th>$l_delete</tr>";
5
echo "<tr><th>$l_port<th>$l_proto<th>$l_enabled<th>$l_remove</tr>";
7
// On lit et on interprète le fichier de filtrage de protocoles
6
// Read and compute the protocols list
-
 
7
$tab=file(SERVICES_LIST);
8
if (file_exists($services_list))
8
if ($tab) # the file isn't empty
9
	{
9
	{
10
	$pointeur=fopen($services_list,"r");
-
 
11
	while (!feof ($pointeur))
10
	foreach ($tab as $line)
12
		{
11
		{
13
		$ligne=fgets($pointeur, 4096);
12
		if (trim($line) != '') # the line isn't empty
14
		if ($ligne)
-
 
15
			{
13
			{
16
			$proto=explode(" ", $ligne);
14
			$proto=explode(" ", $line);
17
			$name_svc=trim($proto[0],"#");
15
			$name_svc=trim($proto[0],"#");
18
			echo "<tr><td>$name_svc / $proto[1]";
16
			echo "<tr><td>$proto[1]<td>$name_svc";
19
			echo "<td><input type='checkbox' name='chk-$name_svc'";
17
			echo "<td><input type='checkbox' name='chk-$name_svc'";
20
			// si la ligne est commentée -> protocole non autorisé
18
			// if the line is commented -> protocol is not allowed
21
			if (preg_match('/^#/',$ligne, $r)) {
19
			if (preg_match('/^#/',$line, $r)) {
22
				echo ">";}
20
				echo ">";}
23
			else {
21
			else {
24
				echo "checked>";}
22
				echo "checked>";}
25
			if ($name_svc != "icmp") {echo "<td><input type='checkbox' name='del-$name_svc'>";}
23
			if ($name_svc != "icmp") {echo "<td><input type='checkbox' name='del-$name_svc'>";}
26
			echo "</tr>";
24
			echo "</tr>";
27
			}
25
			}
28
		}
26
		}
29
	fclose($pointeur);
-
 
30
	}
-
 
31
else	{
-
 
32
	echo "$l_error_open_file $services_list";
-
 
33
	}
27
	}
34
?>
28
?>
35
</table>
29
</table>
36
<input type='hidden' name='choix' value='change'>
30
<input type='hidden' name='choix' value='change_port'>
37
<input type='submit' value='<?echo"$l_save_modif";?>'>
31
<input type='submit' value='<?echo"$l_save_modif";?>'>
38
</form>
-
 
39
</td>
-
 
40
<td valign='middle' align='center'>
32
</form></td><td valign='middle' align='center'>
41
<form action='net_filter.php' method='POST'>
33
<form action='net_filter.php' method='POST'>
42
<table cellspacing=2 cellpadding=3 border=1>
34
<table cellspacing=2 cellpadding=3 border=1>
43
<tr><th><?echo"$l_proto";?><th>port</tr>
35
<tr><th><?echo"$l_port<th>$l_proto"?></tr>
44
<tr><td><input type='text' name='add_proto' size='10'></td>
36
<tr><td><input type='text' name='add_port' size='5'></td>
45
<td><input type='text' name='add_port' size='5'></td>
37
<td><input type='text' name='add_proto' size='10'></td>
46
<input type='hidden' name='choix' value='new_proto'>
38
<input type='hidden' name='choix' value='new_port'>
47
<td><input type='submit' value='<?echo"$l_add_to_list";?>'></td>
39
<td><input type='submit' value='<?echo"$l_add_to_list";?>'></td>
48
</tr></table>
40
</tr></table>
49
</form>
41
</form>
50
</td></tr>
42
</td></tr>
51
</TABLE>
43
</TABLE>
52
</BODY>
44
</BODY>
53
</HTML>
-
 
54
 
45
</HTML>
-
 
46