Subversion Repositories ALCASAR

Rev

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

Rev 897 Rev 913
1
<?php
1
<?php
2
#
2
#
3
# intercept.php for Alcasar captive portal
3
# intercept.php for Alcasar captive portal
4
# Copyright (C) 2003, 2004 Mondru AB.
4
# Copyright (C) 2003, 2004 Mondru AB.
5
# Modify by REXY & steweb57
5
# Modify by REXY & steweb57
6
# UI & css style by stephane ERARD
6
# UI & css style by stephane ERARD
7
# Help for language translation by B. AUBARD (thanks)
7
# Help for language translation by B. AUBARD (thanks)
8
 
8
 
9
# The contents of this file may be used under the terms of the GNU
9
# The contents of this file may be used under the terms of the GNU
10
# General Public License Version 2, provided that the above copyright
10
# General Public License Version 2, provided that the above copyright
11
# notice and this permission notice is included in all copies or
11
# notice and this permission notice is included in all copies or
12
# substantial portions of the software.
12
# substantial portions of the software.
13
 
13
 
14
# Redirects from CoovaChilli (chilli daemon) :
14
# Redirects from CoovaChilli (chilli daemon) :
15
# Response to login:
15
# Response to login:
16
  # success :	if login successful
16
  # success :	if login successful
17
  # failed :	if login failed
17
  # failed :	if login failed
18
  # logoff :	if logout successful
18
  # logoff :	if logout successful
19
  # already :	if tried to login while already logged in
19
  # already :	if tried to login while already logged in
20
  # notyet :	if not logged in yet
20
  # notyet :	if not logged in yet
21
  # Default :	it was not a form request -> client go to login form
21
  # Default :	it was not a form request -> client go to login form
22
 
22
 
23
/****************************************************************
23
/****************************************************************
24
*			GLOBAL FILE PATHS			*
24
*			GLOBAL FILE PATHS			*
25
*****************************************************************/
25
*****************************************************************/
26
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
26
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
-
 
27
define ("DOMAIN_ALLOWED_LIST", "/usr/local/etc/alcasar-uamdomain");
27
 
28
 
28
/****************************************************************
29
/****************************************************************
29
*				FILE TEST			*
30
*				FILE TEST			*
30
*****************************************************************/
31
*****************************************************************/
31
//Test de présence et des droits en lecture des fichiers de configuration.
32
//Test de présence et des droits en lecture des fichiers de configuration.
32
if (!file_exists(CONF_FILE)){
33
if (!file_exists(CONF_FILE)){
33
	exit("Fichier de configuration ".CONF_FILE." non présent");
34
	exit("Fichier de configuration ".CONF_FILE." non présent");
34
}
35
}
35
if (!is_readable(CONF_FILE)){
36
if (!is_readable(CONF_FILE)){
36
	exit("Vous n'avez pas les droits de lecture sur le fichier ".CONF_FILE);
37
	exit("Vous n'avez pas les droits de lecture sur le fichier ".CONF_FILE);
37
}
38
}
38
 
39
 
-
 
40
//Test de présence de domaine ou IP accessibles sans authentificaion
-
 
41
$conf_files=array(DOMAIN_ALLOWED_LIST);
-
 
42
foreach ($conf_files as $file){
-
 
43
	if (!file_exists($file)){
-
 
44
		exit("Fichier ".$file." non présent");
-
 
45
	}
-
 
46
	if (!is_readable($file)){
-
 
47
		exit("Vous n'avez pas les droits de lecture sur le fichier ".$file);
-
 
48
	}
-
 
49
}
39
/****************************************************************
50
/****************************************************************
40
*			Read CONF_FILE				*
51
*			Read CONF_FILE				*
41
*****************************************************************/
52
*****************************************************************/
42
$ouvre=fopen(CONF_FILE,"r");
53
$ouvre=fopen(CONF_FILE,"r");
43
if ($ouvre){
54
if ($ouvre){
44
	while (!feof ($ouvre))
55
	while (!feof ($ouvre))
45
	{
56
	{
46
		$tampon = fgets($ouvre, 4096);
57
		$tampon = fgets($ouvre, 4096);
47
		if (strpos($tampon,"=")!==false){
58
		if (strpos($tampon,"=")!==false){
48
			$tmp = explode("=",$tampon);
59
			$tmp = explode("=",$tampon);
49
			$conf[$tmp[0]] = $tmp[1];
60
			$conf[$tmp[0]] = $tmp[1];
50
		}
61
		}
51
	}
62
	}
52
}else{
63
}else{
53
	exit("Erreur d'ouverture du fichier ".ALCASAR_ETH1);
64
	exit("Erreur d'ouverture du fichier ".ALCASAR_ETH1);
54
}
65
}
55
fclose($ouvre);
66
fclose($ouvre);
56
 
67
 
57
$organisme = $conf["ORGANISM"];
68
$organisme = $conf["ORGANISM"];
58
 
69
 
59
# Shared secret used to encrypt challenge with radius.
70
# Shared secret used to encrypt challenge with radius.
60
$uamsecret = "";
71
$uamsecret = "ZHoGm7No";
61
 
72
 
62
# URL loaded after success authenticates (let blank for browser defaults)
73
# URL loaded after success authenticates (let blank for browser defaults)
63
$adminurl = "";
74
$adminurl = "";
64
 
75
 
65
# Our own path
76
# Our own path
66
$loginpath	= $_SERVER['PHP_SELF'];
77
$loginpath	= $_SERVER['PHP_SELF'];
67
$alcasarpath = "http://alcasar";
78
$alcasarpath = "http://alcasar";
68
$statuspath = $alcasarpath."/status.php";
79
$statuspath = $alcasarpath."/status.php";
69
$debug		= false;
80
$debug		= false;
70
 
81
 
-
 
82
# Domain and url allowed without authentication
-
 
83
$domain_allowed_list="/usr/local/etc/alcasar-uamdomain";
-
 
84
$url_allowed_list="/usr/local/etc/alcasar-uamallowed";
-
 
85
 
