Subversion Repositories ALCASAR

Rev

Rev 830 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 830 Rev 838
Line 8... Line 8...
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
#retrieve IP_address of ALCASAR
12
#retrieve IP_address of ALCASAR
13
$ouvre=fopen("/usr/local/etc/alcasar.conf","r");
13
$alcasar_conf_file="/usr/local/etc/alcasar.conf";
-
 
14
$ouvre=fopen("$alcasar_conf_file","r");
14
if ($ouvre){
15
if ($ouvre){
15
	while (!feof ($ouvre))
16
	while (!feof ($ouvre))
16
	{
17
	{
17
		$tampon = fgets($ouvre, 4096);
18
		$tampon = fgets($ouvre, 4096);
18
		if (strpos($tampon,"=")!==false){
19
		if (strpos($tampon,"=")!==false){
19
			$tmp = explode("=",$tampon);
20
			$tmp = explode("=",$tampon);
20
			$conf[$tmp[0]] = $tmp[1];
21
			$conf[$tmp[0]] = $tmp[1];
21
		}
22
		}
22
	}
23
	}
23
}else{
24
}else{
24
	exit("Erreur d'ouverture du fichier ".ALCASAR_ETH1);
25
	exit("Erreur d'ouverture du fichier $alcasar_conf_file");
25
}
26
}
26
fclose($ouvre);
27
fclose($ouvre);
27
$tmp = explode("/",$conf["PRIVATE_IP"]);
28
$tmp = explode("/",$conf["PRIVATE_IP"]);
28
$private_ip=$tmp[0];
29
$private_ip=$tmp[0];
29
# Choice of language
30
# Choice of language
30
$mac_allowed_list="/usr/local/etc/alcasar-macallowed";
-
 
31
$Language = 'en';
31
$Language = 'en';
32
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
32
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
33
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
33
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
34
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
34
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
35
if($Language == 'fr'){
35
if($Language == 'fr'){
Line 40... Line 40...
40
  $l_mac_allowed = "@MAC autoris&eacute;e";
40
  $l_mac_allowed = "@MAC autoris&eacute;e";
41
  $l_action = "Action";
41
  $l_action = "Action";
42
  $l_dissociate = "Dissocier";
42
  $l_dissociate = "Dissocier";
43
  $l_disconnect = "D&eacute;connecter";
43
  $l_disconnect = "D&eacute;connecter";
44
  $l_refresh = "Cette page est rafraichie toutes les 30 secondes";
44
  $l_refresh = "Cette page est rafraichie toutes les 30 secondes";
45
  $l_error_open_file = "Erreur d'ouverture du fichier"; 
45
  $l_edit_user = "Editer l'utilisateur"; 
46
}
46
}
47
else {
47
else {
48
  $l_activity = "Activity on the consultation LAN";
48
  $l_activity = "Activity on the consultation LAN";
49
  $l_ip_adr = "IP Adress";
49
  $l_ip_adr = "IP Adress";
50
  $l_mac_adr = "MAC Adress";
50
  $l_mac_adr = "MAC Adress";
Line 52... Line 52...
52
  $l_mac_allowed = "@MAC allowed";
52
  $l_mac_allowed = "@MAC allowed";
53
  $l_action = "Action";
53
  $l_action = "Action";
54
  $l_dissociate = "Dissociate";
54
  $l_dissociate = "Dissociate";
55
  $l_disconnect = "Disconnect";
55
  $l_disconnect = "Disconnect";
56
  $l_refresh = "This frame is refreshed every 30'";
56
  $l_refresh = "This frame is refreshed every 30'";
57
  $l_error_open_file = "File open error"; 
57
  $l_edit_user = "Edit user"; 
58
}
58
}
59
echo "
59
echo "
60
<tr><th>$l_activity</th></tr>
60
<tr><th>$l_activity</th></tr>
61
<tr bgcolor=\"#FFCC66\"><td><img src=\"/images/pix.gif\" width=\"1\"
61
<tr bgcolor=\"#FFCC66\"><td><img src=\"/images/pix.gif\" width=\"1\"
62
height=\"2\"></td></tr>
62
height=\"2\"></td></tr>
Line 100... Line 100...
100
				echo "<TR>";
100
				echo "<TR>";
101
				echo "<TD>".$nb_ligne."</TD>";
101
				echo "<TD>".$nb_ligne."</TD>";
102
				echo "<TD>".$detail[1]."</TD>";
102
				echo "<TD>".$detail[1]."</TD>";
103
				echo "<TD>".$detail[0]."</TD>";
103
				echo "<TD>".$detail[0]."</TD>";
104
				echo "<TD>";
104
				echo "<TD>";
105
				# authorized equipment 
105
				# authenticated equipment 
106
				if ($detail[4] == "1"){
106
				if ($detail[4] == "1"){
107
				# by MAC address
107
				# by MAC address
108
					if ($detail[5] == $detail[0]){
108
					if ($detail[5] == $detail[0]){
109
						echo "$l_mac_allowed";
-
 
110
						if (is_file ($mac_allowed_list)) # le fichier existe
-
 
111
							{
-
 
112
							$tab=file($mac_allowed_list);
-
 
113
							if ($tab) # le fichier n'est pas vide
-
 
114
								{
-
 
115
								foreach ($tab as $line)
-
 
116
									{
-
 
117
									$field=explode("#", $line);
-
 
118
									$mac_addr=trim($field[0],"macallowed=");
-
 
119
									if (strcasecmp (trim($detail[0]), trim($mac_addr)) == 0)
109
						echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"$l_edit_user\">$l_mac_allowed</a>";
120
										{
-
 
121
										echo " ( $field[1])";
-
 
122
										break;	
-
 
123
										}
-
 
124
									}
-
 
125
								}
-
 
126
							}
-
 
127
						else { echo "$l_error_open_file $mac_allowed_list";}
-
 
128
						echo "</TD><TD>&nbsp;";
110
						echo "</TD><TD>&nbsp;";
129
					}
111
					}
130
				# by user
112
				# by user
131
					else {
113
					else {
132
						echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"Editer l'utilisateur $detail[5]\">$detail[5]</a>";
114
						echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"$l_edit_user $detail[5]\">$detail[5]</a>";
133
						echo "</TD>";
115
						echo "</TD>";
134
						echo "<TD>";
116
						echo "<TD>";
135
						echo "<INPUT type='hidden' name='action' value='user_disconnect'>";
117
						echo "<INPUT type='hidden' name='action' value='user_disconnect'>";
136
						echo "<INPUT type='hidden' name='user' value='$detail[5]'>";
118
						echo "<INPUT type='hidden' name='user' value='$detail[5]'>";
137
						echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
119
						echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";