Subversion Repositories ALCASAR

Rev

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

Rev 533 Rev 571
1
<?php
1
<?php
2
#
2
#
3
# intercept.php for Alcasar captive portal
3
# intercept.php for Alcasar captive portal
4
# Copyright (C) 2003, 2004 Mondru AB.
4
# Copyright (C) 2003, 2004 Mondru AB.
5
# Modify by REXY & steweb57
5
# Modify by REXY & steweb57
6
# UI & css style by stephane ERARD
6
# UI & css style by stephane ERARD
7
# Help for language translation by B. AUBARD (thanks)
7
# Help for language translation by B. AUBARD (thanks)
8
 
8
 
9
# The contents of this file may be used under the terms of the GNU
9
# The contents of this file may be used under the terms of the GNU
10
# General Public License Version 2, provided that the above copyright
10
# General Public License Version 2, provided that the above copyright
11
# notice and this permission notice is included in all copies or
11
# notice and this permission notice is included in all copies or
12
# substantial portions of the software.
12
# substantial portions of the software.
13
 
13
 
14
$organisme = "";
14
$organisme = "";
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
# Shared secret used to encrypt challenge with radius.
24
# Shared secret used to encrypt challenge with radius.
25
$uamsecret = "";
25
$uamsecret = "";
26
 
26
 
27
# URL loaded after success authenticates (let blank for browser defaults)
27
# URL loaded after success authenticates (let blank for browser defaults)
28
$adminurl = "";
28
$adminurl = "";
29
 
29
 
30
# Our own path
30
# Our own path
31
$loginpath	= $_SERVER['PHP_SELF'];
31
$loginpath	= $_SERVER['PHP_SELF'];
32
$alcasarpath = "http://alcasar";
32
$alcasarpath = "http://alcasar";
33
$statuspath = $alcasarpath."/status.php";
33
$statuspath = $alcasarpath."/status.php";
34
$debug		= false;
34
$debug		= false;
35
 
35
 