71
# Choice of language
86
# Choice of language
72
$Language = 'en';
87
$Language = 'en';
73
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
88
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
74
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
89
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
75
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
90
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
76
if($Language == 'es'){
91
if($Language == 'es'){
77
  $l_ChilliError	= "La autenticación debe ser un éxito a través del servicio de portal cautivo.";
92
  $l_ChilliError	= "La autenticación debe ser un éxito a través del servicio de portal cautivo.";
78
  $l_login		= "El éxito de la autenticación.<HR>Cierre esta ventana interrumpte la sesion.";
93
  $l_login		= "El éxito de la autenticación.<HR>Cierre esta ventana interrumpte la sesion.";
79
  $l_logout		= "Conexión de cierre";
94
  $l_logout		= "Conexión de cierre";
80
  $l_loginfailed	= "Error de autenticación";
95
  $l_loginfailed	= "Error de autenticación";
81
  $l_loggingin		= "Identificación en el portal cautivo";
96
  $l_loggingin		= "Identificación en el portal cautivo";
82
  $l_loggedcont		= "Control de Acceso";
97
  $l_loggedcont		= "Control de Acceso";
83
  $l_loggedout		= "Su sesión se cierra";
98
  $l_loggedout		= "Su sesión se cierra";
84
  $l_user		= "Usuario";
99
  $l_user		= "Usuario";
85
  $l_password		= "Contraseña";
100
  $l_password		= "Contraseña";
86
  $l_wait		= "Por favor, espere un momento ...";
101
  $l_wait		= "Por favor, espere un momento ...";
87
  $l_onlinetime		= "Tiempo de conexión:";
102
  $l_onlinetime		= "Tiempo de conexión:";
88
  $l_remainingtime	= "Desconexión en:";
103
  $l_remainingtime	= "Desconexión en:";
89
  $l_encrypted		= "La apertura debe usar conexión cifrada";
104
  $l_encrypted		= "La apertura debe usar conexión cifrada";
90
  $l_boutonO		= "Autenticación";
105
  $l_boutonO		= "Autenticación";
91
  $l_boutonF		= "Cerrar";
106
  $l_boutonF		= "Cerrar";
92
  $l_loggedin_stringl1 = "Information System Security";
107
  $l_loggedin_stringl1 = "Information System Security";
93
  $l_loggedin_stringl2 = "El portal fue creado reglamentos para garantizar la trazabilidad, la rendición de cuentas y el no repudio de las conexiones.";
108
  $l_loggedin_stringl2 = "El portal fue creado reglamentos para garantizar la trazabilidad, la rendición de cuentas y el no repudio de las conexiones.";
94
  $l_loggedin_stringl3 = "Su actividad en la red es registrada, de conformidad con la privacidad.";
109
  $l_loggedin_stringl3 = "Su actividad en la red es registrada, de conformidad con la privacidad.";
95
  $l_loggedin_stringl4 = "Los datos registrados pueden ser capaces de ser operado por una autoridad judicial en el curso de una investigación.";
110
  $l_loggedin_stringl4 = "Los datos registrados pueden ser capaces de ser operado por una autoridad judicial en el curso de una investigación.";
96
  $l_loggedin_stringl5 = "Estos datos se eliminan automáticamente después de un año.";
111
  $l_loggedin_stringl5 = "Estos datos se eliminan automáticamente después de un año.";
97
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
112
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
98
  $l_loggedout_string = "Cerrar sesión hizo portal cautivo!";
113
  $l_loggedout_string = "Cerrar sesión hizo portal cautivo!";
99
  $l_reply_1 = "Your daily connexion time has been reached";
114
  $l_reply_1 = "Your daily connexion time has been reached";
100
  $l_reply_2 = "Your monthly connexion time has been reached";
115
  $l_reply_2 = "Your monthly connexion time has been reached";
101
  $l_reply_3 = "You try to connect outside of your allowed timespan";
116
  $l_reply_3 = "You try to connect outside of your allowed timespan";
102
  $l_reply_4 = "your account expired";
117
  $l_reply_4 = "your account expired";
103
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
118
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
104
  $l_reply_6 = "Your authorized connexion time has been reached";
119
  $l_reply_6 = "Your authorized connexion time has been reached";
105
  $l_online_time = "Tiempo en linea";
120
  $l_online_time = "Tiempo en linea";
106
  $l_remaining_time = "Tiempo restante";
121
  $l_remaining_time = "Tiempo restante";
-
 
122
  $l_uam_domain = "acceso directo : ";}
-
 
123
else if ($Language == 'pt'){
-
 
124
  $l_ChilliError	= "A autenticação deve ser bem sucedido através do serviço de portal cativo.";
-
 
125
  $l_login		= "Sucesso na autenticação.<HR>Não feche essa janela para não interromper a conexão";
-
 
126
  $l_logout		= "Fechando a conexão";
-
 
127
  $l_loginfailed	= "Falha na autenticação";
107
}
-
 
-
 
128
  $l_loggingin		= "Identificação do portal cativo";
-
 
129
  $l_loggedcont		= "Access Control";
-
 
130
  $l_loggedout		= "Sua conexão foi fechada";
-
 
131
  $l_user		= "Usuário";
-
 
132
  $l_password		= "Senha";
-
 
133
  $l_wait		= "Por favor, aguarde um momento ...";
-
 
134
  $l_onlinetime		= "Tempo de conexão:";
-
 
135
  $l_remainingtime	= "Desconectado em:";
-
 
136
  $l_encrypted		= "A conexão com o portal deve ser criptografada";
-
 
137
  $l_boutonO		= "Autenticação";
-
 
138
  $l_boutonF		= "Fechar";
-
 
139
  $l_loggedin_stringl1 = "Sistema de Segurança da Informação";
-
 
140
  $l_loggedin_stringl2 = "Esse controle foi criado para seguir dentro dos regulamentos vingentes da lei";
-
 
141
  $l_loggedin_stringl3 = "Por isto suas atividades na rede serão registradas de acordo com seus acessos, mas garantindo ainda sua privacidade.";
-
 
142
  $l_loggedin_stringl4 = "Os dados gravados só serão capaz de ser operado por uma autoridade judicial no decorrer de uma investigação.";
-
 
143
  $l_loggedin_stringl5 = "Esses dados serão automaticamente excluídos depois de um ano.";
-
 
144
  $l_loggedin_stringl6 = "Clique <a href='$alcasarpath'>aqui</a> para alterar sua senha Sair do portal cativo.";
-
 
145
  $l_loggedout_string = "desconexão do portal cativo fez";
-
 
146
  $l_reply_1 = "Your daily connexion time has been reached";
-
 
147
  $l_reply_2 = "Seu tempo de conexão mensal foi finalizado";
-
 
148
  $l_reply_3 = "Você tenta conectar-se fora do seu período de tempo permitido";
-
 
149
  $l_reply_4 = "Sua conta expirou";
-
 
150
  $l_reply_5 = "Você atingiu o número máximo de logins simultâneos";
-
 
151
  $l_reply_6 = "Seu tempo de conexão autorizada finalizou";
-
 
152
  $l_online_time = "Tempo Online";
-
 
153
  $l_remaining_time = "Tempo restante";
-
 
154
  $l_uam_domain = "acesso directo : ";}
