Subversion Repositories ALCASAR

Rev

Rev 872 | Rev 955 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 872 Rev 912
1
<?php
1
<?php
2
#
2
#
3
# status.php for Alcasar captive portal
3
# status.php for Alcasar captive portal
4
# by steweb57 & Rexy
4
# by steweb57 & Rexy
5
# 
5
# 
6
/****************************************************************
6
/****************************************************************
7
*			GLOBAL FILE PATHS			*
7
*			GLOBAL FILE PATHS			*
8
*****************************************************************/
8
*****************************************************************/
9
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
9
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
10
 
10
 
11
/****************************************************************
11
/****************************************************************
12
*				FILE TEST			*
12
*				FILE TEST			*
13
*****************************************************************/
13
*****************************************************************/
14
//Test de présence et des droits en lecture des fichiers de configuration.
14
//Test de présence et des droits en lecture des fichiers de configuration.
15
if (!file_exists(CONF_FILE)){
15
if (!file_exists(CONF_FILE)){
16
	exit("Fichier de configuration ".CONF_FILE." non présent");
16
	exit("Fichier de configuration ".CONF_FILE." non présent");
17
}
17
}
18
if (!is_readable(CONF_FILE)){
18
if (!is_readable(CONF_FILE)){
19
	exit("Vous n'avez pas les droits de lecture sur le fichier ".CONF_FILE);
19
	exit("Vous n'avez pas les droits de lecture sur le fichier ".CONF_FILE);
20
}
20
}
21
 
21
 
22
/****************************************************************
22
/****************************************************************
23
*			Read CONF_FILE				*
23
*			Read CONF_FILE				*
24
*****************************************************************/
24
*****************************************************************/
25
$ouvre=fopen(CONF_FILE,"r");
25
$ouvre=fopen(CONF_FILE,"r");
26
if ($ouvre){
26
if ($ouvre){
27
	while (!feof ($ouvre))
27
	while (!feof ($ouvre))
28
	{
28
	{
29
		$tampon = fgets($ouvre, 4096);
29
		$tampon = fgets($ouvre, 4096);
30
		if (strpos($tampon,"=")!==false){
30
		if (strpos($tampon,"=")!==false){
31
			$tmp = explode("=",$tampon);
31
			$tmp = explode("=",$tampon);
32
			$conf[$tmp[0]] = $tmp[1];
32
			$conf[$tmp[0]] = $tmp[1];
33
		}
33
		}
34
	}
34
	}
35
}else{
35
}else{
36
	exit("Erreur d'ouverture du fichier ".ALCASAR_ETH1);
36
	exit("Erreur d'ouverture du fichier ".ALCASAR_ETH1);
37
}
37
}
38
fclose($ouvre);
38
fclose($ouvre);
39
 
39
 
40
$organisme = $conf["ORGANISM"];
40
$organisme = $conf["ORGANISM"];
41
 
41
 
42
$remote_ip = ($_SERVER['REMOTE_ADDR']);
42
$remote_ip = ($_SERVER['REMOTE_ADDR']);
43
$connection_history =  "";
43
$connection_history =  "";
44
$nb_connection_history = 3;
44
$nb_connection_history = 3;
45
 
45
 
46
//On récupère le nom de connexion de la session active. //on a l'info en ajax, mais trop tard -> A MODIFIER
46
//On récupère le nom de connexion de la session active. //on a l'info en ajax, mais trop tard -> A MODIFIER
47
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
47
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
48
$user = explode (" ", $tab[0]);
48
$user = explode (" ", $tab[0]);
49
 
49
 
50
#### Affichage des 3 dernières connexions de $user[5]
50
#### Affichage des 3 dernières connexions de $user[5]
51
function secondsToDuration($seconds = null){
51
function secondsToDuration($seconds = null){
52
	if ($seconds == null) return "";
52
	if ($seconds == null) return "";
53
 
53
 
54
	$temp = $seconds % 3600;
54
	$temp = $seconds % 3600;
55
	$time[0] = ( $seconds - $temp ) / 3600 ;	// hours
55
	$time[0] = ( $seconds - $temp ) / 3600 ;	// hours
56
	$time[2] = $temp % 60 ;				// seconds
56
	$time[2] = $temp % 60 ;				// seconds
57
	$time[1] = ( $temp - $time[2] ) / 60;		// minutes
57
	$time[1] = ( $temp - $time[2] ) / 60;		// minutes
58
	
58
	
59
	return $time[0]." h ".$time[1]." m ".$time[2]." s";
59
	return $time[0]." h ".$time[1]." m ".$time[2]." s";
60
}
60
}
61
 
61
 
62
 
62
 
63
 
63
 
