1 |
root |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
|
2 |
<HTML><!-- written by Rexy -->
|
|
|
3 |
<head>
|
|
|
4 |
<META HTTP-EQUIV="Refresh" CONTENT="30">
|
|
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
|
|
|
6 |
<title>État du réseau</title>
|
|
|
7 |
<link rel="stylesheet" href="/css/style.css">
|
|
|
8 |
</head>
|
|
|
9 |
<body>
|
|
|
10 |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
11 |
<?
|
|
|
12 |
# Choice of language
|
|
|
13 |
$Language = 'en';
|
|
|
14 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
|
|
15 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
|
|
16 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
|
|
17 |
if($Language == 'fr'){
|
|
|
18 |
$l_activity = "Activité sur le réseau de consultation";
|
|
|
19 |
$l_ip_adr = "Adresse IP";
|
|
|
20 |
$l_mac_adr = "Adresse MAC";
|
|
|
21 |
$l_user = "Usager";
|
|
|
22 |
$l_mac_allowed = "@MAC autorisée";
|
|
|
23 |
$l_action = "Action";
|
|
|
24 |
$l_dissociate = "Dissocier";
|
|
|
25 |
$l_disconnect = "Déconnecter";
|
|
|
26 |
$l_refresh = "Cette page est rafraichie toutes les 30 secondes";
|
|
|
27 |
}
|
|
|
28 |
else {
|
|
|
29 |
$l_activity = "Activity on the consultation LAN";
|
|
|
30 |
$l_ip_adr = "IP Adress";
|
|
|
31 |
$l_mac_adr = "MAC Adress";
|
|
|
32 |
$l_user = "User";
|
|
|
33 |
$l_mac_allowed = "@MAC allowed";
|
|
|
34 |
$l_action = "Action";
|
|
|
35 |
$l_dissociate = "Dissociate";
|
|
|
36 |
$l_disconnect = "Disconnect";
|
|
|
37 |
$l_refresh = "This frame is refreshed every 30'";
|
|
|
38 |
}
|
|
|
39 |
echo "
|
|
|
40 |
<tr><th>$l_activity</th></tr>
|
|
|
41 |
<tr bgcolor=\"#FFCC66\"><td><img src=\"/images/pix.gif\" width=\"1\"
|
|
|
42 |
height=\"2\"></td></tr>
|
|
|
43 |
</TABLE>";
|
|
|
44 |
if (isset($_POST['action'])){
|
|
|
45 |
switch ($_POST['action']){
|
|
|
46 |
case 'user_unconnect' :
|
|
|
47 |
exec ("sudo /usr/local/sbin/alcasar-logout.sh $_POST[user]");
|
|
|
48 |
unset ($_POST['user']);
|
|
|
49 |
unset ($_POST['choix']);
|
|
|
50 |
break;
|
|
|
51 |
case 'mac_unconnect' :
|
|
|
52 |
exec ("sudo /usr/sbin/chilli_query logout $_POST[mac_addr]");
|
|
|
53 |
unset ($_POST['mac_addr']);
|
|
|
54 |
unset ($_POST['choix']);
|
|
|
55 |
break;
|
|
|
56 |
}
|
|
|
57 |
}
|
|
|
58 |
?>
|
|
|
59 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
|
|
|
60 |
<tr><td valign="middle" align="left">
|
|
|
61 |
<center>
|
|
|
62 |
<? echo "$l_refresh";?>
|
|
|
63 |
<table border=1 width="80%" bordercolordark="#ffffe0" bordercolorlight="#000000" width="100%" cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
|
|
|
64 |
<tr bgcolor="#d0ddb0">
|
|
|
65 |
<? echo "
|
|
|
66 |
<th>#</th>
|
|
|
67 |
<th>$l_ip_adr</th>
|
|
|
68 |
<th>$l_mac_adr</th>
|
|
|
69 |
<th>$l_user</th>
|
|
|
70 |
<th>$l_action</th>
|
|
|
71 |
</tr>";
|
|
|
72 |
$output = array(); $nb_ligne = 0;
|
|
|
73 |
exec ('sudo /usr/sbin/chilli_query list|sort -k5 -r', $output);
|
|
|
74 |
while (list(,$ligne) = each($output)){
|
|
|
75 |
$detail = explode (" ", $ligne);
|
59 |
richard |
76 |
if ($detail[1] != "0.0.0.0"){
|
|
|
77 |
$nb_ligne ++;
|
96 |
richard |
78 |
echo "<FORM action='".$_SERVER['PHP_SELF']."' method=POST>";
|
59 |
richard |
79 |
echo "<TR>";
|
|
|
80 |
echo "<TD>"; echo $nb_ligne; echo "</TD>";
|
|
|
81 |
echo "<TD>"; echo $detail[1]; echo "</TD>";
|
|
|
82 |
echo "<TD>"; echo $detail[0]; echo "</TD>";
|
|
|
83 |
echo "<TD>";
|
|
|
84 |
# station authorisée
|
|
|
85 |
if ($detail[4] == "1"){
|
1 |
root |
86 |
# par @MAC
|
59 |
richard |
87 |
if ($detail[5] == "-"){
|
|
|
88 |
echo "$l_mac_allowed</TD><TD> ";}
|
1 |
root |
89 |
# par usager authentifié
|
59 |
richard |
90 |
else {
|
|
|
91 |
echo "<a href=\"/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"Editer l'utilisateur $detail[5]\">$detail[5]</a>";
|
|
|
92 |
echo "</TD>";
|
|
|
93 |
echo "<TD>";
|
|
|
94 |
echo "<INPUT type='hidden' name='action' value='mac_unconnect'>";
|
|
|
95 |
echo "<INPUT type='hidden' name='user' value='$detail[5]'>";
|
|
|
96 |
echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
|
|
|
97 |
echo "<INPUT type=submit value='$l_disconnect'>";
|
|
|
98 |
}
|
|
|
99 |
}
|
|
|
100 |
# station sans usager connecté
|
|
|
101 |
else {
|
|
|
102 |
echo " ";
|
1 |
root |
103 |
echo "</TD>";
|
|
|
104 |
echo "<TD>";
|
|
|
105 |
echo "<INPUT type='hidden' name='action' value='mac_unconnect'>";
|
|
|
106 |
echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
|
59 |
richard |
107 |
echo "<INPUT type='submit' value='$l_dissociate'>";
|
|
|
108 |
}
|
|
|
109 |
echo "</TD></TR></FORM>";
|
1 |
root |
110 |
}
|
|
|
111 |
}
|
|
|
112 |
?>
|
|
|
113 |
</td></tr>
|
|
|
114 |
</table>
|
|
|
115 |
</td></tr>
|
|
|
116 |
</table>
|
|
|
117 |
</html>
|