108
else if($Language == 'de'){
155
else if($Language == 'de'){
109
  $l_ChilliError	= "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
156
  $l_ChilliError	= "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
110
  $l_login		= "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung";
157
  $l_login		= "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung";
111
  $l_logout		= "Beenden der Verbindung";
158
  $l_logout		= "Beenden der Verbindung";
112
  $l_loginfailed	= "Authentifizierungsfehler Eigenverbrauch";
159
  $l_loginfailed	= "Authentifizierungsfehler Eigenverbrauch";
113
  $l_loggingin		= "Kennzeichnung auf dem Eigenverbrauch";
160
  $l_loggingin		= "Kennzeichnung auf dem Eigenverbrauch";
114
  $l_loggedcont		= "Zutrittskontrolle";
161
  $l_loggedcont		= "Zutrittskontrolle";
115
  $l_loggedout		= "Ihre Sitzung ist geschlossen";
162
  $l_loggedout		= "Ihre Sitzung ist geschlossen";
116
  $l_user		= "Benutzer";
163
  $l_user		= "Benutzer";
117
  $l_password		= "Passwort";
164
  $l_password		= "Passwort";
118
  $l_wait		= "Bitte warten Sie einen Moment ...";
165
  $l_wait		= "Bitte warten Sie einen Moment ...";
119
  $l_onlinetime		= "Online-Zeit:";
166
  $l_onlinetime		= "Online-Zeit:";
120
  $l_remainingtime	= "Abmelden:";
167
  $l_remainingtime	= "Abmelden:";
121
  $l_encrypted		= "Die Öffnung muß der Anschluß Zahlen";
168
  $l_encrypted		= "Die Öffnung muß der Anschluß Zahlen";
122
  $l_boutonO		= "Authentifizierung";
169
  $l_boutonO		= "Authentifizierung";
123
  $l_boutonF		= "Schließen";
170
  $l_boutonF		= "Schließen";
124
  $l_loggedin_stringl1 = "Information System Security";
171
  $l_loggedin_stringl1 = "Information System Security";
125
  $l_loggedin_stringl2 = "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, der Zurechenbarkeit und der Nicht-Anerkennung der Verbindungen.";
172
  $l_loggedin_stringl2 = "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, der Zurechenbarkeit und der Nicht-Anerkennung der Verbindungen.";
126
  $l_loggedin_stringl3 = "Ihre Tätigkeit im Netzwerk registriert ist nach Schutz der Privatsphäre.";
173
  $l_loggedin_stringl3 = "Ihre Tätigkeit im Netzwerk registriert ist nach Schutz der Privatsphäre.";
127
  $l_loggedin_stringl4 = "Die gespeicherten Daten nicht pouront genutzt werden, dass von einer Justizbehörde im Rahmen einer Untersuchung.";
174
  $l_loggedin_stringl4 = "Die gespeicherten Daten nicht pouront genutzt werden, dass von einer Justizbehörde im Rahmen einer Untersuchung.";
128
  $l_loggedin_stringl5 = "Diese Daten werden automatisch gelöscht nach einem Jahr.";
175
  $l_loggedin_stringl5 = "Diese Daten werden automatisch gelöscht nach einem Jahr.";
129
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
176
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
130
  $l_loggedout_string = "Trennung des Portals erfolgt Gefangener!";
177
  $l_loggedout_string = "Trennung des Portals erfolgt Gefangener!";
131
  $l_reply_1 = "Your daily connexion time has been reached";
178
  $l_reply_1 = "Your daily connexion time has been reached";
132
  $l_reply_2 = "Your monthly connexion time has been reached";
179
  $l_reply_2 = "Your monthly connexion time has been reached";
133
  $l_reply_3 = "You try to connect outside of your allowed timespan";
180
  $l_reply_3 = "You try to connect outside of your allowed timespan";
134
  $l_reply_4 = "your account expired";
181
  $l_reply_4 = "your account expired";
135
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
182
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
136
  $l_reply_6 = "Your authorized connexion time has been reached";
183
  $l_reply_6 = "Your authorized connexion time has been reached";
137
  $l_online_time = "Online-zeit";
184
  $l_online_time = "Online-zeit";
138
  $l_remaining_time = "Restzeit";
185
  $l_remaining_time = "Restzeit";
139
}
-
 
-
 
186
  $l_uam_domain = "accès direkten : ";}
