Subversion Repositories ALCASAR

Rev

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

Rev 1670 Rev 1947
1
<?php
1
<?php
2
# $Id: intercept.php 1670 2015-07-24 21:19:11Z richard $
2
# $Id: intercept.php 1947 2016-06-15 16:18:33Z raphael.pion $
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
  $l_autoregistration   = "Registo autom&aacute;tico";}
110
  $l_autoregistration   = "Registo autom&aacute;tico";}
111
else if ($Language == 'pt'){
111
else if ($Language == 'pt'){
112
  $l_ChilliError	= "A autenticação precisa ser bem sucedida através do portal.";
112
  $l_ChilliError	= "A autenticação precisa ser bem sucedida através do portal.";
113
  $l_login		= "Sucesso na autenticação.<HR>Matenha esse pop-up apenas minimizado para não interromper a conexão";
113
  $l_login		= "Sucesso na autenticação.<HR>Matenha esse pop-up apenas minimizado para não interromper a conexão";
114
  $l_logout		= "Encerrar conexão";
114
  $l_logout		= "Encerrar conexão";
115
  $l_loginfailed	= "Falha na autenticação";
115
  $l_loginfailed	= "Falha na autenticação";
116
  $l_loggingin		= "Identificação do portal cativo";
116
  $l_loggingin		= "Identificação do portal cativo";
117
  $l_loggedcont		= "Controle de acesso";
117
  $l_loggedcont		= "Controle de acesso";
118
  $l_loggedout		= "Sua sessão foi fechada";
118
  $l_loggedout		= "Sua sessão foi fechada";
119
  $l_user		= "Usuário";
119
  $l_user		= "Usuário";
120
  $l_password		= "Senha";
120
  $l_password		= "Senha";
121
  $l_wait		= "Por favor, aguarde um momento ...";
121
  $l_wait		= "Por favor, aguarde um momento ...";
122
  $l_onlinetime		= "Tempo de conexão:";
122
  $l_onlinetime		= "Tempo de conexão:";
123
  $l_remainingtime	= "Desconectado em:";
123
  $l_remainingtime	= "Desconectado em:";
124
  $l_encrypted		= "A conexão com o portal deve ser criptografada";
124
  $l_encrypted		= "A conexão com o portal deve ser criptografada";
125
  $l_boutonO		= "Autenticação";
125
  $l_boutonO		= "Autenticação";
126
  $l_boutonF		= "Fechar";
126
  $l_boutonF		= "Fechar";
127
  $l_loggedin_stringl1	= "Sistema de Informação e segurança";
127
  $l_loggedin_stringl1	= "Sistema de Informação e segurança";
128
  $l_loggedin_stringl2	= "Este controle foi criado para garantir acesso seguro.";
128
  $l_loggedin_stringl2	= "Este controle foi criado para garantir acesso seguro.";
129
  $l_loggedin_stringl3	= "A autenticação será criptografada em 256 bits, impedindo captura por escâner de rede.";
129
  $l_loggedin_stringl3	= "A autenticação será criptografada em 256 bits, impedindo captura por escâner de rede.";
130
  $l_loggedin_stringl4	= "Sua atividade na Internet será resguardada de acordo com os regulamentos da lei.";
130
  $l_loggedin_stringl4	= "Sua atividade na Internet será resguardada de acordo com os regulamentos da lei.";
131
  $l_loggedin_stringl5	= "Mantenha o popup da conexão minimizado para não interromper a cessão.";
131
  $l_loggedin_stringl5	= "Mantenha o popup da conexão minimizado para não interromper a cessão.";
132
  $l_loggedin_stringl6	= "Clique <a href='$alcasarpath'>aqui</a> para alterar sua senha, instalar certificado ou sair do portal.";
132
  $l_loggedin_stringl6	= "Clique <a href='$alcasarpath'>aqui</a> para alterar sua senha, instalar certificado ou sair do portal.";
133
  $l_loggedout_string	= "desconexão do portal cativo";
133
  $l_loggedout_string	= "desconexão do portal cativo";
134
  $l_reply_1		= "Seu tempo de conexão diária foi finalizado";
134
  $l_reply_1		= "Seu tempo de conexão diária foi finalizado";
135
  $l_reply_2		= "Seu tempo de conexão mensal foi finalizado";
135
  $l_reply_2		= "Seu tempo de conexão mensal foi finalizado";
136
  $l_reply_3		= "Você tenta conectar-se fora do seu período de tempo permitido";
136
  $l_reply_3		= "Você tenta conectar-se fora do seu período de tempo permitido";
137
  $l_reply_4		= "Sua conta expirou";
137
  $l_reply_4		= "Sua conta expirou";
138
  $l_reply_5		= "Você atingiu o número máximo de logins simultâneos";
138
  $l_reply_5		= "Você atingiu o número máximo de logins simultâneos";
139
  $l_reply_6		= "Seu tempo de conexão autorizada finalizou";
139
  $l_reply_6		= "Seu tempo de conexão autorizada finalizou";
140
  $l_online_time	= "Tempo Online";
140
  $l_online_time	= "Tempo Online";
141
  $l_remaining_time	= "Tempo restante";
141
  $l_remaining_time	= "Tempo restante";
142
  $l_uam_domain		= "Sites autorizados : ";
142
  $l_uam_domain		= "Sites autorizados : ";
143
  $l_autoregistration   = "Registo autom&aacute;tico";}
143
  $l_autoregistration   = "Registo autom&aacute;tico";}
