Subversion Repositories ALCASAR

Rev

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

Rev 838 Rev 977
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
require('/etc/freeradius-web/config.php');
30
# Choice of language
31
# Choice of language
31
$Language = 'en';
32
$Language = 'en';
32
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
33
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
33
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
34
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
34
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
35
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
Line 88... Line 89...
88
		<th>$l_ip_adr</th>
89
		<th>$l_ip_adr</th>
89
		<th>$l_mac_adr</th>
90
		<th>$l_mac_adr</th>
90
		<th>$l_user</th>
91
		<th>$l_user</th>
91
		<th>$l_action</th>
92
		<th>$l_action</th>
92
		</tr>";
93
		</tr>";
93
		$output = array(); $nb_ligne = 0;
94
		$output = array(); $output_mac = array(); $nb_ligne = 0;
-
 
95
		exec ('sudo /sbin/ip link show eth1 |grep ether|cut -d" " -f6', $output_mac);
-
 
96
		$eth1_mac_addr=strtoupper(str_replace(":","-",$output_mac[0]));
94
		exec ('sudo /usr/sbin/chilli_query list|sort -k5 -r', $output);
97
		exec ('sudo /usr/sbin/chilli_query list|sort -k5 -r', $output);
95
		while (list(,$ligne) = each($output)){
98
		while (list(,$ligne) = each($output)){
96
			$detail = explode (" ", $ligne);
99
			$detail = explode (" ", $ligne);
97
			if ($detail[1] != $private_ip){
-
 
98
				$nb_ligne ++;
100
			$nb_ligne ++;
99
				echo "<FORM action='".$_SERVER['PHP_SELF']."' method=POST>";
101
			echo "<FORM action='".$_SERVER['PHP_SELF']."' method=POST>";
100
				echo "<TR>";
102
			echo "<TR>";
101
				echo "<TD>".$nb_ligne."</TD>";
103
			echo "<TD>".$nb_ligne."</TD>";
102
				echo "<TD>".$detail[1]."</TD>";
104
			echo "<TD>".$detail[1]."</TD>";
Line 119... Line 121...
119
						echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
121
					echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
120
						echo "<INPUT type=submit value='$l_disconnect'>";
122
					echo "<INPUT type=submit value='$l_disconnect'>";
121
						}
123
					}
122
					}
124
				}
123
				# equipment without authenticated user
125
			# equipment without authenticated user
-
 
126
			else if (($detail[0] == $eth1_mac_addr) || ($detail[1] == $private_ip)){
-
 
127
				echo "ALCASAR system";
-
 
128
				echo "</TD>";
-
 
129
				echo "<TD>";
-
 
130
				echo "&nbsp;";
-
 
131
			}
124
				else { 
132
			else { 
125
					echo "&nbsp;";
133
				echo "&nbsp;";
126
					echo "</TD>";
134
				echo "</TD>";
127
					echo "<TD>";
135
				echo "<TD>";
128
					echo "<INPUT type='hidden' name='action' value='mac_disconnect'>";
136
				echo "<INPUT type='hidden' name='action' value='mac_disconnect'>";
129
					echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
137
				echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
130
					echo "<INPUT type='submit' value='$l_dissociate'>";
138
				echo "<INPUT type='submit' value='$l_dissociate'>";
131
				}
139
			}
132
				echo "</TD></TR></FORM>";
140
			echo "</TD></TR></FORM>";
133
			}
141
		}
134
		}
-
 
135
		?>
142
		?>
136
		</td></tr>
143
		</td></tr>
137
	</table>
144
	</table>
138
	</td></tr>
145
	</td></tr>
139
</table>
146
</table>