64
# Choice of language
64
# Choice of language
65
//reste quelques traductions à faire
65
//reste quelques traductions à faire
66
$Language = 'en';
66
$Language = 'en';
67
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
67
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
68
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
68
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
69
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
69
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
70
if($Language == 'es'){
70
if($Language == 'es'){
71
	$l_login1			= "El éxito de la autenticación";
71
	$l_login1			= "El éxito de la autenticación";
72
	$l_logout			= "Conexión de cierre";
72
	$l_logout			= "Conexión de cierre";
73
	$l_logout_question	= "Are you sure you want to disconnect now?";	//à traduire
73
	$l_logout_question	= "Are you sure you want to disconnect now?";	//à traduire
74
	$l_loggedout		= "Su sesión se cierra";
74
	$l_loggedout		= "Su sesión se cierra";
75
	$l_wait				= "Por favor, espere un momento ...";
75
	$l_wait				= "Por favor, espere un momento ...";
76
	$l_state_label				= "State";		//à traduire
76
	$l_state_label				= "State";		//à traduire
77
	$l_session_id_label			= "Session ID";	//à traduire
77
	$l_session_id_label			= "Session ID";	//à traduire
78
	$l_max_session_time_label	= "Max Session Time";	//à traduire
78
	$l_max_session_time_label	= "Max Session Time";	//à traduire
79
	$l_max_idle_time_label		= "Max Idle Time";		//à traduire
79
	$l_max_idle_time_label		= "Max Idle Time";		//à traduire
80
	$l_start_time_label			= "Start Time";	//à traduire
80
	$l_start_time_label			= "Start Time";	//à traduire
81
	$l_session_time_label		= "Tiempo de conexión";
81
	$l_session_time_label		= "Tiempo de conexión";
82
	$l_idle_time_label			= "Idle Time";	//à traduire
82
	$l_idle_time_label			= "Idle Time";	//à traduire
83
	$l_downloaded_label			= "Downloaded";	//à traduire
83
	$l_downloaded_label			= "Downloaded";	//à traduire
84
	$l_uploaded_label			= "Uploaded";	//à traduire
84
	$l_uploaded_label			= "Uploaded";	//à traduire
85
	$l_original_url_label		= "Original URL";	//à traduire
85
	$l_original_url_label		= "Original URL";	//à traduire
86
	$l_not_available			= "Not available";	//à traduire
86
	$l_not_available			= "Not available";	//à traduire
87
	$l_na						= "N/A";		//à traduire
87
	$l_na						= "N/A";		//à traduire
88
	$l_error					= "error";		//à traduire
88
	$l_error					= "error";		//à traduire
89
	$l_welcome					= "Welcome";	//à traduire
89
	$l_welcome					= "Welcome";	//à traduire
90
	$l_conn_history				= "Your last $nb_connection_history connections";	//à traduire
90
	$l_conn_history				= "Your last $nb_connection_history connections";	//à traduire
91
	$l_connected 			= "logged"; //à traduire
91
	$l_connected 			= "logged"; //à traduire
92
	$l_a_connection			= "Active connection detected on LAN"; //à traduire
92
	$l_a_connection			= "Active connection detected on LAN"; //à traduire
93
	$l_a_connection_time		= "time(s)"; //à traduire
93
	$l_a_connection_time		= "time(s)"; //à traduire
94
}
94
}
-
 