144
else if($Language == 'de'){
144
else if($Language == 'de'){
145
  $l_ChilliError	= "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
145
  $l_ChilliError	= "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
146
  $l_login		= "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung";
146
  $l_login		= "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung";
147
  $l_logout		= "Beenden der Verbindung";
147
  $l_logout		= "Beenden der Verbindung";
148
  $l_loginfailed	= "Authentifizierungsfehler Eigenverbrauch";
148
  $l_loginfailed	= "Authentifizierungsfehler Eigenverbrauch";
149
  $l_loggingin		= "Kennzeichnung auf dem Eigenverbrauch";
149
  $l_loggingin		= "Kennzeichnung auf dem Eigenverbrauch";
150
  $l_loggedcont		= "Zutrittskontrolle";
150
  $l_loggedcont		= "Zutrittskontrolle";
151
  $l_loggedout		= "Ihre Sitzung ist geschlossen";
151
  $l_loggedout		= "Ihre Sitzung ist geschlossen";
152
  $l_user		= "Benutzer";
152
  $l_user		= "Benutzer";
153
  $l_password		= "Passwort";
153
  $l_password		= "Passwort";
154
  $l_wait		= "Bitte warten Sie einen Moment ...";
154
  $l_wait		= "Bitte warten Sie einen Moment ...";
155
  $l_onlinetime		= "Online-Zeit:";
155
  $l_onlinetime		= "Online-Zeit:";
156
  $l_remainingtime	= "Abmelden:";
156
  $l_remainingtime	= "Abmelden:";
157
  $l_encrypted		= "Die Öffnung muß der Anschluß Zahlen";
157
  $l_encrypted		= "Die Öffnung muß der Anschluß Zahlen";
158
  $l_boutonO		= "Authentifizierung";
158
  $l_boutonO		= "Authentifizierung";
159
  $l_boutonF		= "Schließen";
159
  $l_boutonF		= "Schließen";
160
  $l_loggedin_stringl1	= "Information System Security";
160
  $l_loggedin_stringl1	= "Information System Security";
161
  $l_loggedin_stringl2	= "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, der Zurechenbarkeit und der Nicht-Anerkennung der Verbindungen.";
161
  $l_loggedin_stringl2	= "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, der Zurechenbarkeit und der Nicht-Anerkennung der Verbindungen.";
162
  $l_loggedin_stringl3	= "Ihre Tätigkeit im Netzwerk registriert ist nach Schutz der Privatsphäre.";
162
  $l_loggedin_stringl3	= "Ihre Tätigkeit im Netzwerk registriert ist nach Schutz der Privatsphäre.";
163
  $l_loggedin_stringl4	= "Die gespeicherten Daten nicht pouront genutzt werden, dass von einer Justizbehörde im Rahmen einer Untersuchung.";
163
  $l_loggedin_stringl4	= "Die gespeicherten Daten nicht pouront genutzt werden, dass von einer Justizbehörde im Rahmen einer Untersuchung.";
164
  $l_loggedin_stringl5	= "Diese Daten werden automatisch gelöscht nach einem Jahr.";
164
  $l_loggedin_stringl5	= "Diese Daten werden automatisch gelöscht nach einem Jahr.";
165
  $l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
165
  $l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
166
  $l_loggedout_string	= "Trennung des Portals erfolgt Gefangener!";
166
  $l_loggedout_string	= "Trennung des Portals erfolgt Gefangener!";
167
  $l_reply_1		= "Your daily connexion time has been reached";
167
  $l_reply_1		= "Your daily connexion time has been reached";
168
  $l_reply_2		= "Your monthly connexion time has been reached";
168
  $l_reply_2		= "Your monthly connexion time has been reached";
169
  $l_reply_3		= "You try to connect outside of your allowed timespan";
169
  $l_reply_3		= "You try to connect outside of your allowed timespan";
170
  $l_reply_4		= "your account expired";
170
  $l_reply_4		= "your account expired";
171
  $l_reply_5		= "You have reached the maximum number of simultaneous logins";
171
  $l_reply_5		= "You have reached the maximum number of simultaneous logins";
172
  $l_reply_6		= "Your authorized connexion time has been reached";
172
  $l_reply_6		= "Your authorized connexion time has been reached";
173
  $l_online_time	= "Online-zeit";
173
  $l_online_time	= "Online-zeit";
174
  $l_remaining_time	= "Restzeit";
174
  $l_remaining_time	= "Restzeit";
175
  $l_uam_domain		= "Autorisierten websites : ";
175
  $l_uam_domain		= "Autorisierten websites : ";
176
  $l_autoregistration   = "Automatische registrierung";}
176
  $l_autoregistration   = "Automatische registrierung";}
