Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2078 → Rev 2080

/web/acc/manager/htdocs/activity.php
98,11 → 98,11
<th>$l_action</th>
</tr>";
$output = array(); $detail = array(); $nb_ligne = 0;
exec ("sudo /sbin/ip link show $intif", $output);
exec ("sudo /sbin/ip link show $intif", $output); // retrieve ALCASAR MAC address
$detail = explode (" " , $output[1]);
$intif_mac_addr=strtoupper(str_replace(":","-",$detail[5]));
unset ($output);unset ($detail);
exec ('sudo /usr/sbin/chilli_query list|sort -k5 -r', $output);
exec ('sudo /usr/sbin/chilli_query list|sort -k5 -r', $output);
while (list(,$ligne) = each($output)){
$detail = explode (" ", $ligne);
$nb_ligne ++;
110,7 → 110,7
echo "<TR>";
echo "<TD>".$nb_ligne."</TD>";
echo "<TD>".$detail[1]."</TD>";
if(file_exists('/usr/share/arp-scan/ieee-oui.txt'))
if(file_exists('/usr/share/arp-scan/ieee-oui.txt')) // for each device on LAN, retrieve the MAC manufacturer
{
$oui_id = substr(str_replace("-","",$detail[0]),0,6);
exec ("grep $oui_id /usr/share/arp-scan/ieee-oui.txt | cut -f2", $mac_manufacturer);
122,35 → 122,37
echo "<TD>$detail[0]</TD>";
}
echo "<TD>";
# authenticated equipment
if ($detail[4] == "1"){
# retrieve user info
$login = $detail[5];
//if (is_file("lib/sql/defaults.php")) //retrieve user groups
include("../lib/sql/defaults.php");
if (is_file("../lib/sql/user_info.php")) //retrieve user info
include("../lib/sql/user_info.php");
# The user is an allowed MAC address
if ($detail[5] == $detail[0]){
if ($cn != '-') {echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"$l_edit_user\">$l_mac_allowed ($cn)</a>";}
else { echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"$l_edit_user\">$l_mac_allowed</a>";}
echo "</TD>";
echo "<TD>";
# Disable temporarily @MAC access
echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
echo "<INPUT type=submit name='action' value='$l_disconnect'>";
if ($detail[4] == "1"){ // authenticated equipment
$login = $detail[5];
unset ($found_users); $search = $login; $search_IN = 'username'; // is user in database ?
if (is_file("../lib/sql/find.php"))
include("../lib/sql/find.php");
if (isset ($found_users)) // user is in database
{
echo "OK - ";
if (is_file("../lib/sql/user_info.php")) //retrieve user info
include("../lib/sql/user_info.php");
}
# The user is a humanoide ;-)
else {
if ($cn != '-') { echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"$l_edit_user $detail[5]\">$detail[5] ($cn)</a>";}
else { echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"$l_edit_user $detail[5]\">$detail[5]</a>";}
echo "</TD>";
echo "<TD>";
echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
echo "<INPUT type=submit name='action' value='$l_disconnect'>";
# The user is an allowed MAC address
if ($detail[5] == $detail[0]){
if ($cn != '-') {echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"$l_edit_user\">$l_mac_allowed ($cn)</a>";}
else { echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"$l_edit_user\">$l_mac_allowed</a>";}
echo "</TD>";
echo "<TD>";
# Disable temporarily @MAC access
echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
echo "<INPUT type=submit name='action' value='$l_disconnect'>";
}
# The user is a humanoide ;-)
else {
if ($cn != '-') { echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"$l_edit_user $detail[5]\">$detail[5] ($cn)</a>";}
else { echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"$l_edit_user $detail[5]\">$detail[5]</a>";}
echo "</TD>";
echo "<TD>";
echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
echo "<INPUT type=submit name='action' value='$l_disconnect'>";
}
}
}
# equipment without authenticated user
else if (($detail[0] == $intif_mac_addr) || ($detail[1] == $private_ip)){
echo "ALCASAR system";
157,8 → 159,8
echo "</TD>";
echo "<TD>";
echo "&nbsp;";
}
else {
}
else {
echo "&nbsp;";
echo "</TD>";
echo "<TD>";