95
else if ($Language == 'pt'){
-
 
96
	$l_login1			= "Autenticação bem sucedida.";
-
 
97
	$l_logout			= "Fechando a conexão";
-
 
98
	$l_logout_question	= "Tem certeza de que deseja desconectar agora?";
-
 
99
	$l_loggedout		= "Sua conexão foi fechada";
-
 
100
	$l_wait				= "Por favor, aguarde um momento ...";
-
 
101
	$l_state_label				= "Estado";
-
 
102
	$l_session_id_label			= "Sessão ID";
-
 
103
	$l_max_session_time_label	= "Tempo da Sessão Max";
-
 
104
	$l_max_idle_time_label		= "Hora Max Idle";
-
 
105
	$l_start_time_label			= "Inicio de hora";
-
 
106
	$l_session_time_label		= "Tempo de Sessão";
-
 
107
	$l_idle_time_label			= "Tempo de Espera";
-
 
108
	$l_downloaded_label			= "Transferido";
-
 
109
	$l_uploaded_label			= "Carregado";
-
 
110
	$l_original_url_label		= "URL Original";
-
 
111
	$l_not_available			= "Não disponível";
-
 
112
	$l_na						= "N/A";
-
 
113
	$l_error					= "Erro";
-
 
114
	$l_welcome					= "Bem vindo";
-
 
115
	$l_conn_history				= "Suas últimos conexões R $nb_connection_history";
-
 
116
	$l_connected 			= "Logado"; 
-
 
117
	$l_a_connection			= "Conexão ativa detectada na LAN";
-
 
118
	$l_a_connection_time		= "Tempo (s)";
-
 
119
}
95
else if($Language == 'de'){
120
else if($Language == 'de'){
96
	$l_login1			= "Erfolgreiche Authentifizierung";
121
	$l_login1			= "Erfolgreiche Authentifizierung";
97
	$l_logout			= "Beenden der Verbindung";
122
	$l_logout			= "Beenden der Verbindung";
98
	$l_logout_question	= "Are you sure you want to disconnect now?";	//à traduire
123
	$l_logout_question	= "Are you sure you want to disconnect now?";	//à traduire
99
	$l_loggedout		= "Ihre Sitzung ist geschlossen";
124
	$l_loggedout		= "Ihre Sitzung ist geschlossen";
100
	$l_wait				= "Bitte warten Sie einen Moment ...";
125
	$l_wait				= "Bitte warten Sie einen Moment ...";
101
	$l_state_label				= "State";		//à traduire
126
	$l_state_label				= "State";		//à traduire
102
	$l_session_id_label			= "Session ID";	//à traduire
127
	$l_session_id_label			= "Session ID";	//à traduire
103
	$l_max_session_time_label	= "Max Session Time";	//à traduire
128
	$l_max_session_time_label	= "Max Session Time";	//à traduire
104
	$l_max_idle_time_label		= "Max Idle Time";		//à traduire
129
	$l_max_idle_time_label		= "Max Idle Time";		//à traduire
105
	$l_start_time_label			= "Start Time";	//à traduire
130
	$l_start_time_label			= "Start Time";	//à traduire
106
	$l_session_time_label		= "Online-zeit";
131
	$l_session_time_label		= "Online-zeit";
107
	$l_idle_time_label			= "Idle Time";	//à traduire
132
	$l_idle_time_label			= "Idle Time";	//à traduire
108
	$l_downloaded_label			= "Downloaded";	//à traduire
133
	$l_downloaded_label			= "Downloaded";	//à traduire
109
	$l_uploaded_label			= "Uploaded";	//à traduire
134
	$l_uploaded_label			= "Uploaded";	//à traduire
110
	$l_original_url_label		= "Original URL";	//à traduire
135
	$l_original_url_label		= "Original URL";	//à traduire
111
	$l_not_available			= "Not available";	//à traduire
136
	$l_not_available			= "Not available";	//à traduire
112
	$l_na						= "N/A";		//à traduire
137
	$l_na						= "N/A";		//à traduire
113
	$l_error					= "error";		//à traduire
138
	$l_error					= "error";		//à traduire
114
	$l_welcome					= "Welcome"; 	//à traduire
139
	$l_welcome					= "Welcome"; 	//à traduire
115
	$l_conn_history				= "Your last $nb_connection_history connections";	//à traduire
140
	$l_conn_history				= "Your last $nb_connection_history connections";	//à traduire
116
	$l_connected 			= "logged"; //à traduire 
141
	$l_connected 			= "logged"; //à traduire 
117
	$l_a_connection			= "Active connection detected on LAN"; //à traduire
142
	$l_a_connection			= "Active connection detected on LAN"; //à traduire
118
	$l_a_connection_time		= "time(s)"; //à traduire
143
	$l_a_connection_time		= "time(s)"; //à traduire
119
}
144
}
120
else if($Language == 'nl'){
145
else if($Language == 'nl'){
121
	$l_login1			= "Succesvolle authenticatie";
146
	$l_login1			= "Succesvolle authenticatie";
122
	$l_logout			= "Slotkoers verbinding";
147
	$l_logout			= "Slotkoers verbinding";
123
	$l_logout_question	= "Are you sure you want to disconnect now?";	//à traduire
148
	$l_logout_question	= "Are you sure you want to disconnect now?";	//à traduire
124
	$l_loggedout		= "Uw sessie is gesloten";
149
	$l_loggedout		= "Uw sessie is gesloten";
125
	$l_wait				= "Wacht een moment ...";
150
	$l_wait				= "Wacht een moment ...";
126
	$l_state_label				= "State";		//à traduire
151
	$l_state_label				= "State";		//à traduire
127
	$l_session_id_label			= "Session ID";	//à traduire
152
	$l_session_id_label			= "Session ID";	//à traduire
128
	$l_max_session_time_label	= "Max Session Time";	//à traduire
153
	$l_max_session_time_label	= "Max Session Time";	//à traduire
129
	$l_max_idle_time_label		= "Max Idle Time";		//à traduire
154
	$l_max_idle_time_label		= "Max Idle Time";		//à traduire
130
	$l_start_time_label			= "Start Time";	//à traduire
155
	$l_start_time_label			= "Start Time";	//à traduire
131
	$l_session_time_label		= "Online tijd";
156
	$l_session_time_label		= "Online tijd";
132
	$l_idle_time_label			= "Idle Time";	//à traduire
157
	$l_idle_time_label			= "Idle Time";	//à traduire
133
	$l_downloaded_label			= "Downloaded";	//à traduire
158
	$l_downloaded_label			= "Downloaded";	//à traduire
134
	$l_uploaded_label			= "Uploaded";	//à traduire
159
	$l_uploaded_label			= "Uploaded";	//à traduire
135
	$l_original_url_label		= "Original URL";	//à traduire
160
	$l_original_url_label		= "Original URL";	//à traduire
136
	$l_not_available			= "Not available";	//à traduire
161
	$l_not_available			= "Not available";	//à traduire
137
	$l_na						= "N/A";		//à traduire
162
	$l_na						= "N/A";		//à traduire
138
	$l_error					= "error";		//à traduire
163
	$l_error					= "error";		//à traduire
139
	$l_welcome					= "Welcome";	//à traduire
164
	$l_welcome					= "Welcome";	//à traduire
140
	$l_conn_history				= "Your last $nb_connection_history connections";	//à traduire
165
	$l_conn_history				= "Your last $nb_connection_history connections";	//à traduire
141
	$l_connected 			= "logged"; //à traduire 
166
	$l_connected 			= "logged"; //à traduire 
142
	$l_a_connection			= "Active connection detected on LAN"; //à traduire
167
	$l_a_connection			= "Active connection detected on LAN"; //à traduire
143
	$l_a_connection_time		= "time(s)"; //à traduire
168
	$l_a_connection_time		= "time(s)"; //à traduire
144
}
169
}
145
else if($Language == 'fr'){
170
else if($Language == 'fr'){
146
	$l_login1			= "Authentification r&eacute;ussie";
171
	$l_login1			= "Authentification r&eacute;ussie";
147
	$l_logout			= "Fermeture de la session";
172
	$l_logout			= "Fermeture de la session";
148
	$l_logout_question	= "Etes vous sûr de vouloir vous déconnecter?";
173
	$l_logout_question	= "Etes vous sûr de vouloir vous déconnecter?";
149
	$l_loggedout		= "Votre session est fermée";
174
	$l_loggedout		= "Votre session est fermée";
150
	$l_wait				= "Patientez un instant ....";
175
	$l_wait				= "Patientez un instant ....";
151
	$l_state_label				= "Etat";
176
	$l_state_label				= "Etat";
152
	$l_session_id_label			= "Session ID";
177
	$l_session_id_label			= "Session ID";
153
	$l_max_session_time_label	= "Temps de connexion autoris&eacute";
178
	$l_max_session_time_label	= "Temps de connexion autoris&eacute";
154
	$l_max_idle_time_label		= "Inactivit&eacute; max. autoris&eacute;e";
179
	$l_max_idle_time_label		= "Inactivit&eacute; max. autoris&eacute;e";
155
	$l_start_time_label			= "D&eacute;but de connexion";
180
	$l_start_time_label			= "D&eacute;but de connexion";
156
	$l_session_time_label		= "Dur&eacute;e de connexion";
181
	$l_session_time_label		= "Dur&eacute;e de connexion";
157
	$l_idle_time_label			= "Inactivit&eacute;";
182
	$l_idle_time_label			= "Inactivit&eacute;";
158
	$l_downloaded_label			= "Donn&eacute;es t&eacute;l&eacute;charg&eacute;es";
183
	$l_downloaded_label			= "Donn&eacute;es t&eacute;l&eacute;charg&eacute;es";
159
	$l_uploaded_label			= "Donn&eacute;es envoy&eacute;es";
184
	$l_uploaded_label			= "Donn&eacute;es envoy&eacute;es";
160
	$l_original_url_label		= "URL demand&eacute;e";
185
	$l_original_url_label		= "URL demand&eacute;e";
161
	$l_not_available			= "Non disponible";
186
	$l_not_available			= "Non disponible";
162
	$l_na						= "N/D";	//à traduire
187
	$l_na						= "N/D";	//à traduire
163
	$l_error					= "erreur";
188
	$l_error					= "erreur";
164
	$l_welcome					= "Bienvenue";
189
	$l_welcome					= "Bienvenue";
165
	$l_conn_history				= "Vos $nb_connection_history derni&egrave;res connexions";
190
	$l_conn_history				= "Vos $nb_connection_history derni&egrave;res connexions";
166
	$l_connected 			= "session active";  
191
	$l_connected 			= "session active";  
167
	$l_a_connection			= "Vous &ecirc;tes d&eacute;j&agrave; connect&eacute; sur le r&eacute;seau";
192
	$l_a_connection			= "Vous &ecirc;tes d&eacute;j&agrave; connect&eacute; sur le r&eacute;seau";
168
	$l_a_connection_time		= "fois";
193
	$l_a_connection_time		= "fois";
169
}
194
}
170
else {
195
else {
171
	$l_login1			= "Successful authentication.";
196
	$l_login1			= "Successful authentication.";
172
	$l_logout			= "Closing connection";
197
	$l_logout			= "Closing connection";
173
	$l_logout_question	= "Are you sure you want to disconnect now?";
198
	$l_logout_question	= "Are you sure you want to disconnect now?";
174
	$l_loggedout		= "Your session is closed";
199
	$l_loggedout		= "Your session is closed";
175
	$l_wait				= "Please wait a moment ...";
200
	$l_wait				= "Please wait a moment ...";
176
	$l_state_label				= "State";
201
	$l_state_label				= "State";
177
	$l_session_id_label			= "Session ID";
202
	$l_session_id_label			= "Session ID";
178
	$l_max_session_time_label	= "Max Session Time";
203
	$l_max_session_time_label	= "Max Session Time";
179
	$l_max_idle_time_label		= "Max Idle Time";
204
	$l_max_idle_time_label		= "Max Idle Time";
180
	$l_start_time_label			= "Start Time";
205
	$l_start_time_label			= "Start Time";
181
	$l_session_time_label		= "Session Time";
206
	$l_session_time_label		= "Session Time";
182
	$l_idle_time_label			= "Idle Time";
207
	$l_idle_time_label			= "Idle Time";
183
	$l_downloaded_label			= "Downloaded";
208
	$l_downloaded_label			= "Downloaded";
184
	$l_uploaded_label			= "Uploaded";
209
	$l_uploaded_label			= "Uploaded";
185
	$l_original_url_label		= "Original URL";
210
	$l_original_url_label		= "Original URL";
186
	$l_not_available			= "Not available";
211
	$l_not_available			= "Not available";
187
	$l_na						= "N/A";
212
	$l_na						= "N/A";
188
	$l_error					= "error";
213
	$l_error					= "error";
189
	$l_welcome					= "Welcome";
214
	$l_welcome					= "Welcome";
190
	$l_conn_history				= "Your last $nb_connection_history connections";
215
	$l_conn_history				= "Your last $nb_connection_history connections";
191
	$l_connected 			= "logged"; 
216
	$l_connected 			= "logged"; 
192
	$l_a_connection			= "Active connection detected on LAN";
217
	$l_a_connection			= "Active connection detected on LAN";
193
	$l_a_connection_time		= "time(s)";
218
	$l_a_connection_time		= "time(s)";
194
}
219
}
195
 