36
# Choice of language
36
# Choice of language
37
$Language = 'en';
37
$Language = 'en';
38
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
38
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
39
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
39
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
40
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
40
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
41
if($Language == 'es'){
41
if($Language == 'es'){
42
  $l_ChilliError	= "La autenticación debe ser un éxito a través del servicio de portal cautivo.";
42
  $l_ChilliError	= "La autenticación debe ser un éxito a través del servicio de portal cautivo.";
43
  $l_login		= "El éxito de la autenticación.<HR>Cierre esta ventana interrumpte la sesion.";
43
  $l_login		= "El éxito de la autenticación.<HR>Cierre esta ventana interrumpte la sesion.";
44
  $l_logout		= "Conexión de cierre";
44
  $l_logout		= "Conexión de cierre";
45
  $l_loginfailed	= "Error de autenticación";
45
  $l_loginfailed	= "Error de autenticación";
46
  $l_loggingin		= "Identificación en el portal cautivo";
46
  $l_loggingin		= "Identificación en el portal cautivo";
47
  $l_loggedcont		= "Red de Control de Acceso";
47
  $l_loggedcont		= "Red de Control de Acceso";
48
  $l_loggedout		= "Su sesión se cierra";
48
  $l_loggedout		= "Su sesión se cierra";
49
  $l_user		= "Usuario";
49
  $l_user		= "Usuario";
50
  $l_password		= "Contraseña";
50
  $l_password		= "Contraseña";
51
  $l_wait		= "Por favor, espere un momento ...";
51
  $l_wait		= "Por favor, espere un momento ...";
52
  $l_onlinetime		= "Tiempo de conexión:";
52
  $l_onlinetime		= "Tiempo de conexión:";
53
  $l_remainingtime	= "Desconexión en:";
53
  $l_remainingtime	= "Desconexión en:";
54
  $l_encrypted		= "La apertura debe usar conexión cifrada";
54
  $l_encrypted		= "La apertura debe usar conexión cifrada";
55
  $l_boutonO		= "Autenticación";
55
  $l_boutonO		= "Autenticación";
56
  $l_boutonF		= "Cerrar";
56
  $l_boutonF		= "Cerrar";
57
  $l_loggedin_stringl1 = "Information System Security";
57
  $l_loggedin_stringl1 = "Information System Security";
58
  $l_loggedin_stringl2 = "El portal fue creado reglamentos para garantizar la trazabilidad, la rendición de cuentas y el no repudio de las conexiones.";
58
  $l_loggedin_stringl2 = "El portal fue creado reglamentos para garantizar la trazabilidad, la rendición de cuentas y el no repudio de las conexiones.";
59
  $l_loggedin_stringl3 = "Su actividad en la red es registrada, de conformidad con la privacidad.";
59
  $l_loggedin_stringl3 = "Su actividad en la red es registrada, de conformidad con la privacidad.";
60
  $l_loggedin_stringl4 = "Los datos registrados pueden ser capaces de ser operado por una autoridad judicial en el curso de una investigación.";
60
  $l_loggedin_stringl4 = "Los datos registrados pueden ser capaces de ser operado por una autoridad judicial en el curso de una investigación.";
61
  $l_loggedin_stringl5 = "Estos datos se eliminan automáticamente después de un año.";
61
  $l_loggedin_stringl5 = "Estos datos se eliminan automáticamente después de un año.";
62
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
62
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
63
  $l_loggedout_string = "Cerrar sesión hizo portal cautivo!";
63
  $l_loggedout_string = "Cerrar sesión hizo portal cautivo!";
64
  $l_reply_1 = "Your daily connexion time has been reached";
64
  $l_reply_1 = "Your daily connexion time has been reached";
65
  $l_reply_2 = "Your monthly connexion time has been reached";
65
  $l_reply_2 = "Your monthly connexion time has been reached";
66
  $l_reply_3 = "You try to connect outside of your allowed timespan";
66
  $l_reply_3 = "You try to connect outside of your allowed timespan";
67
  $l_reply_4 = "your account expired";
67
  $l_reply_4 = "your account expired";
68
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
68
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
69
  $l_online_time = "Tiempo en linea";
69
  $l_online_time = "Tiempo en linea";
70
  $l_remaining_time = "Tiempo restante";
70
  $l_remaining_time = "Tiempo restante";
71
}
71
}
72
else if($Language == 'de'){
72
else if($Language == 'de'){
73
  $l_ChilliError	= "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
73
  $l_ChilliError	= "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
74
  $l_login		= "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung";
74
  $l_login		= "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung";
75
  $l_logout		= "Beenden der Verbindung";
75
  $l_logout		= "Beenden der Verbindung";
76
  $l_loginfailed	= "Authentifizierungsfehler Eigenverbrauch";
76
  $l_loginfailed	= "Authentifizierungsfehler Eigenverbrauch";
77
  $l_loggingin		= "Kennzeichnung auf dem Eigenverbrauch";
77
  $l_loggingin		= "Kennzeichnung auf dem Eigenverbrauch";
78
  $l_loggedcont		= "Network Access Control";
78
  $l_loggedcont		= "Network Access Control";
79
  $l_loggedout		= "Ihre Sitzung ist geschlossen";
79
  $l_loggedout		= "Ihre Sitzung ist geschlossen";
80
  $l_user		= "Benutzer";
80
  $l_user		= "Benutzer";
81
  $l_password		= "Passwort";
81
  $l_password		= "Passwort";
82
  $l_wait		= "Bitte warten Sie einen Moment ...";
82
  $l_wait		= "Bitte warten Sie einen Moment ...";
83
  $l_onlinetime		= "Online-Zeit:";
83
  $l_onlinetime		= "Online-Zeit:";
84
  $l_remainingtime	= "Abmelden:";
84
  $l_remainingtime	= "Abmelden:";
85
  $l_encrypted		= "Die Öffnung muß der Anschluß Zahlen";
85
  $l_encrypted		= "Die Öffnung muß der Anschluß Zahlen";
86
  $l_boutonO		= "Authentifizierung";
86
  $l_boutonO		= "Authentifizierung";
87
  $l_boutonF		= "Schließen";
87
  $l_boutonF		= "Schließen";
88
  $l_loggedin_stringl1 = "Information System Security";
88
  $l_loggedin_stringl1 = "Information System Security";
89
  $l_loggedin_stringl2 = "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, der Zurechenbarkeit und der Nicht-Anerkennung der Verbindungen.";
89
  $l_loggedin_stringl2 = "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, der Zurechenbarkeit und der Nicht-Anerkennung der Verbindungen.";
90
  $l_loggedin_stringl3 = "Ihre Tätigkeit im Netzwerk registriert ist nach Schutz der Privatsphäre.";
90
  $l_loggedin_stringl3 = "Ihre Tätigkeit im Netzwerk registriert ist nach Schutz der Privatsphäre.";
91
  $l_loggedin_stringl4 = "Die gespeicherten Daten nicht pouront genutzt werden, dass von einer Justizbehörde im Rahmen einer Untersuchung.";
91
  $l_loggedin_stringl4 = "Die gespeicherten Daten nicht pouront genutzt werden, dass von einer Justizbehörde im Rahmen einer Untersuchung.";
92
  $l_loggedin_stringl5 = "Diese Daten werden automatisch gelöscht nach einem Jahr.";
92
  $l_loggedin_stringl5 = "Diese Daten werden automatisch gelöscht nach einem Jahr.";
93
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
93
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
94
  $l_loggedout_string = "Trennung des Portals erfolgt Gefangener!";
94
  $l_loggedout_string = "Trennung des Portals erfolgt Gefangener!";
95
  $l_reply_1 = "Your daily connexion time has been reached";
95
  $l_reply_1 = "Your daily connexion time has been reached";
96
  $l_reply_2 = "Your monthly connexion time has been reached";
96
  $l_reply_2 = "Your monthly connexion time has been reached";
97
  $l_reply_3 = "You try to connect outside of your allowed timespan";
97
  $l_reply_3 = "You try to connect outside of your allowed timespan";
98
  $l_reply_4 = "your account expired";
98
  $l_reply_4 = "your account expired";
99
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
99
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
100
  $l_online_time = "Online-zeit";
100
  $l_online_time = "Online-zeit";
101
  $l_remaining_time = "Restzeit";
101
  $l_remaining_time = "Restzeit";
102
 
-
 
103
}
102
}
104
else if($Language == 'nl'){
103
else if($Language == 'nl'){
105
  $l_ChilliError	= "De authenticatie moet een succes worden via de captive portal dienst.";
104
  $l_ChilliError	= "De authenticatie moet een succes worden via de captive portal dienst.";
106
  $l_login		= "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie.";
105
  $l_login		= "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie.";
107
  $l_logout		= "Slotkoers verbinding";
106
  $l_logout		= "Slotkoers verbinding";
108
  $l_loginfailed	= "Authenticatie mislukt";
107
  $l_loginfailed	= "Authenticatie mislukt";
109
  $l_loggingin		= "Identificatie van de captive-portaal";
108
  $l_loggingin		= "Identificatie van de captive-portaal";
110
  $l_loggedcont		= "Network Access Control";
109
  $l_loggedcont		= "Network Access Control";
111
  $l_loggedout		= "Uw sessie is gesloten";
110
  $l_loggedout		= "Uw sessie is gesloten";
112
  $l_user		= "Gebruiker";
111
  $l_user		= "Gebruiker";
113
  $l_password		= "Wachtwoord";
112
  $l_password		= "Wachtwoord";
114
  $l_wait		= "Wacht een moment ...";
113
  $l_wait		= "Wacht een moment ...";
115
  $l_onlinetime		= "Sluit tijd:";
114
  $l_onlinetime		= "Sluit tijd:";
116
  $l_remainingtime	= "Verbreking in:";
115
  $l_remainingtime	= "Verbreking in:";
117
  $l_encrypted		= "De opening moet gebruiken gecodeerde verbinding";
116
  $l_encrypted		= "De opening moet gebruiken gecodeerde verbinding";
118
  $l_boutonO		= "Authenticatie";
117
  $l_boutonO		= "Authenticatie";
119
  $l_boutonF		= "Sluiten";
118
  $l_boutonF		= "Sluiten";
120
  $l_loggedin_stringl1 = "Information System Security";
119
  $l_loggedin_stringl1 = "Information System Security";
121
  $l_loggedin_stringl2 = "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
120
  $l_loggedin_stringl2 = "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
122
  $l_loggedin_stringl3 = "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
121
  $l_loggedin_stringl3 = "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
123
  $l_loggedin_stringl4 = "De geregistreerde gegevens kunnen worden kunnen worden bediend door een rechterlijke instantie in de loop van een onderzoek.";
122
  $l_loggedin_stringl4 = "De geregistreerde gegevens kunnen worden kunnen worden bediend door een rechterlijke instantie in de loop van een onderzoek.";
124
  $l_loggedin_stringl5 = "Deze gegevens worden automatisch verwijderd na een jaar.";
123
  $l_loggedin_stringl5 = "Deze gegevens worden automatisch verwijderd na een jaar.";
125
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
124
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
126
  $l_loggedout_string = "Logout gemaakt intern portaal!";
125
  $l_loggedout_string = "Logout gemaakt intern portaal!";
127
  $l_reply_1 = "Your daily connexion time has been reached";
126
  $l_reply_1 = "Your daily connexion time has been reached";
128
  $l_reply_2 = "Your monthly connexion time has been reached";
127
  $l_reply_2 = "Your monthly connexion time has been reached";
129
  $l_reply_3 = "You try to connect outside of your allowed timespan";
128
  $l_reply_3 = "You try to connect outside of your allowed timespan";
130
  $l_reply_4 = "your account expired";
129
  $l_reply_4 = "your account expired";
131
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
130
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
132
  $l_online_time = "Online tijd";
131
  $l_online_time = "Online tijd";
133
  $l_remaining_time = "Reterende tijd";
132
  $l_remaining_time = "Reterende tijd";
134
}
133
}
135
else if($Language == 'fr'){
134
else if($Language == 'fr'){
136
  $l_ChilliError	= "L'authentification doit &ecirc;tre r&eacute;ussie au travers du service du portail captif.";
135
  $l_ChilliError	= "L'authentification doit &ecirc;tre r&eacute;ussie au travers du service du portail captif.";
137
  $l_login		= "Authentification r&eacute;ussie.<HR>La fermeture de cette fenêtre interrompt votre session.";
136
  $l_login		= "Authentification r&eacute;ussie.<HR>La fermeture de cette fenêtre interrompt votre session.";
138
  $l_logout		= "Fermeture de la session";
137
  $l_logout		= "Fermeture de la session";
139
  $l_loginfailed	= "Echec d'authentification";
138
  $l_loginfailed	= "Echec d'authentification";
140
  $l_loggingin		= "Identification sur le portail captif";
139
  $l_loggingin		= "Identification sur le portail captif";
141
  $l_loggedcont		= "Contr&ocirc;le d'acc&egrave;s au r&eacute;seau";
140
  $l_loggedcont		= "Contr&ocirc;le d'acc&egrave;s au r&eacute;seau";
142
  $l_loggedout		= "Votre session est fermée";
141
  $l_loggedout		= "Votre session est fermée";
143
  $l_user		= "Identifiant";
142
  $l_user		= "Identifiant";
144
  $l_password		= "Mot de passe";
143
  $l_password		= "Mot de passe";
145
  $l_wait		= "Patientez un instant ...";
144
  $l_wait		= "Patientez un instant ...";
146
  $l_onlinetime		= "Temps de connexion:";
145
  $l_onlinetime		= "Temps de connexion:";
147
  $l_remainingtime	= "Deconnexion dans :";
146
  $l_remainingtime	= "Deconnexion dans :";
148
  $l_encrypted		= "La connexion avec le portail doit &ecirc;tre chiffr&eacute;e";
147
  $l_encrypted		= "La connexion avec le portail doit &ecirc;tre chiffr&eacute;e";
149
  $l_boutonO		= "Authentification";
148
  $l_boutonO		= "Authentification";
150
  $l_boutonF		= "Fermer";
149
  $l_boutonF		= "Fermer";
151
  $l_loggedin_stringl1 = "S&eacute;curit&eacute; des Syst&egrave;mes d'Information";
150
  $l_loggedin_stringl1 = "S&eacute;curit&eacute; des Syst&egrave;mes d'Information";
152
  $l_loggedin_stringl2 = "Ce contr&ocirc;le a &eacute;t&eacute; mis en place pour assurer r&eacute;glementairement la tra&ccedil;abilit&eacute;, l'imputabilit&eacute; et la non-r&eacute;pudiation des connexions.";
151
  $l_loggedin_stringl2 = "Ce contr&ocirc;le a &eacute;t&eacute; mis en place pour assurer r&eacute;glementairement la tra&ccedil;abilit&eacute;, l'imputabilit&eacute; et la non-r&eacute;pudiation des connexions.";
153
  $l_loggedin_stringl3 = "Votre activit&eacute; sur le r&eacute;seau est enregistr&eacute;e conform&eacute;ment au respect de la vie priv&eacute;e.";
152
  $l_loggedin_stringl3 = "Votre activit&eacute; sur le r&eacute;seau est enregistr&eacute;e conform&eacute;ment au respect de la vie priv&eacute;e.";
154
  $l_loggedin_stringl4 = "Les donn&eacute;es enregistr&eacute;es ne pourront &ecirc;tre exploit&eacute;es que par une autorit&eacute judiciaire dans le cadre d'une enqu&ecirc;te.";
153
  $l_loggedin_stringl4 = "Les donn&eacute;es enregistr&eacute;es ne pourront &ecirc;tre exploit&eacute;es que par une autorit&eacute judiciaire dans le cadre d'une enqu&ecirc;te.";
155
  $l_loggedin_stringl5 = "Ces donn&eacute;es seront automatiquement supprim&eacute;es au bout d'un an.";
154
  $l_loggedin_stringl5 = "Ces donn&eacute;es seront automatiquement supprim&eacute;es au bout d'un an.";
156
  $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";
155
  $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";
157
  $l_loggedout_string = "D&eacute;connexion du portail captif effectu&eacute;e !";
156
  $l_loggedout_string = "D&eacute;connexion du portail captif effectu&eacute;e !";
158
  $l_reply_1 = "Votre dur&eacute;e de connexion journali&egrave;re a &eacute;t&eacute; atteinte";
157
  $l_reply_1 = "Votre dur&eacute;e de connexion journali&egrave;re a &eacute;t&eacute; atteinte";
159
  $l_reply_2 = "Votre dur&eacute;e de connexion mensuelle a &eacute;t&eacute; atteinte";
158
  $l_reply_2 = "Votre dur&eacute;e de connexion mensuelle a &eacute;t&eacute; atteinte";
160
  $l_reply_3 = "Vous tentez de vous connecter en dehors de votre p&eacute;riode autoris&eacute;e";
159
  $l_reply_3 = "Vous tentez de vous connecter en dehors de votre p&eacute;riode autoris&eacute;e";
161
  $l_reply_4 = "Votre compte a expir&eacute";
160
  $l_reply_4 = "Votre compte a expir&eacute";
162
  $l_reply_5 = "Vous avez atteint le nombre maximum de connexions simultan&eacute;es";
161
  $l_reply_5 = "Vous avez atteint le nombre maximum de connexions simultan&eacute;es";
163
  $l_online_time = "Temps de connexion";
162
  $l_online_time = "Temps de connexion";
164
  $l_remaining_time = "Temps restant";
163
  $l_remaining_time = "Temps restant";
165
}
164
}
166
else{
165
else{
167
  $l_ChilliError	= "The authentication must be successful through the captive portal service.";
166
  $l_ChilliError	= "The authentication must be successful through the captive portal service.";
168
  $l_login		= "Successful authentication.<HR>Closing this window interrupts your session";
167
  $l_login		= "Successful authentication.<HR>Closing this window interrupts your session";
169
  $l_logout		= "Closing connection";
168
  $l_logout		= "Closing connection";
170
  $l_loginfailed	= "Authentication Failed";
169
  $l_loginfailed	= "Authentication Failed";
171
  $l_loggingin		= "Identification on the captive portal";
170
  $l_loggingin		= "Identification on the captive portal";
172
  $l_loggedcont		= "Network Access Control";
171
  $l_loggedcont		= "Network Access Control";
173
  $l_loggedout		= "Your session is closed";
172
  $l_loggedout		= "Your session is closed";
174
  $l_user		= "User";
173
  $l_user		= "User";
175
  $l_password		= "Password";
174
  $l_password		= "Password";
176
  $l_wait		= "Please wait a moment ...";
175
  $l_wait		= "Please wait a moment ...";
177
  $l_onlinetime		= "Connect time:";
176
  $l_onlinetime		= "Connect time:";
178
  $l_remainingtime	= "Disconnection in:";
177
  $l_remainingtime	= "Disconnection in:";
179
  $l_encrypted		= "The opening must use encrypted connection";
178
  $l_encrypted		= "The opening must use encrypted connection";
180
  $l_boutonO		= "Authentication";
179
  $l_boutonO		= "Authentication";
181
  $l_boutonF		= "Close";
180
  $l_boutonF		= "Close";
182
  $l_loggedin_stringl1 = "Information System Security";
181
  $l_loggedin_stringl1 = "Information System Security";
183
  $l_loggedin_stringl2 = "That control was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
182
  $l_loggedin_stringl2 = "That control was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
184
  $l_loggedin_stringl3 = "Your activity on the network is registered in accordance with privacy.";
183
  $l_loggedin_stringl3 = "Your activity on the network is registered in accordance with privacy.";
185
  $l_loggedin_stringl4 = "The recorded data can be able to be operated by a judicial authority in the course of an investigation.";
184
  $l_loggedin_stringl4 = "The recorded data can be able to be operated by a judicial authority in the course of an investigation.";
186
  $l_loggedin_stringl5 = "These data will be automatically deleted after one year.";
185
  $l_loggedin_stringl5 = "These data will be automatically deleted after one year.";
187
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
186
  $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
188
  $l_loggedout_string = "Logout made captive portal!";
187
  $l_loggedout_string = "Logout made captive portal!";
189
  $l_reply_1 = "Your daily connexion time has been reached";
188
  $l_reply_1 = "Your daily connexion time has been reached";
190
  $l_reply_2 = "Your monthly connexion time has been reached";
189
  $l_reply_2 = "Your monthly connexion time has been reached";
191
  $l_reply_3 = "You try to connect outside of your allowed timespan";
190
  $l_reply_3 = "You try to connect outside of your allowed timespan";
192
  $l_reply_4 = "your account expired";
191
  $l_reply_4 = "your account expired";
193
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
192
  $l_reply_5 = "You have reached the maximum number of simultaneous logins";
194
  $l_online_time = "Online time";
193
  $l_online_time = "Online time";
195
  $l_remaining_time = "Remaining time";
194
  $l_remaining_time = "Remaining time";
196
}
195
}
197
 