177
else if($Language == 'nl'){
177
else if($Language == 'nl'){
178
  $l_ChilliError	= "De authenticatie moet een succes worden via de captive portal dienst.";
178
  $l_ChilliError	= "De authenticatie moet een succes worden via de captive portal dienst.";
179
  $l_login		= "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie.";
179
  $l_login		= "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie.";
180
  $l_logout		= "Slotkoers verbinding";
180
  $l_logout		= "Slotkoers verbinding";
181
  $l_loginfailed	= "Authenticatie mislukt";
181
  $l_loginfailed	= "Authenticatie mislukt";
182
  $l_loggingin		= "Identificatie van de captive-portaal";
182
  $l_loggingin		= "Identificatie van de captive-portaal";
183
  $l_loggedcont		= "toegangscontrole";
183
  $l_loggedcont		= "toegangscontrole";
184
  $l_loggedout		= "Uw sessie is gesloten";
184
  $l_loggedout		= "Uw sessie is gesloten";
185
  $l_user		= "Gebruiker";
185
  $l_user		= "Gebruiker";
186
  $l_password		= "Wachtwoord";
186
  $l_password		= "Wachtwoord";
187
  $l_wait		= "Wacht een moment ...";
187
  $l_wait		= "Wacht een moment ...";
188
  $l_onlinetime		= "Sluit tijd:";
188
  $l_onlinetime		= "Sluit tijd:";
189
  $l_remainingtime	= "Verbreking in:";
189
  $l_remainingtime	= "Verbreking in:";
190
  $l_encrypted		= "De opening moet gebruiken gecodeerde verbinding";
190
  $l_encrypted		= "De opening moet gebruiken gecodeerde verbinding";
191
  $l_boutonO		= "Authenticatie";
191
  $l_boutonO		= "Authenticatie";
192
  $l_boutonF		= "Sluiten";
192
  $l_boutonF		= "Sluiten";
193
  $l_loggedin_stringl1	= "Information System Security";
193
  $l_loggedin_stringl1	= "Information System Security";
194
  $l_loggedin_stringl2	= "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
194
  $l_loggedin_stringl2	= "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
195
  $l_loggedin_stringl3	= "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
195
  $l_loggedin_stringl3	= "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
196
  $l_loggedin_stringl4	= "De geregistreerde gegevens kunnen worden kunnen worden bediend door een rechterlijke instantie in de loop van een onderzoek.";
196
  $l_loggedin_stringl4	= "De geregistreerde gegevens kunnen worden kunnen worden bediend door een rechterlijke instantie in de loop van een onderzoek.";
197
  $l_loggedin_stringl5	= "Deze gegevens worden automatisch verwijderd na een jaar.";
197
  $l_loggedin_stringl5	= "Deze gegevens worden automatisch verwijderd na een jaar.";
198
  $l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
198
  $l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
199
  $l_loggedout_string	= "Logout gemaakt intern portaal!";
199
  $l_loggedout_string	= "Logout gemaakt intern portaal!";
200
  $l_reply_1 		= "Your daily connexion time has been reached";
200
  $l_reply_1 		= "Your daily connexion time has been reached";
201
  $l_reply_2		= "Your monthly connexion time has been reached";
201
  $l_reply_2		= "Your monthly connexion time has been reached";
202
  $l_reply_3		= "You try to connect outside of your allowed timespan";
202
  $l_reply_3		= "You try to connect outside of your allowed timespan";
203
  $l_reply_4		= "your account expired";
203
  $l_reply_4		= "your account expired";
204
  $l_reply_5		= "You have reached the maximum number of simultaneous logins";
204
  $l_reply_5		= "You have reached the maximum number of simultaneous logins";
205
  $l_reply_6		= "Your authorized connexion time has been reached";
205
  $l_reply_6		= "Your authorized connexion time has been reached";
206
  $l_online_time	= "Online tijd";
206
  $l_online_time	= "Online tijd";
207
  $l_remaining_time	= "Reterende tijd";
207
  $l_remaining_time	= "Reterende tijd";
208
  $l_uam_domain		= "Geautoriseerde website : ";
208
  $l_uam_domain		= "Geautoriseerde website : ";
209
  $l_autoregistration   = "Automatische registratie";}
209
  $l_autoregistration   = "Automatische registratie";}
