Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2264 → Rev 2265

/web/acc/admin/network2.php
4,7 → 4,7
echo "<tr><td align='center' valign='middle'>";
echo "<FORM action='network.php' method='POST'>";
echo "<table cellspacing=2 cellpadding=3 border=1>";
echo "<tr><th>$l_mac_address<th>$l_ip_address<th>$l_del</tr>";
echo "<tr><th>$l_mac_address<th>$l_ip_address<th>Info<th>$l_del</tr>";
// Read the "ether" file
$intif = $conf["INTIF"];
exec ("sudo /sbin/ip link show $intif", $output);
14,38 → 14,46
$line_exist=False;
$tab=file(ETHERS_FILE);
if ($tab) # le fichier n'est pas vide
{
foreach ($tab as $line)
{
foreach ($tab as $line)
{
$field=explode(" ", $line);
$mac_addr=$field[0];
$ip_addr=$field[1];
if (isset($field[2])) $info=$field[2];
else $info=" ";
echo "<tr><td>$mac_addr";
echo "<td>$ip_addr";
if ($mac_addr != $intif_mac_addr)
{
{
echo "<td>" . ltrim($info,'#');
echo "<td><input type='checkbox' name='$mac_addr'>";
$line_exist=True;
}
else echo "<td>";
}
else
{
echo "<td>ALCASAR";
echo "<td>";
}
echo "</tr>";
}
}
}
echo "</table>";
if ($line_exist)
{
{
echo "<input type='hidden' name='choix' value='del_mac'>";
echo "<input type='submit' value='$l_apply'>";
}
}
echo "</form></td><td valign='middle' align='center'>";
echo "<FORM name='new_mac' action='network.php' method='POST'>";
echo "<table cellspacing=2 cellpadding=3 border=1>";
echo "<tr><th>$l_mac_address<th>$l_ip_address";
echo "<tr><th>$l_mac_address<th>$l_ip_address<th>Info";
?>
<td></td></tr>
<tr><td>exemple : 12-2F-36-A4-DF-43</td><td>exemple : 192.168.182.10</td><td></td></tr>
<tr><td>Ex. : 12-2F-36-A4-DF-43</td><td>Ex. : 192.168.182.10</td><td>Ex. : Switch<td></td></tr>
<tr><td><input type='text' name='add_mac' size='17'></td>
<td><input type='text' name='add_ip' size='10'><input type='hidden' name='choix' value='new_mac'></td>
<td><input type='text' name='info' size='10'></td>
<td><? echo "<input type=submit class=button value=\"$l_add_to_list\" OnClick=\"return MAC_Control('new_mac');\">"?></td>
</tr></table>
</form>