Subversion Repositories ALCASAR

Rev

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

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