Subversion Repositories ALCASAR

Rev

Rev 40 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

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