Subversion Repositories ALCASAR

Rev

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

Rev 768 Rev 830
Line 7... Line 7...
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
#retrieve IP_address of ALCASAR
-
 
13
$ouvre=fopen("/usr/local/etc/alcasar.conf","r");
-
 
14
if ($ouvre){
-
 
15
	while (!feof ($ouvre))
-
 
16
	{
-
 
17
		$tampon = fgets($ouvre, 4096);
-
 
18
		if (strpos($tampon,"=")!==false){
-
 
19
			$tmp = explode("=",$tampon);
-
 
20
			$conf[$tmp[0]] = $tmp[1];
-
 
21
		}
-
 
22
	}
-
 
23
}else{
-
 
24
	exit("Erreur d'ouverture du fichier ".ALCASAR_ETH1);
-
 
25
}
-
 
26
fclose($ouvre);
-
 
27
$tmp = explode("/",$conf["PRIVATE_IP"]);
-
 
28
$private_ip=$tmp[0];
12
# Choice of language
29
# Choice of language
13
$mac_allowed_list="/usr/local/etc/alcasar-macallowed";
30
$mac_allowed_list="/usr/local/etc/alcasar-macallowed";
14
$Language = 'en';
31
$Language = 'en';
15
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
32
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
16
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
33
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
Line 75... Line 92...
75
		</tr>";
92
		</tr>";
76
		$output = array(); $nb_ligne = 0;
93
		$output = array(); $nb_ligne = 0;
77
		exec ('sudo /usr/sbin/chilli_query list|sort -k5 -r', $output);
94
		exec ('sudo /usr/sbin/chilli_query list|sort -k5 -r', $output);
78
		while (list(,$ligne) = each($output)){
95
		while (list(,$ligne) = each($output)){
79
			$detail = explode (" ", $ligne);
96
			$detail = explode (" ", $ligne);
80
			if (($detail[1] != "0.0.0.0")&&($detail[1] != "1.0.0.0")){
97
			if ($detail[1] != $private_ip){
81
				$nb_ligne ++;
98
				$nb_ligne ++;
82
				echo "<FORM action='".$_SERVER['PHP_SELF']."' method=POST>";
99
				echo "<FORM action='".$_SERVER['PHP_SELF']."' method=POST>";
83
				echo "<TR>";
100
				echo "<TR>";
84
				echo "<TD>"; echo $nb_ligne; echo "</TD>";
101
				echo "<TD>".$nb_ligne."</TD>";
85
				echo "<TD>"; echo $detail[1]; echo "</TD>";
102
				echo "<TD>".$detail[1]."</TD>";
86
				echo "<TD>"; echo $detail[0]; echo "</TD>";
103
				echo "<TD>".$detail[0]."</TD>";
87
				echo "<TD>";
104
				echo "<TD>";
88
				# station authorisée 
105
				# authorized equipment 
89
				if ($detail[4] == "1"){
106
				if ($detail[4] == "1"){
90
				# par @MAC
107
				# by MAC address
91
					if ($detail[5] == "-"){
108
					if ($detail[5] == $detail[0]){
92
						echo "$l_mac_allowed";
109
						echo "$l_mac_allowed";
93
						if (is_file ($mac_allowed_list)) # le fichier existe
110
						if (is_file ($mac_allowed_list)) # le fichier existe
94
							{
111
							{
95
							$tab=file($mac_allowed_list);
112
							$tab=file($mac_allowed_list);
96
							if ($tab) # le fichier n'est pas vide
113
							if ($tab) # le fichier n'est pas vide
Line 108... Line 125...
108
								}
125
								}
109
							}
126
							}
110
						else { echo "$l_error_open_file $mac_allowed_list";}
127
						else { echo "$l_error_open_file $mac_allowed_list";}
111
						echo "</TD><TD>&nbsp;";
128
						echo "</TD><TD>&nbsp;";
112
					}
129
					}
113
				# par usager authentifié
130
				# by user
114
					else {
131
					else {
115
						echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"Editer l'utilisateur $detail[5]\">$detail[5]</a>";
132
						echo "<a href=\"/acc/manager/htdocs/user_admin.php?login=$detail[5]\" title=\"Editer l'utilisateur $detail[5]\">$detail[5]</a>";
116
						echo "</TD>";
133
						echo "</TD>";
117
						echo "<TD>";
134
						echo "<TD>";
118
						echo "<INPUT type='hidden' name='action' value='user_disconnect'>";
135
						echo "<INPUT type='hidden' name='action' value='user_disconnect'>";
119
						echo "<INPUT type='hidden' name='user' value='$detail[5]'>";
136
						echo "<INPUT type='hidden' name='user' value='$detail[5]'>";
120
						echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
137
						echo "<INPUT type='hidden' name='mac_addr' value='$detail[0]'>";
121
						echo "<INPUT type=submit value='$l_disconnect'>";
138
						echo "<INPUT type=submit value='$l_disconnect'>";
122
						}
139
						}
123
					}
140
					}
124
				# station sans usager connecté
141
				# equipment without authenticated user
125
				else { 
142
				else { 
126
					echo "&nbsp;";
143
					echo "&nbsp;";
127
					echo "</TD>";
144
					echo "</TD>";
128
					echo "<TD>";
145
					echo "<TD>";
129
					echo "<INPUT type='hidden' name='action' value='mac_disconnect'>";
146
					echo "<INPUT type='hidden' name='action' value='mac_disconnect'>";