220
 
196
// si on a pas d'accès à la bdd, la page s'affiche quand même correctement
221
// si on a pas d'accès à la bdd, la page s'affiche quand même correctement
197
if (isset($user[5])){
222
if (isset($user[5])){
198
	if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
223
	if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
199
		include_once("/etc/freeradius-web/config.php");
224
		include_once("/etc/freeradius-web/config.php");
200
		include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
225
		include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
201
		
226
		
202
		$sql = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' ORDER BY AcctStartTime DESC LIMIT 0 , $nb_connection_history";
227
		$sql = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' ORDER BY AcctStartTime DESC LIMIT 0 , $nb_connection_history";
203
		$link = @da_sql_pconnect($config); // on affiche pas les erreurs
228
		$link = @da_sql_pconnect($config); // on affiche pas les erreurs
204
		
229
		
205
		if ($link){
230
		if ($link){
206
			$res = @da_sql_query($link,$config,$sql); // on affiche pas les erreurs
231
			$res = @da_sql_query($link,$config,$sql); // on affiche pas les erreurs
207
			
232
			
208
			if ($res){
233
			if ($res){
209
				$connection_history.= "<ul>";
234
				$connection_history.= "<ul>";
210
				while(($row = @da_sql_fetch_array($res,$config))){
235
				while(($row = @da_sql_fetch_array($res,$config))){
211
					$connected = "";
236
					$connected = "";
212
					$start_conn = date_create($row['acctstarttime']);
237
					$start_conn = date_create($row['acctstarttime']);
213
					$connection_history.="<li>".date_format($start_conn, 'd M Y - H:i:s')." - (";
238
					$connection_history.="<li>".date_format($start_conn, 'd M Y - H:i:s')." - (";
214
					if ($row['acctstoptime'] == "") {
239
					if ($row['acctstoptime'] == "") {
215
						$connected = $l_connected;
240
						$connected = $l_connected;
216
					}else{
241
					}else{
217
						$connected = secondsToDuration($row['acctsessiontime']);
242
						$connected = secondsToDuration($row['acctsessiontime']);
218
					}
243
					}
219
					$connection_history.= "$connected)</li>";
244
					$connection_history.= "$connected)</li>";
220
//					$connection_history.="<li>".date_format($start_conn, 'd M Y - H:i:s')." - (".secondsToDuration($row[acctsessiontime]).") $connected</li>";
245
//					$connection_history.="<li>".date_format($start_conn, 'd M Y - H:i:s')." - (".secondsToDuration($row[acctsessiontime]).") $connected</li>";
221
				}
246
				}
222
				$connection_history.="</ul>";
247
				$connection_history.="</ul>";
223
			}
248
			}
224
		}
249
		}
225
		$sql_2 = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' AND AcctStopTime IS NULL ORDER BY AcctStartTime DESC";
250
		$sql_2 = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' AND AcctStopTime IS NULL ORDER BY AcctStartTime DESC";
226
		$link_2 = @da_sql_pconnect($config); // on affiche pas les erreurs
251
		$link_2 = @da_sql_pconnect($config); // on affiche pas les erreurs
227
		
252
		
228
		if ($link_2){
253
		if ($link_2){
229
			$res_2 = @da_sql_query($link_2,$config,$sql_2); // on affiche pas les erreurs
254
			$res_2 = @da_sql_query($link_2,$config,$sql_2); // on affiche pas les erreurs
230
			$a_connection = "";
255
			$a_connection = "";
231
			if ($res_2){
256
			if ($res_2){
232
				while(($row_2 = @da_sql_fetch_array($res_2,$config))){
257
				while(($row_2 = @da_sql_fetch_array($res_2,$config))){
233
					$a_connected = 1;
258
					$a_connected = 1;
234
					if ($row_2['acctstoptime'] == "") $a_connected = $a_connected + 1;
259
					if ($row_2['acctstoptime'] == "") $a_connected = $a_connected + 1;
235
				}
260
				}
236
				if ($a_connected > 1){
261
				if ($a_connected > 1){
237
					$a_connection = $l_a_connection." ".$a_connected." ".$l_a_connection_time;
262
					$a_connection = $l_a_connection." ".$a_connected." ".$l_a_connection_time;
238
				}
263
				}
239
			}
264
			}
240
		}
265
		}
241
	}
266
	}
