9,6 → 9,18 |
<body> |
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
<? |
/******************** |
* READ CONF FILES * |
*********************/ |
define ("CONF_FILE", "/usr/local/etc/alcasar.conf"); |
define ("ETHERS_FILE", "/usr/local/etc/alcasar-ethers"); |
$conf_files=array(CONF_FILE,ETHERS_FILE); |
foreach ($conf_files as $file){ |
if (!file_exists($file)){ |
exit("Requested file ".$file." isn't present");} |
if (!is_readable($file)){ |
exit("Can't read the file ".$file);} |
} |
#retrieve IP_address of ALCASAR |
$alcasar_conf_file="/usr/local/etc/alcasar.conf"; |
$ouvre=fopen("$alcasar_conf_file","r"); |
21,8 → 33,6 |
$conf[$tmp[0]] = $tmp[1]; |
} |
} |
}else{ |
exit("Erreur d'ouverture du fichier $alcasar_conf_file"); |
} |
fclose($ouvre); |
$tmp = explode("/",$conf["PRIVATE_IP"]); |
109,18 → 119,22 |
$oui_id = substr(str_replace("-","",$detail[0]),0,6); |
exec ("grep $oui_id /usr/share/arp-scan/ieee-oui.txt | cut -f2", $mac_manufacturer); |
if(empty($mac_manufacturer[0])) |
{ |
$mac_manufacturer[0] = "Unknown"; |
} |
|
echo "<td>$detail[0] ($mac_manufacturer[0])</td>"; |
{ |
$mac_manufacturer[0] = "Unknown"; |
} |
echo "<td>$detail[0] <font size=\"1\">($mac_manufacturer[0])</font>"; |
unset($mac_manufacturer); |
} |
else |
{ |
echo "<td>$detail[0]</td>"; |
echo "<td>$detail[0]"; |
} |
echo "<td>"; |
exec ("grep $detail[0] /usr/local/etc/alcasar-ethers |cut -d' ' -f3", $mac_in_ether_file); |
if (!empty($mac_in_ether_file[0])) |
{ |
echo " - <b>" . ltrim($mac_in_ether_file[0],'#') . "</b>"; |
} |
echo "</td><td>"; |
if ($detail[4] == "1"){ // authenticated equipment |
$login = $detail[5]; |
unset ($found_users); unset ($cn); |
140,7 → 154,7 |
echo "</td><td>"; |
} |
else { #MAC is temporarily allowed |
echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"$l_edit_user\">$l_mac_temporarily_allowed</a>"; |
echo "<b>$l_mac_temporarily_allowed</b>"; |
echo "</td><td>"; |
echo "<FORM action='".$_SERVER['PHP_SELF']."' method=POST>"; |
echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>"; |
173,11 → 187,14 |
echo "<FORM action='".$_SERVER['PHP_SELF']."' method=POST>"; |
# Dissociate user (... or other) who is not connected yet |
echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>"; |
echo "<INPUT type='submit' name='action' value='$l_dissociate'>"; |
# Enable temporarily @MAC access |
echo "<INPUT type=submit name='action' value='$l_connect'>"; |
if (empty($mac_in_ether_file[0])) |
{ |
echo "<INPUT type='submit' name='action' value='$l_dissociate'>"; // Dissociate only MAC not in ether file (dhcp) |
} |
echo "<INPUT type=submit name='action' value='$l_connect'>"; // Enable temporarily @MAC access |
echo "</FORM></TD>"; |
} |
unset ($mac_in_ether_file); |
echo "</tr>"; |
} |
?> |