Subversion Repositories ALCASAR

Rev

Rev 1090 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1090 Rev 1484
Line 25... Line 25...
25
	exit("Erreur d'ouverture du fichier $alcasar_conf_file");
25
	exit("Erreur d'ouverture du fichier $alcasar_conf_file");
26
}
26
}
27
fclose($ouvre);
27
fclose($ouvre);
28
$tmp = explode("/",$conf["PRIVATE_IP"]);
28
$tmp = explode("/",$conf["PRIVATE_IP"]);
29
$private_ip=$tmp[0];
29
$private_ip=$tmp[0];
-
 
30
$tmp = explode("/",$conf["INTIF"]);
-
 
31
$intif = $tmp[0];
30
require('/etc/freeradius-web/config.php');
32
require('/etc/freeradius-web/config.php');
31
# Choice of language
33
# Choice of language
32
$Language = 'en';
34
$Language = 'en';
33
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
35
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
34
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
36
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
Line 89... Line 91...
89
		<th>$l_ip_adr</th>
91
		<th>$l_ip_adr</th>
90
		<th>$l_mac_adr</th>
92
		<th>$l_mac_adr</th>
91
		<th>$l_user</th>
93
		<th>$l_user</th>
92
		<th>$l_action</th>
94
		<th>$l_action</th>
93
		</tr>";
95
		</tr>";
94
		$output = array(); $output_mac = array(); $nb_ligne = 0;
96
		$output = array(); $detail = array(); $nb_ligne = 0;
95
		exec ('sudo /sbin/ip link show eth1 |grep ether|cut -d" " -f6', $output_mac);
97
		exec ("sudo /sbin/ip link show $intif", $output);
-
 
98
		$detail = explode (" " , $output[1]);
96
		$eth1_mac_addr=strtoupper(str_replace(":","-",$output_mac[0]));
99
		$intif_mac_addr=strtoupper(str_replace(":","-",$detail[5]));
-
 
100
		unset ($output);unset ($detail);
97
		exec ('sudo /usr/sbin/chilli_query list|sort -k5 -r', $output);
101
		exec ('sudo /usr/sbin/chilli_query list|sort -k5 -r', $output);
98
		while (list(,$ligne) = each($output)){
102
		while (list(,$ligne) = each($output)){
99
			$detail = explode (" ", $ligne);
103
			$detail = explode (" ", $ligne);
100
			$nb_ligne ++;
104
			$nb_ligne ++;
101
			echo "<FORM action='".$_SERVER['PHP_SELF']."' method=POST>";
105
			echo "<FORM action='".$_SERVER['PHP_SELF']."' method=POST>";
Line 121... Line 125...
121
					echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
125
					echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
122
					echo "<INPUT type=submit value='$l_disconnect'>";
126
					echo "<INPUT type=submit value='$l_disconnect'>";
123
					}
127
					}
124
				}
128
				}
125
			# equipment without authenticated user
129
			# equipment without authenticated user
126
			else if (($detail[0] == $eth1_mac_addr) || ($detail[1] == $private_ip)){
130
			else if (($detail[0] == $intif_mac_addr) || ($detail[1] == $private_ip)){
127
				echo "ALCASAR system";
131
				echo "ALCASAR system";
128
				echo "</TD>";
132
				echo "</TD>";
129
				echo "<TD>";
133
				echo "<TD>";
130
				echo "&nbsp;";
134
				echo "&nbsp;";
131
			}
135
			}