242
}
267
}
243
?>
268
?>
244
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
269
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
245
<html lang="fr">
270
<html lang="fr">
246
<!-- written by steweb57 -->
271
<!-- written by steweb57 -->
247
	<head>
272
	<head>
248
		<title>Alcasar - <?php echo $organisme; ?></title>
273
		<title>Alcasar - <?php echo $organisme; ?></title>
249
		<meta http-equiv="Cache-control" content="no-cache">
274
		<meta http-equiv="Cache-control" content="no-cache">
250
		<meta http-equiv="Pragma" content="no-cache">
275
		<meta http-equiv="Pragma" content="no-cache">
251
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
276
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
252
		<script type="text/javascript" src="./js/ChilliLibrary.js"></script>
277
		<script type="text/javascript" src="./js/ChilliLibrary.js"></script>
253
		<script type="text/javascript" src="./js/statusControler.js"></script>
278
		<script type="text/javascript" src="./js/statusControler.js"></script>
254
		<link type="text/css" href="./css/status.css" rel="stylesheet">
279
		<link type="text/css" href="./css/status.css" rel="stylesheet">
255
	</head>
280
	</head>
256
	<body>
281
	<body>
257
		<div id="Chilli">
282
		<div id="Chilli">
258
		<div id="locationName"></div>