140
else if($Language == 'nl'){
187
else if($Language == 'nl'){
141
  $l_ChilliError	= "De authenticatie moet een succes worden via de captive portal dienst.";
188
  $l_ChilliError	= "De authenticatie moet een succes worden via de captive portal dienst.";
142
  $l_login		= "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie.";
189
  $l_login		= "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie.";
143
  $l_logout		= "Slotkoers verbinding";
190
  $l_logout		= "Slotkoers verbinding";
144
  $l_loginfailed	= "Authenticatie mislukt";
191
  $l_loginfailed	= "Authenticatie mislukt";
145
  $l_loggingin		= "Identificatie van de captive-portaal";
192
  $l_loggingin		= "Identificatie van de captive-portaal";
146
  $l_loggedcont		= "toegangscontrole";
193
  $l_loggedcont		= "toegangscontrole";
147
  $l_loggedout		= "Uw sessie is gesloten";
194
  $l_loggedout		= "Uw sessie is gesloten";
148
  $l_user		= "Gebruiker";
195
  $l_user		= "Gebruiker";
149
  $l_password		= "Wachtwoord";
196
  $l_password		= "Wachtwoord";
150
  $l_wait		= "Wacht een moment ...";
197
  $l_wait		= "Wacht een moment ...";
151
  $l_onlinetime		= "Sluit tijd:";
198
  $l_onlinetime		= "Sluit tijd:";
152
  $l_remainingtime	= "Verbreking in:";
199
  $l_remainingtime	= "Verbreking in:";
153
  $l_encrypted		= "De opening moet gebruiken gecodeerde verbinding";
200
  $l_encrypted		= "De opening moet gebruiken gecodeerde verbinding";
154
  $l_boutonO		= "Authenticatie";
201
  $l_boutonO		= "Authenticatie";
155
  $l_boutonF		= "Sluiten";
202
  $l_boutonF		= "Sluiten";
156
  $l_loggedin_stringl1 = "Information System Security";
203
  $l_loggedin_stringl1 = "Information System Security";
157
  $l_loggedin_stringl2 = "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
204
  $l_loggedin_stringl2 = "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
158
  $l_loggedin_stringl3 = "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
205
  $l_loggedin_stringl3 = "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
159
  $l_loggedin_stringl4 = "De geregistreerde gegevens kunnen worden kunnen worden bediend door een rechterlijke instantie in de loop van een onderzoek.";
206
  $l_loggedin_stringl4 = "De geregistreerde gegevens kunnen worden kunnen worden bediend door een rechterlijke instantie in de loop van een onderzoek.";
160
  $l_loggedin_stringl5 = "Deze gegevens worden automatisch verwijderd na een jaar.";
207
  $l_loggedin_stringl5 = "Deze gegevens worden automatisch verwijderd na een jaar.";
161
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
208
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
162
  $l_loggedout_string = "Logout gemaakt intern portaal!";
209
  $l_loggedout_string = "Logout gemaakt intern portaal!";
163
  $l_reply_1 = "Your daily connexion time has been reached";
210
  $l_reply_1 = "Your daily connexion time has been reached";
164
  $l_reply_2 = "Your monthly connexion time has been reached";
211
  $l_reply_2 = "Your monthly connexion time has been reached";
165
  $l_reply_3 = "You try to connect outside of your allowed timespan";
212
  $l_reply_3 = "You try to connect outside of your allowed timespan";
166
  $l_reply_4 = "your account expired";
213
  $l_reply_4 = "your account expired";
167
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
214
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
168
  $l_reply_6 = "Your authorized connexion time has been reached";
215
  $l_reply_6 = "Your authorized connexion time has been reached";
169
  $l_online_time = "Online tijd";
216
  $l_online_time = "Online tijd";
170
  $l_remaining_time = "Reterende tijd";
217
  $l_remaining_time = "Reterende tijd";
171
}
-
 
-
 
218
  $l_uam_domain = "Direct access : ";}
172
else if($Language == 'fr'){
219
else if($Language == 'fr'){
173
  $l_ChilliError	= "L'authentification doit &ecirc;tre r&eacute;ussie au travers du service du portail captif.";
220
  $l_ChilliError	= "L'authentification doit &ecirc;tre r&eacute;ussie au travers du service du portail captif.";
174
  $l_login		= "Authentification r&eacute;ussie.<HR>La fermeture de cette fenêtre interrompt votre session.";
221
  $l_login		= "Authentification r&eacute;ussie.<HR>La fermeture de cette fenêtre interrompt votre session.";
175
  $l_logout		= "Fermeture de la session";
222
  $l_logout		= "Fermeture de la session";
176
  $l_loginfailed	= "Echec d'authentification";
223
  $l_loginfailed	= "Echec d'authentification";
177
  $l_loggingin		= "Identification sur le portail captif";
224
  $l_loggingin		= "Identification sur le portail captif";
178
  $l_loggedcont		= "Contr&ocirc;le d'acc&egrave;s";
225
  $l_loggedcont		= "Contr&ocirc;le d'acc&egrave;s";
179
  $l_loggedout		= "Votre session est fermée";
226
  $l_loggedout		= "Votre session est fermée";
180
  $l_user		= "Identifiant";
227
  $l_user		= "Identifiant";
181
  $l_password		= "Mot de passe";
228
  $l_password		= "Mot de passe";
182
  $l_wait		= "Patientez un instant ...";
229
  $l_wait		= "Patientez un instant ...";
183
  $l_onlinetime		= "Temps de connexion:";
230
  $l_onlinetime		= "Temps de connexion:";
184
  $l_remainingtime	= "Deconnexion dans :";
231
  $l_remainingtime	= "Deconnexion dans :";
185
  $l_encrypted		= "La connexion avec le portail doit &ecirc;tre chiffr&eacute;e";
232
  $l_encrypted		= "La connexion avec le portail doit &ecirc;tre chiffr&eacute;e";
186
  $l_boutonO		= "Authentification";
233
  $l_boutonO		= "Authentification";
187
  $l_boutonF		= "Fermer";
234
  $l_boutonF		= "Fermer";
188
  $l_loggedin_stringl1 = "S&eacute;curit&eacute; des Syst&egrave;mes d'Information";
235
  $l_loggedin_stringl1 = "S&eacute;curit&eacute; des Syst&egrave;mes d'Information";
189
  $l_loggedin_stringl2 = "Ce contr&ocirc;le a &eacute;t&eacute; mis en place pour assurer r&eacute;glementairement la tra&ccedil;abilit&eacute;, l'imputabilit&eacute; et la non-r&eacute;pudiation des connexions.";
236
  $l_loggedin_stringl2 = "Ce contr&ocirc;le a &eacute;t&eacute; mis en place pour assurer r&eacute;glementairement la tra&ccedil;abilit&eacute;, l'imputabilit&eacute; et la non-r&eacute;pudiation des connexions.";
190
  $l_loggedin_stringl3 = "Votre activit&eacute; sur le r&eacute;seau est enregistr&eacute;e conform&eacute;ment au respect de la vie priv&eacute;e.";
237
  $l_loggedin_stringl3 = "Votre activit&eacute; sur le r&eacute;seau est enregistr&eacute;e conform&eacute;ment au respect de la vie priv&eacute;e.";
191
  $l_loggedin_stringl4 = "Les donn&eacute;es enregistr&eacute;es ne pourront &ecirc;tre exploit&eacute;es que par une autorit&eacute judiciaire dans le cadre d'une enqu&ecirc;te.";
238
  $l_loggedin_stringl4 = "Les donn&eacute;es enregistr&eacute;es ne pourront &ecirc;tre exploit&eacute;es que par une autorit&eacute judiciaire dans le cadre d'une enqu&ecirc;te.";
192
  $l_loggedin_stringl5 = "Ces donn&eacute;es seront automatiquement supprim&eacute;es au bout d'un an.";
239
  $l_loggedin_stringl5 = "Ces donn&eacute;es seront automatiquement supprim&eacute;es au bout d'un an.";
193
  $l_loggedin_stringl6 = "Cliquez <a href='$alcasarpath'>ici</a> pour changer votre mot de passe ou pour intégrer le certificat de sécurité à votre navigateur";
240
  $l_loggedin_stringl6 = "Cliquez <a href='$alcasarpath'>ici</a> pour changer votre mot de passe ou pour intégrer le certificat de sécurité à votre navigateur";
194
  $l_loggedout_string = "D&eacute;connexion du portail captif effectu&eacute;e !";
241
  $l_loggedout_string = "D&eacute;connexion du portail captif effectu&eacute;e !";
195
  $l_reply_1 = "Votre dur&eacute;e de connexion journali&egrave;re a &eacute;t&eacute; atteinte";
242
  $l_reply_1 = "Votre dur&eacute;e de connexion journali&egrave;re a &eacute;t&eacute; atteinte";
196
  $l_reply_2 = "Votre dur&eacute;e de connexion mensuelle a &eacute;t&eacute; atteinte";
243
  $l_reply_2 = "Votre dur&eacute;e de connexion mensuelle a &eacute;t&eacute; atteinte";
197
  $l_reply_3 = "Vous tentez de vous connecter en dehors de votre p&eacute;riode autoris&eacute;e";
244
  $l_reply_3 = "Vous tentez de vous connecter en dehors de votre p&eacute;riode autoris&eacute;e";
198
  $l_reply_4 = "Votre compte a expir&eacute";
245
  $l_reply_4 = "Votre compte a expir&eacute";
199
  $l_reply_5 = "Vous avez atteint le nombre maximum de connexions simultan&eacute;es";
246
  $l_reply_5 = "Vous avez atteint le nombre maximum de connexions simultan&eacute;es";
200
  $l_reply_6 = "Votre dur&eacute;e de connexion autoris&eacute;e a &eacute;t&eacute; atteinte";
247
  $l_reply_6 = "Votre dur&eacute;e de connexion autoris&eacute;e a &eacute;t&eacute; atteinte";
201
  $l_online_time = "Temps de connexion";
248
  $l_online_time = "Temps de connexion";
202
  $l_remaining_time = "Temps restant";
249
  $l_remaining_time = "Temps restant";
203
}
-
 
-
 
250
  $l_uam_domain = "Acc&egrave;s dirrect : ";}
