Subversion Repositories ALCASAR

Rev

Rev 1578 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1578 Rev 1582
Line 4... Line 4...
4
echo "<tr><td align='center' valign='middle'>";
4
echo "<tr><td align='center' valign='middle'>";
5
echo "<FORM action='network.php' method='POST'>";
5
echo "<FORM action='network.php' method='POST'>";
6
echo "<table cellspacing=2 cellpadding=3 border=1>";
6
echo "<table cellspacing=2 cellpadding=3 border=1>";
7
echo "<tr><th>$l_mac_address<th>$l_ip_address<th>$l_mac_del</tr>";
7
echo "<tr><th>$l_mac_address<th>$l_ip_address<th>$l_mac_del</tr>";
8
// Read the "ether" file
8
// Read the "ether" file
-
 
9
$intif = $conf["INTIF"];
-
 
10
exec ("sudo /sbin/ip link show $intif", $output);
-
 
11
$detail = explode (" " , $output[1]);
-
 
12
$intif_mac_addr=strtoupper(str_replace(":","-",$detail[5]));
-
 
13
unset ($output);unset ($detail);
9
$line_exist=False;
14
$line_exist=False;
10
$tab=file(ETHERS_FILE);
15
$tab=file(ETHERS_FILE);
11
if ($tab)  # le fichier n'est pas vide
16
if ($tab)  # le fichier n'est pas vide
12
	{
17
	{
13
	$line_exist=True;
18
	$line_exist=True;
Line 16... Line 21...
16
		$field=explode(" ", $line);
21
		$field=explode(" ", $line);
17
		$mac_addr=$field[0];
22
		$mac_addr=$field[0];
18
		$ip_addr=$field[1];
23
		$ip_addr=$field[1];
19
		echo "<tr><td>$mac_addr";
24
		echo "<tr><td>$mac_addr";
20
		echo "<td>$ip_addr";
25
		echo "<td>$ip_addr";
-
 
26
		if ($mac_addr != $intif_mac_addr)
21
		echo "<td><input type='checkbox' name='$mac_addr'>";
27
			echo "<td><input type='checkbox' name='$mac_addr'>";
-
 
28
		else echo "<td>";
22
		echo "</tr>";
29
		echo "</tr>";
23
		}
30
		}
24
	}
31
	}
25
echo "</table>";
32
echo "</table>";
26
if ($line_exist)
33
if ($line_exist)