283
		<div id="locationName"></div>
259
		<div id="chilliPage">
284
		<div id="chilliPage">
260
		<div id="loggedOutPage" class="c1">
285
		<div id="loggedOutPage" class="c1">
261
			<table id="disconnectTable">
286
			<table id="disconnectTable">
262
				<tr>
287
				<tr>
263
					<td><img height="150" src="./images/logo-alcasar.png" alt="logo"></td>
288
					<td><img height="150" src="./images/logo-alcasar.png" alt="logo"></td>
264
					<td><p class="text_auth"><?php echo $l_loggedout; ?></p></td>
289
					<td><p class="text_auth"><?php echo $l_loggedout; ?></p></td>
265
				</tr>
290
				</tr>
266
			</table>
291
			</table>
267
		</div>
292
		</div>
268
		<div id="statusPage" class="c1">
293
		<div id="statusPage" class="c1">
269
			<table border="0" id="statusTable">
294
			<table border="0" id="statusTable">
270
				<tr>
295
				<tr>
271
					<td colspan="2">
296
					<td colspan="2">
272
						<table border="0" cellpadding="0" cellspacing="0" width="100%">
297
						<table border="0" cellpadding="0" cellspacing="0" width="100%">
273
							<tr>
298
							<tr>
274
								<td valign="top" rowspan="4">
299
								<td valign="top" rowspan="4">
275
									<img height="150" src="./images/logo-alcasar.png" alt="logo">
300
									<img height="150" src="./images/logo-alcasar.png" alt="logo">
276
								</td>
301
								</td>
277
								<td class="text_auth_welcom">
302
								<td class="text_auth_welcom">
