Subversion Repositories ALCASAR

Rev

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

Rev 1582 Rev 1959
1
<tr><td colspan=2 align="center">
1
<tr><td colspan=2 align="center">
2
<?
2
<?
3
echo "$l_static_dhcp_title</td></tr>";
3
echo "$l_static_dhcp_title</td></tr>";
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_del</tr>";
8
// Read the "ether" file
8
// Read the "ether" file
9
$intif = $conf["INTIF"];
9
$intif = $conf["INTIF"];
10
exec ("sudo /sbin/ip link show $intif", $output);
10
exec ("sudo /sbin/ip link show $intif", $output);
11
$detail = explode (" " , $output[1]);
11
$detail = explode (" " , $output[1]);
12
$intif_mac_addr=strtoupper(str_replace(":","-",$detail[5]));
12
$intif_mac_addr=strtoupper(str_replace(":","-",$detail[5]));
13
unset ($output);unset ($detail);
13
unset ($output);unset ($detail);
14
$line_exist=False;
14
$line_exist=False;
15
$tab=file(ETHERS_FILE);
15
$tab=file(ETHERS_FILE);
16
if ($tab)  # le fichier n'est pas vide
16
if ($tab)  # le fichier n'est pas vide
17
	{
17
	{
18
	$line_exist=True;
18
	$line_exist=True;
19
	foreach ($tab as $line)
19
	foreach ($tab as $line)
20
		{
20
		{
21
		$field=explode(" ", $line);
21
		$field=explode(" ", $line);
22
		$mac_addr=$field[0];
22
		$mac_addr=$field[0];
23
		$ip_addr=$field[1];
23
		$ip_addr=$field[1];
24
		echo "<tr><td>$mac_addr";
24
		echo "<tr><td>$mac_addr";
25
		echo "<td>$ip_addr";
25
		echo "<td>$ip_addr";
26
		if ($mac_addr != $intif_mac_addr)
26
		if ($mac_addr != $intif_mac_addr)
27
			echo "<td><input type='checkbox' name='$mac_addr'>";
27
			echo "<td><input type='checkbox' name='$mac_addr'>";
28
		else echo "<td>";
28
		else echo "<td>";
29
		echo "</tr>";
29
		echo "</tr>";
30
		}
30
		}
31
	}
31
	}
32
echo "</table>";
32
echo "</table>";
33
if ($line_exist)
33
if ($line_exist)
34
	{
34
	{
35
	echo "<input type='hidden' name='choix' value='del_mac'>";
35
	echo "<input type='hidden' name='choix' value='del_mac'>";
36
	echo "<input type='submit' value='$l_apply'>";
36
	echo "<input type='submit' value='$l_apply'>";
37
	}	
37
	}	
38
echo "</form></td><td valign='middle' align='center'>";
38
echo "</form></td><td valign='middle' align='center'>";
39
echo "<FORM name='new_mac' action='network.php' method='POST'>";
39
echo "<FORM name='new_mac' action='network.php' method='POST'>";
40
echo "<table cellspacing=2 cellpadding=3 border=1>";
40
echo "<table cellspacing=2 cellpadding=3 border=1>";
41
echo "<tr><th>$l_mac_address<th>$l_ip_address";
41
echo "<tr><th>$l_mac_address<th>$l_ip_address";
42
?>
42
?>
43
<td></td></tr>
43
<td></td></tr>
44
<tr><td>exemple : 12-2F-36-A4-DF-43</td><td>exemple : 192.168.182.10</td><td></td></tr>
44
<tr><td>exemple : 12-2F-36-A4-DF-43</td><td>exemple : 192.168.182.10</td><td></td></tr>
45
<tr><td><input type='text' name='add_mac' size='17'></td>
45
<tr><td><input type='text' name='add_mac' size='17'></td>
46
<td><input type='text' name='add_ip' size='10'><input type='hidden' name='choix' value='new_mac'></td>
46
<td><input type='text' name='add_ip' size='10'><input type='hidden' name='choix' value='new_mac'></td>
47
<td><? echo "<input type=submit class=button value=\"$l_add_to_list\" OnClick=\"return MAC_Control('new_mac');\">"?></td>
47
<td><? echo "<input type=submit class=button value=\"$l_add_to_list\" OnClick=\"return MAC_Control('new_mac');\">"?></td>
48
</tr></table>
48
</tr></table>
49
</form>
49
</form>
50
</td></tr>
50
</td></tr>
51
</table>
51
</table>
52
 
52