204
else{
251
else{
205
  $l_ChilliError	= "The authentication must be successful through the captive portal service.";
252
  $l_ChilliError	= "The authentication must be successful through the captive portal service.";
206
  $l_login		= "Successful authentication.<HR>Closing this window interrupts your session";
253
  $l_login		= "Successful authentication.<HR>Closing this window interrupts your session";
207
  $l_logout		= "Closing connection";
254
  $l_logout		= "Closing connection";
208
  $l_loginfailed	= "Authentication Failed";
255
  $l_loginfailed	= "Authentication Failed";
209
  $l_loggingin		= "Identification on the captive portal";
256
  $l_loggingin		= "Identification on the captive portal";
210
  $l_loggedcont		= "Access Control";
257
  $l_loggedcont		= "Access Control";
211
  $l_loggedout		= "Your session is closed";
258
  $l_loggedout		= "Your session is closed";
212
  $l_user		= "User";
259
  $l_user		= "User";
213
  $l_password		= "Password";
260
  $l_password		= "Password";
214
  $l_wait		= "Please wait a moment ...";
261
  $l_wait		= "Please wait a moment ...";
215
  $l_onlinetime		= "Connect time:";
262
  $l_onlinetime		= "Connect time:";
216
  $l_remainingtime	= "Disconnection in:";
263
  $l_remainingtime	= "Disconnection in:";
217
  $l_encrypted		= "The connection with the portal must be encrypted";
264
  $l_encrypted		= "The connection with the portal must be encrypted";
218
  $l_boutonO		= "Authentication";
265
  $l_boutonO		= "Authentication";
219
  $l_boutonF		= "Close";
266
  $l_boutonF		= "Close";
220
  $l_loggedin_stringl1 = "Information System Security";
267
  $l_loggedin_stringl1 = "Information System Security";
221
  $l_loggedin_stringl2 = "That control was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
268
  $l_loggedin_stringl2 = "That control was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
222
  $l_loggedin_stringl3 = "Your activity on the network is registered in accordance with privacy.";
269
  $l_loggedin_stringl3 = "Your activity on the network is registered in accordance with privacy.";
223
  $l_loggedin_stringl4 = "The recorded data can be able to be operated by a judicial authority in the course of an investigation.";
270
  $l_loggedin_stringl4 = "The recorded data can be able to be operated by a judicial authority in the course of an investigation.";
224
  $l_loggedin_stringl5 = "These data will be automatically deleted after one year.";
271
  $l_loggedin_stringl5 = "These data will be automatically deleted after one year.";
225
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
272
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
226
  $l_loggedout_string = "Logout made captive portal!";
273
  $l_loggedout_string = "Disconnection of the captive portal made";
227
  $l_reply_1 = "Your daily connexion time has been reached";
274
  $l_reply_1 = "Your daily connexion time has been reached";
228
  $l_reply_2 = "Your monthly connexion time has been reached";
275
  $l_reply_2 = "Your monthly connexion time has been reached";
229
  $l_reply_3 = "You try to connect outside of your allowed timespan";
276
  $l_reply_3 = "You try to connect outside of your allowed timespan";
230
  $l_reply_4 = "your account expired";
277
  $l_reply_4 = "your account expired";
231
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
278
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
232
  $l_reply_6 = "Your authorized connexion time has been reached";
279
  $l_reply_6 = "Your authorized connexion time has been reached";
233
  $l_online_time = "Online time";
280
  $l_online_time = "Online time";
234
  $l_remaining_time = "Remaining time";
281
  $l_remaining_time = "Remaining time";
235
}
-
 
-
 
282
  $l_uam_domain = "Direct access : ";}
236
 
283
 
