Subversion Repositories ALCASAR

Rev

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

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