278
									<?php echo $l_login1; ?>
303
									<?php echo $l_login1; ?>
279
								</td>
304
								</td>
280
							</tr>
305
							</tr>
281
							<tr>
306
							<tr>
282
								<td class="text_auth">
307
								<td class="text_auth">
283
									<?php echo $l_welcome; ?>
308
									<?php echo $l_welcome; ?>
284
									<br><span id="userName"></span>
309
									<br><span id="userName"></span>
285
								</td>
310
								</td>
286
							</tr>
311
							</tr>
287
							<tr>
312
							<tr>
288
								<td class="alert">
313
								<td class="alert">
289
									<?php echo $a_connection; ?>
314
									<?php echo $a_connection; ?>
290
								</td>
315
								</td>
291
							</tr>
316
							</tr>
292
							<tr>
317
							<tr>
293
								<td colspan="2" align="center" class="link_logout">
318
								<td colspan="2" align="center" class="link_logout">
294
									<a href="#" onclick="return logoutWithConfirmation('<?php echo $l_logout_question;?>');" class="lien_deco"><?php echo $l_logout; ?></a>
319
									<a href="#" onclick="return logoutWithConfirmation('<?php echo $l_logout_question;?>');" class="lien_deco"><?php echo $l_logout; ?></a>
295
								</td>
320
								</td>
296
							</tr>
321
							</tr>
297
						</table>
322
						</table>
298
					</td>
323
					</td>
299
				</tr>
324
				</tr>
300
<!--tr id="connectRow">
325
<!--tr id="connectRow">
301
<td id="statusMessageLabel" class="chilliLabel"><strong><?php echo $l_state_label; ?></strong></td>
326
<td id="statusMessageLabel" class="chilliLabel"><strong><?php echo $l_state_label; ?></strong></td>
302
<td id="statusMessage" class="chilliValue">Connected</td>
327
<td id="statusMessage" class="chilliValue">Connected</td>
303
</tr-->
328
</tr-->
304
<!--tr id="sessionIdRow">
329
<!--tr id="sessionIdRow">
305
<td id="sessionIdLabel" class="chilliLabel"><strong><?php echo $l_session_id_label; ?></strong></td>
330
<td id="sessionIdLabel" class="chilliLabel"><strong><?php echo $l_session_id_label; ?></strong></td>
306
<td id="sessionId" class="chilliValue"><?php echo $l_not_available; ?></td>
331
<td id="sessionId" class="chilliValue"><?php echo $l_not_available; ?></td>
307
</tr-->
332
</tr-->
308
				<tr id="sessionTimeoutRow">
333
				<tr id="sessionTimeoutRow">
309
					<td id="sessionTimeoutLabel" class="chilliLabel"><?php echo $l_max_session_time_label; ?></td>
334
					<td id="sessionTimeoutLabel" class="chilliLabel"><?php echo $l_max_session_time_label; ?></td>
310
					<td id="sessionTimeout" class="chilliValue"><?php echo $l_not_available; ?></td>
335
					<td id="sessionTimeout" class="chilliValue"><?php echo $l_not_available; ?></td>
311
				</tr>
336
				</tr>
312
				<tr id="idleTimeoutRow">
337
				<tr id="idleTimeoutRow">
313
					<td id="idleTimeoutLabel" class="chilliLabel"><?php echo $l_max_idle_time_label; ?></td>
338
					<td id="idleTimeoutLabel" class="chilliLabel"><?php echo $l_max_idle_time_label; ?></td>
314
					<td id="idleTimeout" class="chilliValue"><?php echo $l_not_available; ?></td>
339
					<td id="idleTimeout" class="chilliValue"><?php echo $l_not_available; ?></td>
315
				</tr>
340
				</tr>
316
				<tr id="startTimeRow">
341
				<tr id="startTimeRow">
317
					<td id="startTimeLabel" class="chilliLabel"><?php echo $l_start_time_label; ?></td>
342
					<td id="startTimeLabel" class="chilliLabel"><?php echo $l_start_time_label; ?></td>
318
					<td id="startTime" class="chilliValue"><?php echo $l_not_available; ?></td>
343
					<td id="startTime" class="chilliValue"><?php echo $l_not_available; ?></td>
319
				</tr>
344
				</tr>
320
				<tr id="sessionTimeRow">
345
				<tr id="sessionTimeRow">
321
					<td id="sessionTimeLabel" class="chilliLabel"><?php echo $l_session_time_label; ?></td>
346
					<td id="sessionTimeLabel" class="chilliLabel"><?php echo $l_session_time_label; ?></td>
322
					<td id="sessionTime" class="chilliValue"><?php echo $l_not_available; ?></td>
347
					<td id="sessionTime" class="chilliValue"><?php echo $l_not_available; ?></td>
323
				</tr>
348
				</tr>
324
				<tr id="idleTimeRow">