237
# If https not use, tell it's wrong
284
# If https not use, tell it's wrong
238
if (!(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS'] == 'on'))) {
285
if (!(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS'] == 'on'))) {
239
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
286
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
240
<html>
287
<html>
241
<head>
288
<head>
242
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
289
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
243
  <title>$l_loggedcont</title>
290
  <title>$l_loggedcont</title>
244
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
291
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
245
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
292
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
246
</head>
293
</head>
247
<body bgColor = 'white'>
294
<body bgColor = 'white'>
248
  <h1 style=\"text-align: center;\">$l_loginfailed</h1>
295
  <h1 style=\"text-align: center;\">$l_loginfailed</h1>
249
  <center>$l_encrypted</center>
296
  <center>$l_encrypted</center>
250
</body>
297
</body>
251
</html>";
298
</html>";
252
    exit(0);
299
    exit(0);
253
}
300
}
254
 
301
 
255
# Read form parameters which we care about
302
# Read form parameters which we care about
256
if (isset($_POST['UserName'])){	$username	= $_POST['UserName'];} else {$username="";}
303
if (isset($_POST['UserName'])){	$username	= $_POST['UserName'];} else {$username="";}
257
if (isset($_POST['Password'])){	$password	= $_POST['Password'];} else {$password="";}
304
if (isset($_POST['Password'])){	$password	= $_POST['Password'];} else {$password="";}
258
if (isset($_POST['challenge'])){$challenge	= $_POST['challenge'];} else {$challenge="";}
305
if (isset($_POST['challenge'])){$challenge	= $_POST['challenge'];} else {$challenge="";}
259
if (isset($_POST['button'])){	$button		= $_POST['button'];} else { $button="";}
306
if (isset($_POST['button'])){	$button		= $_POST['button'];} else { $button="";}
260
//if (isset($_POST['logout'])){	$logout		= $_POST['logout'];} else {$logout="";}
307
//if (isset($_POST['logout'])){	$logout		= $_POST['logout'];} else {$logout="";}
261
//if (isset($_POST['prelogin'])){	$prelogin	= $_POST['prelogin'];} else {$prelogin="";}
308
//if (isset($_POST['prelogin'])){	$prelogin	= $_POST['prelogin'];} else {$prelogin="";}
262
if (isset($_POST['res'])){		$res		= $_POST['res'];} else {$res="";}
309
if (isset($_POST['res'])){		$res		= $_POST['res'];} else {$res="";}
263
if (isset($_POST['uamip'])){	$uamip		= $_POST['uamip'];} else {$uamip="";}
310
if (isset($_POST['uamip'])){	$uamip		= $_POST['uamip'];} else {$uamip="";}
264
if (isset($_POST['uamport'])){	$uamport	= $_POST['uamport'];} else {$uamport="";}
311
if (isset($_POST['uamport'])){	$uamport	= $_POST['uamport'];} else {$uamport="";}
265
if (isset($_POST['userurl'])){	$userurl	= $_POST['userurl'];} else {$userurl="";}
312
if (isset($_POST['userurl'])){	$userurl	= $_POST['userurl'];} else {$userurl="";}
266
if (isset($_POST['timeleft'])){	$timeleft	= $_POST['timeleft'];} else {$timeleft="";}
313
if (isset($_POST['timeleft'])){	$timeleft	= $_POST['timeleft'];} else {$timeleft="";}
267
if (isset($_POST['redirurl'])){	$redirurl	= $_POST['redirurl'];} else {$redirurl="";}
314
if (isset($_POST['redirurl'])){	$redirurl	= $_POST['redirurl'];} else {$redirurl="";}
268
 
315
 
269
# Read query parameters which we care about
316
# Read query parameters which we care about
270
if (isset($_GET['res']))		$res		= $_GET['res'];
317
if (isset($_GET['res']))		$res		= $_GET['res'];
271
if (isset($_GET['challenge']))	$challenge	= $_GET['challenge'];
318
if (isset($_GET['challenge']))	$challenge	= $_GET['challenge'];
272
if (isset($_GET['uamip']))		$uamip		= $_GET['uamip'];
319
if (isset($_GET['uamip']))		$uamip		= $_GET['uamip'];
273
if (isset($_GET['uamport']))	$uamport	= $_GET['uamport'];
320
if (isset($_GET['uamport']))	$uamport	= $_GET['uamport'];
274
if (isset($_GET['reply'])){		$reply		= $_GET['reply'];} else {$reply="";}
321
if (isset($_GET['reply'])){		$reply		= $_GET['reply'];} else {$reply="";}
275
if (isset($_GET['userurl']))	$userurl	= $_GET['userurl'];
322
if (isset($_GET['userurl']))	$userurl	= $_GET['userurl'];
276
if (isset($_GET['timeleft']))	$timeleft	= $_GET['timeleft'];
323
if (isset($_GET['timeleft']))	$timeleft	= $_GET['timeleft'];
277
if (isset($_GET['redirurl']))	$redirurl	= $_GET['redirurl'];
324
if (isset($_GET['redirurl']))	$redirurl	= $_GET['redirurl'];
278
 
325
 
279
# translation of radius replies
326
# translation of radius replies
280
if (isset($reply)){
327
if (isset($reply)){
281
	switch(trim ($reply)) {
328
	switch(trim ($reply)) {
282
  case 'Your maximum daily usage time has been reached' : $reply = $l_reply_1 ; break;
329
  case 'Your maximum daily usage time has been reached' : $reply = $l_reply_1 ; break;
283
  case 'Your maximum monthly usage time has been reached' : $reply = $l_reply_2 ; break;
330
  case 'Your maximum monthly usage time has been reached' : $reply = $l_reply_2 ; break;
284
  case 'You are calling outside your allowed timespan' : $reply = $l_reply_3 ; break;
331
  case 'You are calling outside your allowed timespan' : $reply = $l_reply_3 ; break;
285
  case 'Password Has Expired' : $reply =  $l_reply_4 ; break;
332
  case 'Password Has Expired' : $reply =  $l_reply_4 ; break;
286
  case 'You are already logged in - access denied' : $reply = $l_reply_5 ; break;
333
  case 'You are already logged in - access denied' : $reply = $l_reply_5 ; break;
287
  case 'Your maximum never usage time has been reached' : $reply = $l_reply_6 ; break;
334
  case 'Your maximum never usage time has been reached' : $reply = $l_reply_6 ; break;
288
  }}
335
  }}
289
 
336
 
290
# If attempt to login
337
# If attempt to login
291
if ("$button" == "$l_boutonO") {
338
if ("$button" == "$l_boutonO") {
292
  $hexchal = pack ("H32", $challenge);
339
  $hexchal = pack ("H32", $challenge);
293
  $newchal = pack ("H*", md5($hexchal . $uamsecret));
340
  $newchal = pack ("H*", md5($hexchal . $uamsecret));
294
  $response = md5("\0" . $password . $newchal);
341
  $response = md5("\0" . $password . $newchal);
295
  $newpwd = pack("a32", $password);
342
  $newpwd = pack("a32", $password);
296
  $pappassword = implode ("", unpack("H32", ($newpwd ^ $newchal)));
343
  $pappassword = implode ("", unpack("H32", ($newpwd ^ $newchal)));
297
  echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
344
  echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
298
<html>
345
<html>
299
<head>
346
<head>
300
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
347
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
301
  <title>$l_loggingin</title>
348
  <title>$l_loggingin</title>
302
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
349
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
303
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
350
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
304
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl\">
351
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl\">
305
  </head>
352
  </head>
306
<body bgColor = 'white'>
353
<body bgColor = 'white'>
307
<h1 style=\"text-align: center;\">$l_loggingin</h1>
354
<h1 style=\"text-align: center;\">$l_loggingin</h1>
308
  <center>
355
  <center>
309
    $l_wait
356
    $l_wait
310
  </center>
357
  </center>
311
</body>
358
</body>
312
</html>";
359
</html>";
313
exit(0);
360
exit(0);
314
}
361
}
315
 
362
 
316
switch($res) {
363
switch($res) {
317
  case 'success':     $result =  1; break; // If login successful
364
  case 'success':     $result =  1; break; // If login successful
318
  case 'failed':      $result =  2; break; // If login failed
365
  case 'failed':      $result =  2; break; // If login failed
319
  case 'logoff':      $result =  3; break; // If logout successful
366
  case 'logoff':      $result =  3; break; // If logout successful
320
  case 'already':     $result =  4; break; // If tried to login while already logged in
367
  case 'already':     $result =  4; break; // If tried to login while already logged in
321
  case 'notyet':      $result =  5; break; // If not logged in yet
368
  case 'notyet':      $result =  5; break; // If not logged in yet
322
  default: $result = 0; // Default: It was not a form request -> client go to login form
369
  default: $result = 0; // Default: It was not a form request -> client go to login form
323
}
370
}
324
 
371
 
325
# Otherwise it was not a form request
372
# Otherwise it was not a form request
326
# Send out an error message
373
# Send out an error message
327
if ($result == 0) {	//erreur
374
if ($result == 0) {	//erreur
328
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
375
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
329
<html>
376
<html>
330
<head>
377
<head>
331
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
378
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
332
  <title>$l_loggingin</title>
379
  <title>$l_loggingin</title>
333
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
380
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
334
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
381
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
335
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/prelogin\">
382
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/prelogin\">
336
  </head>
383
  </head>
337
<body bgColor = 'white'>
384
<body bgColor = 'white'>
338
<h1 style=\"text-align: center;\">$l_loggingin</h1>
385
<h1 style=\"text-align: center;\">$l_loggingin</h1>
339
  <center>
386
  <center>
340
    $l_wait
387
    $l_wait
341
  </center>
388
  </center>
342
</body>
389
</body>
343
</html>";
390
</html>";
344
    exit(0);
391
    exit(0);
345
}
392
}
346
# Generate the output
393
# Generate the output
347
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
394
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
348
<html>
395
<html>
349
<head>
396
<head>
350
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
397
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
351
  <title>$l_loggingin</title>
398
  <title>$l_loggingin</title>
352
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
399
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
353
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
400
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
354
  <script type=\"text/javascript\" language=\"JavaScript\">
401
  <script type=\"text/javascript\" language=\"JavaScript\">
355
    var blur = 0; // not un use
402
    var blur = 0; // not un use
356
	var mytimeleft = 0; // not un use
403
	var mytimeleft = 0; // not un use
357
	alcasar_popup = null;
404
	alcasar_popup = null;
358
 
405
 
359
    function popUp(URL) {
406
    function popUp(URL) {
360
      if (self.name != \"alcasar_popup\") {
407
      if (self.name != \"alcasar_popup\") {
361
        alcasar_popup = window.open(URL, 'alcasar_popup', 'width=500,height=460,directories=no,resizable=no,scrollbars=yes,location=no,toolbar=no,statusbar=no,menubar=no');
408
        alcasar_popup = window.open(URL, 'alcasar_popup', 'width=500,height=460,directories=no,resizable=no,scrollbars=yes,location=no,toolbar=no,statusbar=no,menubar=no');
362
      }
409
      }
363
    }
410
    }
364
 
411
 
365
    function doOnLoad(result, userurl, redirurl, adminurl, timeleft) {
412
    function doOnLoad(result, userurl, redirurl, adminurl, timeleft) {
366
	    if (timeleft) { // not in use
413
	    if (timeleft) { // not in use
367
        mytimeleft = timeleft;
414
        mytimeleft = timeleft;
368
      }
415
      }
369
      if ((result == 1)||(result == 4)) {	//success or already
416
      if ((result == 1)||(result == 4)) {	//success or already
370
	      //window.location = userurl;
417
	      //window.location = userurl;
371
		  if (alcasar_popup != null) alcasar_popup.focus();
418
		  if (alcasar_popup != null) alcasar_popup.focus();
372
		  
419
		  
373
		  if (adminurl != ''){
420
		  if (adminurl != ''){
374
			  window.location = adminurl;
421
			  window.location = adminurl;
375
		  } else if (redirurl != '') {
422
		  } else if (redirurl != '') {
376
			  window.location = redirurl;
423
			  window.location = redirurl;
377
		  } else if (userurl != '') {
424
		  } else if (userurl != '') {
378
			  window.location = userurl;
425
			  window.location = userurl;
379
		  } else {
426
		  } else {
380
			  window.home();
427
			  window.home();
381
		  }
428
		  }
382
      }
429
      }
383
      if ((result == 2) || (result == 3) || result == 5) { //failed or logoff or notyet
430
      if ((result == 2) || (result == 3) || result == 5) { //failed or logoff or notyet
384
		if (alcasar_popup != null) alcasar_popup.close();
431
		if (alcasar_popup != null) alcasar_popup.close();
385
			document.form1.UserName.focus();
432
			document.form1.UserName.focus();
386
      }
433
      }
387
    }
434
    }
388
  </script>
435
  </script>
389
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
436
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
390
</head>
437
</head>
391
<body onLoad=\"javascript:doOnLoad($result,'$userurl','$redirurl','$adminurl','$timeleft')\">
438
<body onLoad=\"javascript:doOnLoad($result,'$userurl','$redirurl','$adminurl','$timeleft')\">
392
  <center>";
439
  <center>";
393
if ($result == 2 || $result == 3 || $result == 5) { //failed or logoff or notyet
440
if ($result == 2 || $result == 3 || $result == 5) { //failed or logoff or notyet
394
  echo "
441
  echo "
395
	<div id=\"logon\">
442
	<div id=\"logon\">
396
	<h1>$organisme</h1>
443
	<h1>$organisme</h1>
397
	<h2>$l_loggedcont</h2>";
444
	<h2>$l_loggedcont</h2>";
398
	if ($result == 2) { //failed
445
	if ($result == 2) { //failed
399
		echo "	
446
		echo "	
400
		<h3>$l_loginfailed</h3>";
447
		<h3>$l_loginfailed</h3>";
401
		if ($reply) {
448
		if ($reply) {
402
		#traitement du reply ...
449
		#traitement du reply ...
403
		echo "<center> $reply <br /><br /></center>";
450
		echo "<center> $reply <br /><br /></center>";
404
		}
451
		}
405
	}
452
	}
406
	echo "
453
	echo "
407
	<img id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
454
	<img id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
408
	<form name=\"form1\" method=\"post\" action=\"$loginpath\">
455
	<form name=\"form1\" method=\"post\" action=\"$loginpath\">
409
	<input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
456
	<input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
410
	<input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
457
	<input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
411
	<input type=\"hidden\" name=\"uamport\" value=\"$uamport\">
458
	<input type=\"hidden\" name=\"uamport\" value=\"$uamport\">
412
	<input type=\"hidden\" name=\"userurl\" value=\"$userurl\">
459
	<input type=\"hidden\" name=\"userurl\" value=\"$userurl\">
413
		<table id=\"boite-logon\">
460
		<table id=\"boite-logon\">
414
			<tr>
461
			<tr>
415
				<td width=\"20%\" rowspan=\"3\"><img id=\"logo-organ\" src=\"/images/organisme.png\"></td>
462
				<td width=\"20%\" rowspan=\"3\"><img id=\"logo-organ\" src=\"/images/organisme.png\"></td>
416
				<td width=\"30%\" align=\"right\">$l_user</td>
463
				<td width=\"30%\" align=\"right\">$l_user</td>
417
				<td width=\"50%\" align=\"left\"><INPUT type=\"text\" maxLength=\"32\" name=\"UserName\"></td>
464
				<td width=\"50%\" align=\"left\"><INPUT type=\"text\" maxLength=\"32\" name=\"UserName\"></td>
418
			</tr>
465
			</tr>
419
			<tr>
466
			<tr>
420
				<td align=\"right\">$l_password</td>
467
				<td align=\"right\">$l_password</td>
421
				<td align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\"></td>
468
				<td align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\"></td>
422
			</tr>
469
			</tr>
423
			<tr>
470
			<tr>
424
				<td height=\"23\" colSpan=\"2\" align=\"center\"><INPUT value=\"$l_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$statuspath')\"></td>
471
				<td height=\"23\" colSpan=\"2\" align=\"center\"><INPUT value=\"$l_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$statuspath')\"></td>
425
			</tr>
472
			</tr>
426
		</table>
473
		</table>
427
		<table id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\">
474
		<table id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\">
428
			<tr>
475
			<tr>
429
				<td align=\"center\"><FONT color=\"red\"><B>$l_loggedin_stringl1</B></FONT></td>
476
				<td align=\"center\"><FONT color=\"red\"><B>$l_loggedin_stringl1</B></FONT></td>
430
			</tr>
477
			</tr>
431
			<tr>
478
			<tr>
432
				<td align=\"left\">
479
				<td align=\"left\">
433
					<ul>
480
					<ul>
434
						<LI>$l_loggedin_stringl2</LI>
481
						<LI>$l_loggedin_stringl2</LI>
435
						<LI>$l_loggedin_stringl4</LI>
482
						<LI>$l_loggedin_stringl4</LI>
436
						<LI>$l_loggedin_stringl3</LI>
483
						<LI>$l_loggedin_stringl3</LI>
437
						<LI>$l_loggedin_stringl5</LI>
484
						<LI>$l_loggedin_stringl5</LI>
438
						<LI>$l_loggedin_stringl6</LI>
485
						<LI>$l_loggedin_stringl6</LI>
439
					</ul>
486
					</ul>
440
				</td>
487
				</td>
441
			</tr>
488
			</tr>
442
		</table>
489
		</table>";
-
 
490
 
-
 
491
  
-
 
492
// Read the "Domain alowed" file
-
 
493
$tab=file(DOMAIN_ALLOWED_LIST);
-
 
494
if ($tab)  # the file isn't empty
-
 
495
	{
-
 
496
	echo "<div id=\"authorized_domain\"><li>$l_uam_domain</li>";
-
 
497
	foreach ($tab as $line)
-
 
498
		{
-
 
499
		if (trim($line) != '') # the line isn't empty
-
 
500
		{
-
 
501
			$domain_allowed=explode("#", $line);
-
 
502
			$uamdomain=trim($domain_allowed[0],"#");
-
 
503
			$domain=explode("\"", $uamdomain);
-
 
504
			if ((isset($domain_allowed[1])) && (trim($domain_allowed[1]) != '')){
-
 
505
				echo "<li><a href=\"http://".trim($domain[1])."\">".trim($domain_allowed[1])."</a></li>";
-
 
506
			}
-
 
507
			else echo"<li><a href=\"http://".trim($domain[1])."\">".trim($domain[1])."</a></li>";
-
 
508
			}
-
 
509
		}
-
 
510
		echo "</div>";
-
 
511
	}
-
 
512
 
-
 
513
echo "
443
  </form>
514
  </form>
444
  </div>
515
  </div>
445
  </center>
516
  </center>
446
</body>
517
</body>
447
</html>";
518
</html>";
448
}
519
}
449
exit(0);
520
exit(0);
450
?>
521
?>
451
 
522