196
 
198
# If https not use, tell it's wrong
197
# If https not use, tell it's wrong
199
if (!(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS'] == 'on'))) {
198
if (!(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS'] == 'on'))) {
200
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
199
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
201
<html>
200
<html>
202
<head>
201
<head>
203
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
202
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
204
  <title>$l_loggedcont</title>
203
  <title>$l_loggedcont</title>
205
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
204
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
206
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
205
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
207
</head>
206
</head>
208
<body bgColor = 'white'>
207
<body bgColor = 'white'>
209
  <h1 style=\"text-align: center;\">$l_loginfailed</h1>
208
  <h1 style=\"text-align: center;\">$l_loginfailed</h1>
210
  <center>$l_encrypted</center>
209
  <center>$l_encrypted</center>
211
</body>
210
</body>
212
</html>";
211
</html>";
213
    exit(0);
212
    exit(0);
214
}
213
}
215
 
214
 
216
# Read form parameters which we care about
215
# Read form parameters which we care about
217
if (isset($_POST['UserName'])){	$username	= $_POST['UserName'];} else {$username="";}
216
if (isset($_POST['UserName'])){	$username	= $_POST['UserName'];} else {$username="";}
218
if (isset($_POST['Password'])){	$password	= $_POST['Password'];} else {$password="";}
217
if (isset($_POST['Password'])){	$password	= $_POST['Password'];} else {$password="";}
219
if (isset($_POST['challenge'])){$challenge	= $_POST['challenge'];} else {$challenge="";}
218
if (isset($_POST['challenge'])){$challenge	= $_POST['challenge'];} else {$challenge="";}
220
if (isset($_POST['button'])){	$button		= $_POST['button'];} else { $button="";}
219
if (isset($_POST['button'])){	$button		= $_POST['button'];} else { $button="";}
221
//if (isset($_POST['logout'])){	$logout		= $_POST['logout'];} else {$logout="";}
220
//if (isset($_POST['logout'])){	$logout		= $_POST['logout'];} else {$logout="";}
222
//if (isset($_POST['prelogin'])){	$prelogin	= $_POST['prelogin'];} else {$prelogin="";}
221
//if (isset($_POST['prelogin'])){	$prelogin	= $_POST['prelogin'];} else {$prelogin="";}
223
if (isset($_POST['res'])){		$res		= $_POST['res'];} else {$res="";}
222
if (isset($_POST['res'])){		$res		= $_POST['res'];} else {$res="";}
224
if (isset($_POST['uamip'])){	$uamip		= $_POST['uamip'];} else {$uamip="";}
223
if (isset($_POST['uamip'])){	$uamip		= $_POST['uamip'];} else {$uamip="";}
225
if (isset($_POST['uamport'])){	$uamport	= $_POST['uamport'];} else {$uamport="";}
224
if (isset($_POST['uamport'])){	$uamport	= $_POST['uamport'];} else {$uamport="";}
226
if (isset($_POST['userurl'])){	$userurl	= $_POST['userurl'];} else {$userurl="";}
225
if (isset($_POST['userurl'])){	$userurl	= $_POST['userurl'];} else {$userurl="";}
227
if (isset($_POST['timeleft'])){	$timeleft	= $_POST['timeleft'];} else {$timeleft="";}
226
if (isset($_POST['timeleft'])){	$timeleft	= $_POST['timeleft'];} else {$timeleft="";}
228
if (isset($_POST['redirurl'])){	$redirurl	= $_POST['redirurl'];} else {$redirurl="";}
227
if (isset($_POST['redirurl'])){	$redirurl	= $_POST['redirurl'];} else {$redirurl="";}
229
 
228
 
230
# Read query parameters which we care about
229
# Read query parameters which we care about
231
if (isset($_GET['res']))		$res		= $_GET['res'];
230
if (isset($_GET['res']))		$res		= $_GET['res'];
232
if (isset($_GET['challenge']))	$challenge	= $_GET['challenge'];
231
if (isset($_GET['challenge']))	$challenge	= $_GET['challenge'];
233
if (isset($_GET['uamip']))		$uamip		= $_GET['uamip'];
232
if (isset($_GET['uamip']))		$uamip		= $_GET['uamip'];
234
if (isset($_GET['uamport']))	$uamport	= $_GET['uamport'];
233
if (isset($_GET['uamport']))	$uamport	= $_GET['uamport'];
235
if (isset($_GET['reply'])){		$reply		= $_GET['reply'];} else {$reply="";}
234
if (isset($_GET['reply'])){		$reply		= $_GET['reply'];} else {$reply="";}
236
if (isset($_GET['userurl']))	$userurl	= $_GET['userurl'];
235
if (isset($_GET['userurl']))	$userurl	= $_GET['userurl'];
237
if (isset($_GET['timeleft']))	$timeleft	= $_GET['timeleft'];
236
if (isset($_GET['timeleft']))	$timeleft	= $_GET['timeleft'];
238
if (isset($_GET['redirurl']))	$redirurl	= $_GET['redirurl'];
237
if (isset($_GET['redirurl']))	$redirurl	= $_GET['redirurl'];
239
 
238
 
240
# translation of radius replies
239
# translation of radius replies
241
if (isset($reply)){
240
if (isset($reply)){
242
	switch(trim ($reply)) {
241
	switch(trim ($reply)) {
243
  case 'Your maximum daily usage time has been reached' : $reply = $l_reply_1 ; break;
242
  case 'Your maximum daily usage time has been reached' : $reply = $l_reply_1 ; break;
244
  case 'Your maximum monthly usage time has been reached' : $reply = $l_reply_2 ; break;
243
  case 'Your maximum monthly usage time has been reached' : $reply = $l_reply_2 ; break;
245
  case 'You are calling outside your allowed timespan' : $reply = $l_reply_3 ; break;
244
  case 'You are calling outside your allowed timespan' : $reply = $l_reply_3 ; break;
246
  case 'Password Has Expired' : $reply =  $l_reply_4 ; break;
245
  case 'Password Has Expired' : $reply =  $l_reply_4 ; break;
247
  case 'You are already logged in - access denied' : $reply = $l_reply_5 ; break;
246
  case 'You are already logged in - access denied' : $reply = $l_reply_5 ; break;
248
  }}
247
  }}
249
 
248
 
250
# If attempt to login
249
# If attempt to login
251
if ("$button" == "$l_boutonO") {
250
if ("$button" == "$l_boutonO") {
252
  $hexchal = pack ("H32", $challenge);
251
  $hexchal = pack ("H32", $challenge);
253
  $newchal = pack ("H*", md5($hexchal . $uamsecret));
252
  $newchal = pack ("H*", md5($hexchal . $uamsecret));
254
  $response = md5("\0" . $password . $newchal);
253
  $response = md5("\0" . $password . $newchal);
255
  $newpwd = pack("a32", $password);
254
  $newpwd = pack("a32", $password);
256
  $pappassword = implode ("", unpack("H32", ($newpwd ^ $newchal)));
255
  $pappassword = implode ("", unpack("H32", ($newpwd ^ $newchal)));
257
  echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
256
  echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
258
<html>
257
<html>
259
<head>
258
<head>
260
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
259
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
261
  <title>$l_loggingin</title>
260
  <title>$l_loggingin</title>
262
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
261
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
263
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
262
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
264
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl\">
263
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl\">
265
  </head>
264
  </head>
266
<body bgColor = 'white'>
265
<body bgColor = 'white'>
267
<h1 style=\"text-align: center;\">$l_loggingin</h1>
266
<h1 style=\"text-align: center;\">$l_loggingin</h1>
268
  <center>
267
  <center>
269
    $l_wait
268
    $l_wait
270
  </center>
269
  </center>
271
</body>
270
</body>
272
</html>";
271
</html>";
273
    exit(0);
272
exit(0);
274
}
273
}
275
 
274
 
276
switch($res) {
275
switch($res) {
277
  case 'success':     $result =  1; break; // If login successful
276
  case 'success':     $result =  1; break; // If login successful
278
  case 'failed':      $result =  2; break; // If login failed
277
  case 'failed':      $result =  2; break; // If login failed
279
  case 'logoff':      $result =  3; break; // If logout successful
278
  case 'logoff':      $result =  3; break; // If logout successful
280
  case 'already':     $result =  4; break; // If tried to login while already logged in
279
  case 'already':     $result =  4; break; // If tried to login while already logged in
281
  case 'notyet':      $result =  5; break; // If not logged in yet
280
  case 'notyet':      $result =  5; break; // If not logged in yet
282
  default: $result = 0; // Default: It was not a form request -> client go to login form
281
  default: $result = 0; // Default: It was not a form request -> client go to login form
283
}
282
}
284
 
283
 
285
# Otherwise it was not a form request
284
# Otherwise it was not a form request
286
# Send out an error message
285
# Send out an error message
287
if ($result == 0) {	//erreur
286
if ($result == 0) {	//erreur
288
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
287
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
289
<html>
288
<html>
290
<head>
289
<head>
291
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
290
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
292
  <title>$l_loggingin</title>
291
  <title>$l_loggingin</title>
293
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
292
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
294
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
293
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
295
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/prelogin\">
294
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/prelogin\">
296
  </head>
295
  </head>
297
<body bgColor = 'white'>
296
<body bgColor = 'white'>
298
<h1 style=\"text-align: center;\">$l_loggingin</h1>
297
<h1 style=\"text-align: center;\">$l_loggingin</h1>
299
  <center>
298
  <center>
300
    $l_wait
299
    $l_wait
301
  </center>
300
  </center>
302
</body>
301
</body>
303
</html>";
302
</html>";
304
    exit(0);
303
    exit(0);
305
}
304
}
306
 
-
 
307
# Generate the output
305
# Generate the output
308
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
306
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
309
<html>
307
<html>
310
<head>
308
<head>
311
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
309
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
312
  <title>$l_loggingin</title>
310
  <title>$l_loggingin</title>
313
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
311
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
314
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
312
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
315
  <script type=\"text/javascript\" language=\"JavaScript\">
313
  <script type=\"text/javascript\" language=\"JavaScript\">
316
    var blur = 0; // not un use
314
    var blur = 0; // not un use
317
	var mytimeleft = 0; // not un use
315
	var mytimeleft = 0; // not un use
318
	alcasar_popup = null;
316
	alcasar_popup = null;
319
 
317
 
320
    function popUp(URL) {
318
    function popUp(URL) {
321
      if (self.name != \"alcasar_popup\") {
319
      if (self.name != \"alcasar_popup\") {
322
        alcasar_popup = window.open(URL, 'alcasar_popup', 'width=500,height=400,directories=no,resizable=no,scrollbars=yes,location=no,toolbar=no,statusbar=no,menubar=no');
320
        alcasar_popup = window.open(URL, 'alcasar_popup', 'width=500,height=400,directories=no,resizable=no,scrollbars=yes,location=no,toolbar=no,statusbar=no,menubar=no');
323
      }
321
      }
324
    }
322
    }
325
 
323
 
326
    function doOnLoad(result, userurl, redirurl, adminurl, timeleft) {
324
    function doOnLoad(result, userurl, redirurl, adminurl, timeleft) {
327
	    if (timeleft) { // not in use
325
	    if (timeleft) { // not in use
328
        mytimeleft = timeleft;
326
        mytimeleft = timeleft;
329
      }
327
      }
330
      if ((result == 1)||(result == 4)) {	//success or already
328
      if ((result == 1)||(result == 4)) {	//success or already
331
	      //window.location = userurl;
329
	      //window.location = userurl;
332
		  if (alcasar_popup != null) alcasar_popup.focus();
330
		  if (alcasar_popup != null) alcasar_popup.focus();
333
		  
331
		  
334
		  if (adminurl != ''){
332
		  if (adminurl != ''){
335
			  window.location = adminurl;
333
			  window.location = adminurl;
336
		  } else if (redirurl != '') {
334
		  } else if (redirurl != '') {
337
			  window.location = redirurl;
335
			  window.location = redirurl;
338
		  } else if (userurl != '') {
336
		  } else if (userurl != '') {
339
			  window.location = userurl;
337
			  window.location = userurl;
340
		  } else {
338
		  } else {
341
			  window.home();
339
			  window.home();
342
		  }
340
		  }
343
      }
341
      }
344
      if ((result == 2) || (result == 3) || result == 5) { //failed or logoff or notyet
342
      if ((result == 2) || (result == 3) || result == 5) { //failed or logoff or notyet
345
		if (alcasar_popup != null) alcasar_popup.close();
343
		if (alcasar_popup != null) alcasar_popup.close();
346
			document.form1.UserName.focus();
344
			document.form1.UserName.focus();
347
      }
345
      }
348
    }
346
    }
349
  </script>
347
  </script>
350
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
348
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
351
</head>
349
</head>
352
<body onLoad=\"javascript:doOnLoad($result,'$userurl','$redirurl','$adminurl','$timeleft')\">
350
<body onLoad=\"javascript:doOnLoad($result,'$userurl','$redirurl','$adminurl','$timeleft')\">
353
  <center>";
351
  <center>";
354
 
-
 
355
if ($result == 2 || $result == 3 || $result == 5) { //failed or logoff or notyet
352
if ($result == 2 || $result == 3 || $result == 5) { //failed or logoff or notyet
356
  echo "
353
  echo "
357
	<div id=\"logon\">
354
	<div id=\"logon\">
358
	<h1>$organisme</h1>
355
	<h1>$organisme</h1>
359
	<h2>$l_loggedcont</h2>";
356
	<h2>$l_loggedcont</h2>";
360
	if ($result == 2) { //failed
357
	if ($result == 2) { //failed
361
		echo "	
358
		echo "	
362
		<h3>$l_loginfailed</h3>";
359
		<h3>$l_loginfailed</h3>";
363
		if ($reply) {
360
		if ($reply) {
364
		#traitement du reply ...
361
		#traitement du reply ...
365
		echo "<center> $reply <br /><br /></center>";
362
		echo "<center> $reply <br /><br /></center>";
366
		}
363
		}
367
	}
364
	}
368
	echo "
365
	echo "
369
	<img id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
366
	<img id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
370
	<form name=\"form1\" method=\"post\" action=\"$loginpath\">
367
	<form name=\"form1\" method=\"post\" action=\"$loginpath\">
371
	<input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
368
	<input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
372
	<input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
369
	<input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
373
	<input type=\"hidden\" name=\"uamport\" value=\"$uamport\">
370
	<input type=\"hidden\" name=\"uamport\" value=\"$uamport\">
374
	<input type=\"hidden\" name=\"userurl\" value=\"$userurl\">
371
	<input type=\"hidden\" name=\"userurl\" value=\"$userurl\">
375
		<table id=\"boite-logon\">
372
		<table id=\"boite-logon\">
376
			<tr>
373
			<tr>
377
				<td width=\"20%\" rowspan=\"3\"><img id=\"logo-organ\" src=\"/images/organisme.png\"></td>
374
				<td width=\"20%\" rowspan=\"3\"><img id=\"logo-organ\" src=\"/images/organisme.png\"></td>
378
				<td width=\"30%\" align=\"right\">$l_user</td>
375
				<td width=\"30%\" align=\"right\">$l_user</td>
379
				<td width=\"50%\" align=\"left\"><INPUT type=\"text\" maxLength=\"32\" name=\"UserName\"></td>
376
				<td width=\"50%\" align=\"left\"><INPUT type=\"text\" maxLength=\"32\" name=\"UserName\"></td>
380
			</tr>
377
			</tr>
381
			<tr>
378
			<tr>
382
				<td align=\"right\">$l_password</td>
379
				<td align=\"right\">$l_password</td>
383
				<td align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\"></td>
380
				<td align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\"></td>
384
			</tr>
381
			</tr>
385
			<tr>
382
			<tr>
386
				<td height=\"23\" colSpan=\"2\" align=\"center\"><INPUT value=\"$l_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$statuspath')\"></td>
383
				<td height=\"23\" colSpan=\"2\" align=\"center\"><INPUT value=\"$l_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$statuspath')\"></td>
387
			</tr>
384
			</tr>
388
		</table>
385
		</table>
389
		<table id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\">
386
		<table id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\">
390
			<tr>
387
			<tr>
391
				<td align=\"center\"><FONT color=\"red\"><B>$l_loggedin_stringl1</B></FONT></td>
388
				<td align=\"center\"><FONT color=\"red\"><B>$l_loggedin_stringl1</B></FONT></td>
392
			</tr>
389
			</tr>
393
			<tr>
390
			<tr>
394
				<td align=\"left\">
391
				<td align=\"left\">
395
					<ul>
392
					<ul>
396
						<LI>$l_loggedin_stringl2</LI>
393
						<LI>$l_loggedin_stringl2</LI>
397
						<LI>$l_loggedin_stringl4</LI>
394
						<LI>$l_loggedin_stringl4</LI>
398
						<LI>$l_loggedin_stringl3</LI>
395
						<LI>$l_loggedin_stringl3</LI>
399
						<LI>$l_loggedin_stringl5</LI>
396
						<LI>$l_loggedin_stringl5</LI>
400
						<LI>$l_loggedin_stringl6</LI>
397
						<LI>$l_loggedin_stringl6</LI>
401
					</ul>
398
					</ul>
402
				</td>
399
				</td>
403
			</tr>
400
			</tr>
404
		</table>
401
		</table>
405
  </form>
402
  </form>
406
  </div>
403
  </div>
407
  </center>
404
  </center>
408
</body>
405
</body>
409
</html>";
406
</html>";
410
}
407
}
411
exit(0);
408
exit(0);
412
?>
409
?>
413
 
410