210
else if($Language == 'fr'){
210
else if($Language == 'fr'){
211
  $l_ChilliError	= "L'authentification doit être réussie sur le portail captif.";
211
  $l_ChilliError	= "L'authentification doit être réussie sur le portail captif.";
212
  $l_login		= "Authentification réussie.<HR>La fermeture de cette fenêtre interrompt votre session.";
212
  $l_login		= "Authentification réussie.<HR>La fermeture de cette fenêtre interrompt votre session.";
213
  $l_logout		= "Fermeture de la session";
213
  $l_logout		= "Fermeture de la session";
214
  $l_loginfailed	= "Echec d'authentification";
214
  $l_loginfailed	= "Echec d'authentification";
215
  $l_loggingin		= "Identification sur le portail captif";
215
  $l_loggingin		= "Identification sur le portail captif";
216
  $l_loggedcont		= "Contrôle d'accès";
216
  $l_loggedcont		= "Contrôle d'accès";
217
  $l_loggedout		= "Votre session est fermée";
217
  $l_loggedout		= "Votre session est fermée";
218
  $l_user		= "Identifiant";
218
  $l_user		= "Identifiant";
219
  $l_password		= "Mot de passe";
219
  $l_password		= "Mot de passe";
220
  $l_wait		= "Patientez un instant ...";
220
  $l_wait		= "Patientez un instant ...";
221
  $l_onlinetime		= "Temps de connexion:";
221
  $l_onlinetime		= "Temps de connexion:";
222
  $l_remainingtime	= "Deconnexion dans :";
222
  $l_remainingtime	= "Deconnexion dans :";
223
  $l_encrypted		= "La connexion avec le portail doit être chiffrée";
223
  $l_encrypted		= "La connexion avec le portail doit être chiffrée";
224
  $l_boutonO		= "Authentification";
224
  $l_boutonO		= "Authentification";
225
  $l_boutonF		= "Fermer";
225
  $l_boutonF		= "Fermer";
226
  $l_loggedin_stringl1	= "Sécurité des Systèmes d'Information";
226
  $l_loggedin_stringl1	= "Sécurité des Systèmes d'Information";
227
  $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.";
227
  $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.";
228
  $l_loggedin_stringl3	= "Votre activité sur le réseau est enregistrée conformément au respect de la vie privée.";
228
  $l_loggedin_stringl3	= "Votre activité sur le réseau est enregistrée conformément au respect de la vie privée.";
229
  $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.";
229
  $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.";
230
  $l_loggedin_stringl5	= "Ces données seront automatiquement supprimées au bout d'un an.";
230
  $l_loggedin_stringl5	= "Ces données seront automatiquement supprimées au bout d'un an.";
231
  $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";
231
  $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";
232
  $l_loggedout_string	= "Déconnexion du portail captif effectuée !";
232
  $l_loggedout_string	= "Déconnexion du portail captif effectuée !";
233
  $l_reply_1		= "Votre durée de connexion journalière a été atteinte";
233
  $l_reply_1		= "Votre durée de connexion journalière a été atteinte";
234
  $l_reply_2		= "Votre durée de connexion mensuelle a été atteinte";
234
  $l_reply_2		= "Votre durée de connexion mensuelle a été atteinte";
235
  $l_reply_3		= "Vous tentez de vous connecter en dehors de votre période autorisée";
235
  $l_reply_3		= "Vous tentez de vous connecter en dehors de votre période autorisée";
236
  $l_reply_4		= "Votre compte a expiré";
236
  $l_reply_4		= "Votre compte a expiré";
237
  $l_reply_5		= "Vous avez atteint le nombre maximum de connexions simultanées";
237
  $l_reply_5		= "Vous avez atteint le nombre maximum de connexions simultanées";
238
  $l_reply_6		= "Votre durée de connexion autorisée a été atteinte";
238
  $l_reply_6		= "Votre durée de connexion autorisée a été atteinte";
239
  $l_online_time	= "Temps de connexion";
239
  $l_online_time	= "Temps de connexion";
240
  $l_remaining_time	= "Temps restant";
240
  $l_remaining_time	= "Temps restant";
241
  $l_uam_domain		= "Sites autorisés : ";
241
  $l_uam_domain		= "Sites autorisés : ";
242
  $l_autoregistration	= "Auto enregistrement (sms)";}
242
  $l_autoregistration	= "Auto enregistrement (sms)";}
243
else{
243
else{
244
  $l_ChilliError	= "The authentication must be successful through the captive portal service.";
244
  $l_ChilliError	= "The authentication must be successful through the captive portal service.";
245
  $l_login		= "Successful authentication.<HR>Closing this window interrupts your session";
245
  $l_login		= "Successful authentication.<HR>Closing this window interrupts your session";
246
  $l_logout		= "Closing connection";
246
  $l_logout		= "Closing connection";
247
  $l_loginfailed	= "Authentication Failed";
247
  $l_loginfailed	= "Authentication Failed";
248
  $l_loggingin		= "Identification on the captive portal";
248
  $l_loggingin		= "Identification on the captive portal";
249
  $l_loggedcont		= "Access Control";
249
  $l_loggedcont		= "Access Control";
250
  $l_loggedout		= "Your session is closed";
250
  $l_loggedout		= "Your session is closed";
251
  $l_user		= "User";
251
  $l_user		= "User";
252
  $l_password		= "Password";
252
  $l_password		= "Password";
253
  $l_wait		= "Please wait a moment ...";
253
  $l_wait		= "Please wait a moment ...";
254
  $l_onlinetime		= "Connect time:";
254
  $l_onlinetime		= "Connect time:";
255
  $l_remainingtime	= "Disconnection in:";
255
  $l_remainingtime	= "Disconnection in:";
256
  $l_encrypted		= "The connection with the portal must be encrypted";
256
  $l_encrypted		= "The connection with the portal must be encrypted";
257
  $l_boutonO		= "Authentication";
257
  $l_boutonO		= "Authentication";
258
  $l_boutonF		= "Close";
258
  $l_boutonF		= "Close";
259
  $l_loggedin_stringl1	= "Information System Security";
259
  $l_loggedin_stringl1	= "Information System Security";
260
  $l_loggedin_stringl2	= "That control was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
260
  $l_loggedin_stringl2	= "That control was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
261
  $l_loggedin_stringl3	= "Your activity on the network is registered in accordance with privacy.";
261
  $l_loggedin_stringl3	= "Your activity on the network is registered in accordance with privacy.";
262
  $l_loggedin_stringl4	= "The recorded data can be able to be operated by a judicial authority in the course of an investigation.";
262
  $l_loggedin_stringl4	= "The recorded data can be able to be operated by a judicial authority in the course of an investigation.";
263
  $l_loggedin_stringl5	= "These data will be automatically deleted after one year.";
263
  $l_loggedin_stringl5	= "These data will be automatically deleted after one year.";
264
  $l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
264
  $l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
265
  $l_loggedout_string	= "Disconnection of the captive portal made";
265
  $l_loggedout_string	= "Disconnection of the captive portal made";
266
  $l_reply_1		= "Your daily connexion time has been reached";
266
  $l_reply_1		= "Your daily connexion time has been reached";
267
  $l_reply_2		= "Your monthly connexion time has been reached";
267
  $l_reply_2		= "Your monthly connexion time has been reached";
268
  $l_reply_3		= "You try to connect outside of your allowed timespan";
268
  $l_reply_3		= "You try to connect outside of your allowed timespan";
269
  $l_reply_4		= "your account expired";
269
  $l_reply_4		= "your account expired";
270
  $l_reply_5		= "You have reached the maximum number of simultaneous logins";
270
  $l_reply_5		= "You have reached the maximum number of simultaneous logins";
271
  $l_reply_6		= "Your authorized connexion time has been reached";
271
  $l_reply_6		= "Your authorized connexion time has been reached";
272
  $l_online_time	= "Online time";
272
  $l_online_time	= "Online time";
273
  $l_remaining_time	= "Remaining time";
273
  $l_remaining_time	= "Remaining time";
274
  $l_uam_domain		= "Authorized websites : ";
274
  $l_uam_domain		= "Authorized websites : ";
275
  $l_autoregistration	= "Auto registration (sms)";
275
  $l_autoregistration	= "Auto registration (sms)";
276
}
276
}
277
 