349
				<tr id="idleTimeRow">
325
					<td id="idleTimeLabel" class="chilliLabel"><?php echo $l_idle_time_label; ?></td>
350
					<td id="idleTimeLabel" class="chilliLabel"><?php echo $l_idle_time_label; ?></td>
326
					<td id="idleTime" class="chilliValue"><?php echo $l_not_available; ?></td>
351
					<td id="idleTime" class="chilliValue"><?php echo $l_not_available; ?></td>
327
				</tr>
352
				</tr>
328
				<tr id="inputOctetsRow">
353
				<tr id="inputOctetsRow">
329
					<td id="inputOctetsLabel" class="chilliLabel"><?php echo $l_downloaded_label; ?></td>
354
					<td id="inputOctetsLabel" class="chilliLabel"><?php echo $l_downloaded_label; ?></td>
330
					<td id="inputOctets" class="chilliValue"><?php echo $l_na; ?></td>
355
					<td id="inputOctets" class="chilliValue"><?php echo $l_na; ?></td>
331
				</tr>
356
				</tr>
332
				<tr id="outputOctetsRow">
357
				<tr id="outputOctetsRow">
333
					<td id="outputOctetsLabel" class="chilliLabel"><?php echo $l_uploaded_label; ?></td>
358
					<td id="outputOctetsLabel" class="chilliLabel"><?php echo $l_uploaded_label; ?></td>
334
					<td id="outputOctets" class="chilliValue"><?php echo $l_na; ?></td>
359
					<td id="outputOctets" class="chilliValue"><?php echo $l_na; ?></td>
335
				</tr>
360
				</tr>
336
<!--tr id="originalURLRow">
361
<!--tr id="originalURLRow">
337
<td id="originalURLLabel" class="chilliLabel"><?php echo $l_original_url_label; ?></td>
362
<td id="originalURLLabel" class="chilliLabel"><?php echo $l_original_url_label; ?></td>
338
<td id="originalURL" class="chilliValue"><?php echo $l_na; ?></td>
363
<td id="originalURL" class="chilliValue"><?php echo $l_na; ?></td>
339
</tr-->
364
</tr-->
340
				<tr>
365
				<tr>
341
					<td colspan=2 id="conHistoryLabel" class="chilliLabel"><?php echo $l_conn_history; ?></td>
366
					<td colspan=2 id="conHistoryLabel" class="chilliLabel"><?php echo $l_conn_history; ?></td>
342
				</tr>
367
				</tr>
343
				<tr id="conHistoryRow">
368
				<tr id="conHistoryRow">
344
					<td colspan=2 id="conHistory" class="chilliValue"><?php echo $connection_history; ?></td>
369
					<td colspan=2 id="conHistory" class="chilliValue"><?php echo $connection_history; ?></td>
345
				</tr>
370
				</tr>
346
			</table>
371
			</table>
347
		</div>
372
		</div>
348
		<div id="waitPage">
373
		<div id="waitPage">
349
			<table id="waitTable">
374
			<table id="waitTable">
350
				<tr>
375
				<tr>
351
					<td><img height="150" src="./images/logo-alcasar.png" alt="logo"></td>
376
					<td><img height="150" src="./images/logo-alcasar.png" alt="logo"></td>
352
					<td><p class="text_auth"><img src="./images/wait.gif" width="16" height="16" class="wait" alt="<?php echo $l_wait; ?>"><?php echo $l_wait; ?></p></td>
377
					<td><p class="text_auth"><img src="./images/wait.gif" width="16" height="16" class="wait" alt="<?php echo $l_wait; ?>"><?php echo $l_wait; ?></p></td>
353
				</tr>
378
				</tr>
354
			</table>
379
			</table>
355
		</div>
380
		</div>
356
		<div id="errorPage">
381
		<div id="errorPage">
357
			<table id="errorTable">
382
			<table id="errorTable">
358
				<tr>
383
				<tr>
359
					<td><img height="150" src="./images/logo-alcasar.png" alt="logo"></td>
384
					<td><img height="150" src="./images/logo-alcasar.png" alt="logo"></td>
360
					<td><span id="errorMessage"><?php echo $l_error; ?></span></td>
385
					<td><span id="errorMessage"><?php echo $l_error; ?></span></td>
361
				</tr>
386
				</tr>
362
			</table>
387
			</table>
363
		</div>
388
		</div>
364
		</div>
389
		</div>
365
<!--div id="debugPage" style="display:inline;">
390
<!--div id="debugPage" style="display:inline;">
366
<textarea id="debugarea" rows="20" cols="60">
391
<textarea id="debugarea" rows="20" cols="60">
367
</textarea>
392
</textarea>
368
</div-->
393
</div-->
369
		</div>
394
		</div>
370
	</body>
395
	</body>
371
</html>
396
</html>
372
 
397