277
 
278
# If https not use, tell it's wrong
278
# If https not use, tell it's wrong
279
if (!(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS'] == 'on'))) {
279
if (!(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS'] == 'on'))) {
280
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
280
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
281
<html>
281
<html>
282
<head>
282
<head>
283
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
283
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
284
  <title>$l_loggedcont</title>
284
  <title>$l_loggedcont</title>
285
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
285
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
286
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
286
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
287
</head>
287
</head>
288
<body bgColor = 'white'>
288
<body bgColor = 'white'>
289
  <h1 style=\"text-align: center;\">$l_loginfailed</h1>
289
  <h1 style=\"text-align: center;\">$l_loginfailed</h1>
290
  <center>$l_encrypted</center>
290
  <center>$l_encrypted</center>
291
</body>
291
</body>
292
</html>";
292
</html>";
293
    exit(0);
293
    exit(0);
294
}
294
}
295
 
295
 
296
# Read form parameters which we care about
296
# Read form parameters which we care about
297
# avoid the "user as a MAC address" attempts
297
# avoid the "user as a MAC address" attempts
298
if ((isset($_POST['UserName'])) && (preg_match('/^([0-9A-F]{2}-){5}[0-9A-F]{2}$/',$_POST['UserName'])!=1)){
298
if ((isset($_POST['UserName'])) && (preg_match('/^([0-9A-F]{2}-){5}[0-9A-F]{2}$/',$_POST['UserName'])!=1)){
299
				$username	= $_POST['UserName'];} else {$username="";}
299
				$username	= $_POST['UserName'];} else {$username="";}
300
if (isset($_POST['Password'])){	$password	= $_POST['Password'];} else {$password="";}
300
if (isset($_POST['Password'])){	$password	= $_POST['Password'];} else {$password="";}
301
if (isset($_POST['challenge'])){$challenge	= $_POST['challenge'];} else {$challenge="";}
301
if (isset($_POST['challenge'])){$challenge	= $_POST['challenge'];} else {$challenge="";}
302
if (isset($_POST['button'])){	$button		= $_POST['button'];} else { $button="";}
302
if (isset($_POST['button'])){	$button		= $_POST['button'];} else { $button="";}
303
//if (isset($_POST['logout'])){	$logout		= $_POST['logout'];} else {$logout="";}
303
//if (isset($_POST['logout'])){	$logout		= $_POST['logout'];} else {$logout="";}
304
//if (isset($_POST['prelogin'])){	$prelogin	= $_POST['prelogin'];} else {$prelogin="";}
304
//if (isset($_POST['prelogin'])){	$prelogin	= $_POST['prelogin'];} else {$prelogin="";}
305
if (isset($_POST['res'])){		$res		= $_POST['res'];} else {$res="";}
305
if (isset($_POST['res'])){		$res		= $_POST['res'];} else {$res="";}
306
if (isset($_POST['uamip'])){	$uamip		= $_POST['uamip'];} else {$uamip="";}
306
if (isset($_POST['uamip'])){	$uamip		= $_POST['uamip'];} else {$uamip="";}
307
if (isset($_POST['uamport'])){	$uamport	= $_POST['uamport'];} else {$uamport="";}
307
if (isset($_POST['uamport'])){	$uamport	= $_POST['uamport'];} else {$uamport="";}
308
if (isset($_POST['userurl'])){	$userurl	= $_POST['userurl'];} else {$userurl="";}
308
if (isset($_POST['userurl'])){	$userurl	= $_POST['userurl'];} else {$userurl="";}
309
if (isset($_POST['timeleft'])){	$timeleft	= $_POST['timeleft'];} else {$timeleft="";}
309
if (isset($_POST['timeleft'])){	$timeleft	= $_POST['timeleft'];} else {$timeleft="";}
310
if (isset($_POST['redirurl'])){	$redirurl	= $_POST['redirurl'];} else {$redirurl="";}
310
if (isset($_POST['redirurl'])){	$redirurl	= $_POST['redirurl'];} else {$redirurl="";}
311
 
311
 
312
# Read query parameters which we care about
312
# Read query parameters which we care about
313
if (isset($_GET['res']))		$res		= $_GET['res'];
313
if (isset($_GET['res']))		$res		= $_GET['res'];
314
if (isset($_GET['challenge']))	$challenge	= $_GET['challenge'];
314
if (isset($_GET['challenge']))	$challenge	= $_GET['challenge'];
315
if (isset($_GET['uamip']))		$uamip		= $_GET['uamip'];
315
if (isset($_GET['uamip']))		$uamip		= $_GET['uamip'];
316
if (isset($_GET['uamport']))	$uamport	= $_GET['uamport'];
316
if (isset($_GET['uamport']))	$uamport	= $_GET['uamport'];
317
if (isset($_GET['reply'])){		$reply		= $_GET['reply'];} else {$reply="";}
317
if (isset($_GET['reply'])){		$reply		= $_GET['reply'];} else {$reply="";}
318
if (isset($_GET['userurl']))	$userurl	= $_GET['userurl'];
318
if (isset($_GET['userurl']))	$userurl	= $_GET['userurl'];
319
if (isset($_GET['timeleft']))	$timeleft	= $_GET['timeleft'];
319
if (isset($_GET['timeleft']))	$timeleft	= $_GET['timeleft'];
320
if (isset($_GET['redirurl']))	$redirurl	= $_GET['redirurl'];
320
if (isset($_GET['redirurl']))	$redirurl	= $_GET['redirurl'];
321
 
321
 
322
# translation of radius replies
322
# translation of radius replies
323
if (isset($reply)){
323
if (isset($reply)){
324
	switch(trim ($reply)) {
324
	switch(trim ($reply)) {
325
  case 'Your maximum daily usage time has been reached' : $reply = $l_reply_1 ; break;
325
  case 'Your maximum daily usage time has been reached' : $reply = $l_reply_1 ; break;
326
  case 'Your maximum monthly usage time has been reached' : $reply = $l_reply_2 ; break;
326
  case 'Your maximum monthly usage time has been reached' : $reply = $l_reply_2 ; break;
327
  case 'You are calling outside your allowed timespan' : $reply = $l_reply_3 ; break;
327
  case 'You are calling outside your allowed timespan' : $reply = $l_reply_3 ; break;
328
  case 'Password Has Expired' : $reply =  $l_reply_4 ; break;
328
  case 'Password Has Expired' : $reply =  $l_reply_4 ; break;
329
  case 'You are already logged in - access denied' : $reply = $l_reply_5 ; break;
329
  case 'You are already logged in - access denied' : $reply = $l_reply_5 ; break;
330
  case 'Your maximum never usage time has been reached' : $reply = $l_reply_6 ; break;
330
  case 'Your maximum never usage time has been reached' : $reply = $l_reply_6 ; break;
331
  }}
331
  }}
332
 
332
 
333
# If attempt to login
333
# If attempt to login
334
if ("$button" == "$l_boutonO") {
334
if ("$button" == "$l_boutonO") {
-
 
335
  #correction password length
-
 
336
  #http://www.stochasticgeometry.ie/2009/09/09/maximum-password-length-in-coova-chilli/
335
  $hexchal = pack ("H32", $challenge);
337
  $hexchal = pack ("H*", $challenge);
336
  $newchal = pack ("H*", md5($hexchal . $uamsecret));
338
  $newchal = pack ("H*", md5($hexchal . $uamsecret));
-
 
339
 
-
 
340
  while (strlen($newchal) < strlen($password)){
-
 
341
                       $newchal .= $newchal;
-
 
342
  }
-
 
343
 
337
  $response = md5("\0" . $password . $newchal);
344
  $response = md5("\0" . $password . $newchal);
338
  $newpwd = pack("a32", $password);
345
  $newpwd = pack("a*", $password);
339
  $pappassword = implode ("", unpack("H32", ($newpwd ^ $newchal)));
346
  $pappassword = implode ("", unpack("H*", ($newpwd ^ $newchal)));
340
  echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
347
  echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
341
<html>
348
<html>
342
<head>
349
<head>
343
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
350
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
344
  <title>$l_loggingin</title>
351
  <title>$l_loggingin</title>
345
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
352
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
346
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
353
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
347
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl\">
354
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl\">
348
  </head>
355
  </head>
349
<body bgColor = 'white'>
356
<body bgColor = 'white'>
350
<h1 style=\"text-align: center;\">$l_loggingin</h1>
357
<h1 style=\"text-align: center;\">$l_loggingin</h1>
351
  <center>
358
  <center>
352
    $l_wait
359
    $l_wait
353
  </center>
360
  </center>
354
</body>
361
</body>
355
</html>";
362
</html>";
356
exit(0);
363
exit(0);
357
}
364
}
358
 
365
 
359
switch($res) {
366
switch($res) {
360
  case 'success':     $result =  1; break; // If login successful
367
  case 'success':     $result =  1; break; // If login successful
361
  case 'failed':      $result =  2; break; // If login failed
368
  case 'failed':      $result =  2; break; // If login failed
362
  case 'logoff':      $result =  3; break; // If logout successful
369
  case 'logoff':      $result =  3; break; // If logout successful
363
  case 'already':     $result =  4; break; // If tried to login while already logged in
370
  case 'already':     $result =  4; break; // If tried to login while already logged in
364
  case 'notyet':      $result =  5; break; // If not logged in yet
371
  case 'notyet':      $result =  5; break; // If not logged in yet
365
  default: $result = 0; // Default: It was not a form request -> client go to login form
372
  default: $result = 0; // Default: It was not a form request -> client go to login form
366
}
373
}
367
 
374
 
368
# Otherwise it was not a form request
375
# Otherwise it was not a form request
369
# Send out an error message
376
# Send out an error message
370
if ($result == 0) {	//erreur
377
if ($result == 0) {	//erreur
371
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
378
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
372
<html>
379
<html>
373
<head>
380
<head>
374
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
381
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
375
  <title>$l_loggingin</title>
382
  <title>$l_loggingin</title>
376
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
383
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
377
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
384
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
378
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/prelogin\">
385
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/prelogin\">
379
  </head>
386
  </head>
380
<body bgColor = 'white'>
387
<body bgColor = 'white'>
381
<h1 style=\"text-align: center;\">$l_loggingin</h1>
388
<h1 style=\"text-align: center;\">$l_loggingin</h1>
382
  <center>
389
  <center>
383
    $l_wait
390
    $l_wait
384
  </center>
391
  </center>
385
</body>
392
</body>
386
</html>";
393
</html>";
387
    exit(0);
394
    exit(0);
388
}
395
}
389
# Generate the output
396
# Generate the output
390
echo "<!DOCTYPE html>
397
echo "<!DOCTYPE html>
391
<html>
398
<html>
392
<head>
399
<head>
393
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
400
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
394
  <title>$l_loggingin</title>
401
  <title>$l_loggingin</title>
395
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
402
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
396
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
403
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
397
  <script type=\"text/javascript\" language=\"JavaScript\">
404
  <script type=\"text/javascript\" language=\"JavaScript\">
398
	alcasar_popup = null;
405
	alcasar_popup = null;
399
	function popUp(URL) {
406
	function popUp(URL) {
400
		if (self.name != \"alcasar_popup\") {
407
		if (self.name != \"alcasar_popup\") {
401
			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');
402
		}
409
		}
403
	}
410
	}
404
	function doOnLoad(result, userurl, redirurl, adminurl, timeleft) {
411
	function doOnLoad(result, userurl, redirurl, adminurl, timeleft) {
405
		if ((result == 1)||(result == 4)) {	//success or already
412
		if ((result == 1)||(result == 4)) {	//success or already
406
			//window.location = userurl;
413
			//window.location = userurl;
407
			if (alcasar_popup != null) alcasar_popup.focus();
414
			if (alcasar_popup != null) alcasar_popup.focus();
408
			if (adminurl != ''){
415
			if (adminurl != ''){
409
				window.location = adminurl;
416
				window.location = adminurl;
410
			} else if (redirurl != '') {
417
			} else if (redirurl != '') {
411
				window.location = redirurl;
418
				window.location = redirurl;
412
				} else if (userurl != '') {
419
				} else if (userurl != '') {
413
					window.location = userurl;
420
					window.location = userurl;
414
				} else {
421
				} else {
415
				window.home();
422
				window.home();
416
			}
423
			}
417
		}
424
		}
418
		if ((result == 2) || (result == 3) || result == 5) { //failed or logoff or notyet
425
		if ((result == 2) || (result == 3) || result == 5) { //failed or logoff or notyet
419
			if (alcasar_popup != null) alcasar_popup.close();
426
			if (alcasar_popup != null) alcasar_popup.close();
420
			document.form1.UserName.focus();
427
			document.form1.UserName.focus();
421
		}
428
		}
422
	}
429
	}
423
</script>
430
</script>
424
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
431
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
425
</head>
432
</head>
426
<body onLoad=\"javascript:doOnLoad($result,'$userurl','$redirurl','$adminurl','$timeleft')\">
433
<body onLoad=\"javascript:doOnLoad($result,'$userurl','$redirurl','$adminurl','$timeleft')\">
427
  <center>";
434
  <center>";
428
if ($result == 2 || $result == 3 || $result == 5) { //failed or logoff or notyet
435
if ($result == 2 || $result == 3 || $result == 5) { //failed or logoff or notyet
429
  echo "
436
  echo "
430
	<div id=\"logon\">
437
	<div id=\"logon\">
431
	<h1>$organisme</h1>
438
	<h1>$organisme</h1>
432
	<h2>$l_loggedcont</h2>";
439
	<h2>$l_loggedcont</h2>";
433
	if ($result == 2) { //failed
440
	if ($result == 2) { //failed
434
		echo "	
441
		echo "	
435
		<h3>$l_loginfailed</h3>";
442
		<h3>$l_loginfailed</h3>";
436
		if ($reply) {
443
		if ($reply) {
437
		#traitement du reply ...
444
		#traitement du reply ...
438
		echo "<center> $reply <br /><br /></center>";
445
		echo "<center> $reply <br /><br /></center>";
439
		}
446
		}
440
	}
447
	}
441
	if ($userurl == "http://logout/") $userurl="http://www.google.com"; //avoid cyclic logout
448
	if ($userurl == "http://logout/") $userurl="http://www.google.com"; //avoid cyclic logout
442
	echo "
449
	echo "
443
	<img id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
450
	<img id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
444
	<form name=\"form1\" method=\"post\" action=\"$loginpath\">
451
	<form name=\"form1\" method=\"post\" action=\"$loginpath\">
445
	<input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
452
	<input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
446
	<input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
453
	<input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
447
	<input type=\"hidden\" name=\"uamport\" value=\"$uamport\">
454
	<input type=\"hidden\" name=\"uamport\" value=\"$uamport\">
448
	<input type=\"hidden\" name=\"userurl\" value=\"$userurl\">
455
	<input type=\"hidden\" name=\"userurl\" value=\"$userurl\">
449
	<table id=\"boite-logon\">
456
	<table id=\"boite-logon\">
450
		<tr>
457
		<tr>
451
			<td width=\"20%\" rowspan=\"4\"><img id=\"logo-organ\" src=\"/images/organisme.png\"></td>
458
			<td width=\"20%\" rowspan=\"4\"><img id=\"logo-organ\" src=\"/images/organisme.png\"></td>
452
			<td width=\"30%\" align=\"right\">$l_user</td>
459
			<td width=\"30%\" align=\"right\">$l_user</td>
453
			<td width=\"50%\" align=\"left\"><INPUT type=\"text\" maxLength=\"32\" name=\"UserName\" autocomplete=\"off\"></td>
460
			<td width=\"50%\" align=\"left\"><INPUT type=\"text\" maxLength=\"32\" name=\"UserName\" autocomplete=\"off\"></td>
454
		</tr>
461
		</tr>
455
		<tr>
462
		<tr>
456
			<td align=\"right\">$l_password</td>
463
			<td align=\"right\">$l_password</td>
457
			<td align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\" autocomplete=\"off\"></td>
464
			<td align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\" autocomplete=\"off\"></td>
458
		</tr>
465
		</tr>
459
		";
466
		";
460
 
467
 
461
	echo "	</tr>
468
	echo "	</tr>
462
			<td height=\"23\"  align=\"left\"><INPUT value=\"$l_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$statuspath')\"></td>
469
			<td height=\"23\"  align=\"left\"><INPUT value=\"$l_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$statuspath')\"></td>
463
		";
470
		";
464
 
471
 
465
 
472
 
466
	$service_SMS_status=false;
473
	$service_SMS_status=false;
467
	if($service_SMS_status){
474
	if($service_SMS_status){
468
		echo "	<td><a href=\"./autoregistrationinfo.php\">".$l_autoregistration."</a></td>";
475
		echo "	<td><a href=\"./autoregistrationinfo.php\">".$l_autoregistration."</a></td>";
469
	}
476
	}
470
 
477
 
471
	echo "	</tr>
478
	echo "	</tr>
472
	</table>
479
	</table>
473
 
480
 
474
	</form>
481
	</form>
475
	<table id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"80%\">
482
	<table id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"80%\">
476
		<tr>
483
		<tr>
477
			<td align=\"center\"><FONT color=\"red\"><B>$l_loggedin_stringl1</B></FONT></td>
484
			<td align=\"center\"><FONT color=\"red\"><B>$l_loggedin_stringl1</B></FONT></td>
478
		</tr>
485
		</tr>
479
		<tr>
486
		<tr>
480
			<td align=\"left\">
487
			<td align=\"left\">
481
				<ul>
488
				<ul>
482
					<LI>$l_loggedin_stringl2</LI>
489
					<LI>$l_loggedin_stringl2</LI>
483
					<LI>$l_loggedin_stringl4</LI>
490
					<LI>$l_loggedin_stringl4</LI>
484
					<LI>$l_loggedin_stringl3</LI>
491
					<LI>$l_loggedin_stringl3</LI>
485
					<LI>$l_loggedin_stringl5</LI>
492
					<LI>$l_loggedin_stringl5</LI>
486
					<LI>$l_loggedin_stringl6</LI>
493
					<LI>$l_loggedin_stringl6</LI>
487
				</ul>
494
				</ul>
488
			</td>
495
			</td>
489
		</tr>
496
		</tr>
490
	</table>";
497
	</table>";
491
 
498
 
492
// Read the "Domain allowed" file
499
// Read the "Domain allowed" file
493
$tab=file(DOMAIN_ALLOWED_LIST);
500
$tab=file(DOMAIN_ALLOWED_LIST);
494
if ($tab)  # the file isn't empty
501
if ($tab)  # the file isn't empty
495
	{
502
	{
496
	echo "<div id=\"authorized_domain\">$l_uam_domain";
503
	echo "<div id=\"authorized_domain\">$l_uam_domain";
497
	foreach ($tab as $line)
504
	foreach ($tab as $line)
498
		{
505
		{
499
		if (trim($line) != '') # the line isn't empty
506
		if (trim($line) != '') # the line isn't empty
500
			{
507
			{
501
			$domain_allowed=explode("#", $line);
508
			$domain_allowed=explode("#", $line);
502
			if (trim($domain_allowed[1]) != ''){
509
			if (trim($domain_allowed[1]) != ''){
503
				$domain=explode("\"", $domain_allowed[0]);
510
				$domain=explode("\"", $domain_allowed[0]);
504
				echo "<a href=\"http://".trim($domain[1])."\">".trim($domain_allowed[1])."</a> ";}
511
				echo "<a href=\"http://".trim($domain[1])."\">".trim($domain_allowed[1])."</a> ";}
505
			}	
512
			}	
506
		}
513
		}
507
	}
514
	}
508
echo "	
515
echo "	
509
</div>
516
</div>
510
</center>
517
</center>
511
</body>
518
</body>
512
</html>";
519
</html>";
513
}
520
}
514
exit(0);
521
exit(0);
515
?>
522
?>
516
 
523