318 |
richard |
1 |
<?php
|
|
|
2 |
#
|
|
|
3 |
# intercept.php for Alcasar captive portal
|
|
|
4 |
# Copyright (C) 2003, 2004 Mondru AB.
|
|
|
5 |
# Modify by REXY
|
|
|
6 |
# Help for language translation by B. AUBARD (thanks)
|
|
|
7 |
|
|
|
8 |
# The contents of this file may be used under the terms of the GNU
|
|
|
9 |
# General Public License Version 2, provided that the above copyright
|
|
|
10 |
# notice and this permission notice is included in all copies or
|
|
|
11 |
# substantial portions of the software.
|
|
|
12 |
|
475 |
stephane |
13 |
$organisme = "steweb57";
|
318 |
richard |
14 |
# Redirects from CoovaChilli (chilli daemon) :
|
|
|
15 |
# Response to login:
|
|
|
16 |
# success : if login successful
|
|
|
17 |
# failed : if login failed
|
|
|
18 |
# logoff : if logout successful
|
|
|
19 |
# already : if tried to login while already logged in
|
|
|
20 |
# notyet : if not logged in yet
|
|
|
21 |
# smartclient :if login from smart client
|
|
|
22 |
# popup1 : if requested a logging in pop up window
|
|
|
23 |
# popup2 : if requested a success pop up window
|
|
|
24 |
# popup3 : if requested a logout pop up window
|
|
|
25 |
# Default : it was not a form request
|
|
|
26 |
|
|
|
27 |
# Shared secret used to encrypt challenge with radius.
|
475 |
stephane |
28 |
$uamsecret = "Mkb0pAEE";
|
318 |
richard |
29 |
|
|
|
30 |
# URL loaded after success authenticates (let blank for browser defaults)
|
484 |
stephane |
31 |
$adminurl = "http://www.sfr.fr";
|
318 |
richard |
32 |
|
|
|
33 |
# Our own path
|
484 |
stephane |
34 |
$loginpath = $_SERVER['PHP_SELF'];
|
475 |
stephane |
35 |
$statuspath = "http://alcasar/status.php";
|
484 |
stephane |
36 |
$debug = true;
|
318 |
richard |
37 |
|
|
|
38 |
# Choice of language
|
|
|
39 |
$Language = 'en';
|
|
|
40 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
|
|
41 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
|
|
42 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
|
|
43 |
if($Language == 'es'){
|
|
|
44 |
$R_ChilliError = "La autenticación debe ser un éxito a través del servicio de portal cautivo.";
|
|
|
45 |
$R_login = "El éxito de la autenticación.<HR>Cierre esta ventana interrumpte la sesion.";
|
|
|
46 |
$R_logout = "Conexión de cierre";
|
|
|
47 |
$R_loginfailed = "Error de autenticación";
|
|
|
48 |
$R_loggingin = "Identificación en el portal cautivo";
|
|
|
49 |
$R_loggedcont = "Red de Control de Acceso";
|
|
|
50 |
$R_loggedout = "Su sesión se cierra";
|
|
|
51 |
$R_user = "Usuario";
|
|
|
52 |
$R_password = "Contraseña";
|
|
|
53 |
$R_passwordchg = "Cambie su contraseña";
|
|
|
54 |
$R_wait = "Por favor, espere un momento ...";
|
|
|
55 |
$R_onlinetime = "Tiempo de conexión:";
|
|
|
56 |
$R_remainingtime = "Desconexión en:";
|
|
|
57 |
$R_encrypted = "La apertura debe usar conexión cifrada";
|
|
|
58 |
$R_boutonO = "Autenticación";
|
|
|
59 |
$R_boutonF = "Cerrar";
|
|
|
60 |
$R_loggedin_stringl0 = "Information System Security";
|
|
|
61 |
$R_loggedin_stringl1 = "Bienvenido portal ALCASAR";
|
|
|
62 |
$R_loggedin_stringl2 = "El portal fue creado reglamentos para garantizar la trazabilidad, la rendición de cuentas y el no repudio de las conexiones.";
|
|
|
63 |
$R_loggedin_stringl3 = "Su actividad en la red es registrada, de conformidad con la privacidad.";
|
|
|
64 |
$R_loggedin_stringl4 = "Los datos registrados pueden ser capaces de ser operado por una autoridad judicial en el curso de una investigación.";
|
|
|
65 |
$R_loggedin_stringl5 = "Estos datos se eliminan automáticamente después de un año.";
|
|
|
66 |
$R_loggedout_string = "Cerrar sesión hizo portal cautivo!";
|
|
|
67 |
$R_reply_1 = "Your daily connexion time has been reached";
|
|
|
68 |
$R_reply_2 = "Your monthly connexion time has been reached";
|
|
|
69 |
$R_reply_3 = "You try to connect outside of your allowed timespan";
|
|
|
70 |
$R_reply_4 = "your account expired";
|
|
|
71 |
$R_reply_5 = "You have reached the maximum number of simultaneous logins";
|
|
|
72 |
$R_ca_1 = "How integrate the ALCASAR";
|
|
|
73 |
$R_ca_2 = "certificate";
|
|
|
74 |
$R_ca_3 = "in your web browser?";
|
|
|
75 |
$R_ca_4 = "-help-";
|
|
|
76 |
$R_online_time = "Tiempo en linea";
|
|
|
77 |
$R_remaining_time = "Tiempo restante";
|
|
|
78 |
}
|
|
|
79 |
else if($Language == 'de'){
|
|
|
80 |
$R_ChilliError = "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
|
|
|
81 |
$R_login = "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung";
|
|
|
82 |
$R_logout = "Beenden der Verbindung";
|
|
|
83 |
$R_loginfailed = "Authentifizierungsfehler Eigenverbrauch";
|
|
|
84 |
$R_loggingin = "Kennzeichnung auf dem Eigenverbrauch";
|
|
|
85 |
$R_loggedcont = "Network Access Control";
|
|
|
86 |
$R_loggedout = "Ihre Sitzung ist geschlossen";
|
|
|
87 |
$R_user = "Benutzer";
|
|
|
88 |
$R_password = "Passwort";
|
|
|
89 |
$R_passwordchg = "Passwort ändern";
|
|
|
90 |
$R_wait = "Bitte warten Sie einen Moment ...";
|
|
|
91 |
$R_onlinetime = "Online-Zeit:";
|
|
|
92 |
$R_remainingtime = "Abmelden:";
|
|
|
93 |
$R_encrypted = "Die Öffnung muß der Anschluß Zahlen";
|
|
|
94 |
$R_boutonO = "Authentifizierung";
|
|
|
95 |
$R_boutonF = "Schließen";
|
|
|
96 |
$R_loggedin_stringl0 = "Information System Security";
|
|
|
97 |
$R_loggedin_stringl1 = "Willkommen portal ALCASAR";
|
|
|
98 |
$R_loggedin_stringl2 = "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, der Zurechenbarkeit und der Nicht-Anerkennung der Verbindungen.";
|
|
|
99 |
$R_loggedin_stringl3 = "Ihre Tätigkeit im Netzwerk registriert ist nach Schutz der Privatsphäre.";
|
|
|
100 |
$R_loggedin_stringl4 = "Die gespeicherten Daten nicht pouront genutzt werden, dass von einer Justizbehörde im Rahmen einer Untersuchung.";
|
|
|
101 |
$R_loggedin_stringl5 = "Diese Daten werden automatisch gelöscht nach einem Jahr.";
|
|
|
102 |
$R_loggedout_string = "Trennung des Portals erfolgt Gefangener!";
|
|
|
103 |
$R_reply_1 = "Your daily connexion time has been reached";
|
|
|
104 |
$R_reply_2 = "Your monthly connexion time has been reached";
|
|
|
105 |
$R_reply_3 = "You try to connect outside of your allowed timespan";
|
|
|
106 |
$R_reply_4 = "your account expired";
|
|
|
107 |
$R_reply_5 = "You have reached the maximum number of simultaneous logins";
|
|
|
108 |
$R_ca_1 = "How integrate the ALCASAR";
|
|
|
109 |
$R_ca_2 = "certificate";
|
|
|
110 |
$R_ca_3 = "in your web browser?";
|
|
|
111 |
$R_ca_4 = "-help-";
|
|
|
112 |
$R_online_time = "Online-zeit";
|
|
|
113 |
$R_remaining_time = "Restzeit";
|
|
|
114 |
|
|
|
115 |
}
|
|
|
116 |
else if($Language == 'nl'){
|
|
|
117 |
$R_ChilliError = "De authenticatie moet een succes worden via de captive portal dienst.";
|
|
|
118 |
$R_login = "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie.";
|
|
|
119 |
$R_logout = "Slotkoers verbinding";
|
|
|
120 |
$R_loginfailed = "Authenticatie mislukt";
|
|
|
121 |
$R_loggingin = "Identificatie van de captive-portaal";
|
|
|
122 |
$R_loggedcont = "Network Access Control";
|
|
|
123 |
$R_loggedout = "Uw sessie is gesloten";
|
|
|
124 |
$R_user = "Gebruiker";
|
|
|
125 |
$R_password = "Wachtwoord";
|
|
|
126 |
$R_passwordchg = "Wijzig uw wachtwoord";
|
|
|
127 |
$R_wait = "Wacht een moment ...";
|
|
|
128 |
$R_onlinetime = "Sluit tijd:";
|
|
|
129 |
$R_remainingtime = "Verbreking in:";
|
|
|
130 |
$R_encrypted = "De opening moet gebruiken gecodeerde verbinding";
|
|
|
131 |
$R_boutonO = "Authenticatie";
|
|
|
132 |
$R_boutonF = "Sluiten";
|
|
|
133 |
$R_loggedin_stringl0 = "Information System Security";
|
|
|
134 |
$R_loggedin_stringl1 = "Welkom portaal ALCASAR";
|
|
|
135 |
$R_loggedin_stringl2 = "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
|
|
|
136 |
$R_loggedin_stringl3 = "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
|
|
|
137 |
$R_loggedin_stringl4 = "De geregistreerde gegevens kunnen worden kunnen worden bediend door een rechterlijke instantie in de loop van een onderzoek.";
|
|
|
138 |
$R_loggedin_stringl5 = "Deze gegevens worden automatisch verwijderd na een jaar.";
|
|
|
139 |
$R_loggedout_string = "Logout gemaakt intern portaal!";
|
|
|
140 |
$R_reply_1 = "Your daily connexion time has been reached";
|
|
|
141 |
$R_reply_2 = "Your monthly connexion time has been reached";
|
|
|
142 |
$R_reply_3 = "You try to connect outside of your allowed timespan";
|
|
|
143 |
$R_reply_4 = "your account expired";
|
|
|
144 |
$R_reply_5 = "You have reached the maximum number of simultaneous logins";
|
|
|
145 |
$R_ca_1 = "How integrate the ALCASAR";
|
|
|
146 |
$R_ca_2 = "certificate";
|
|
|
147 |
$R_ca_3 = "in your web browser?";
|
|
|
148 |
$R_ca_4 = "-help-";
|
|
|
149 |
$R_online_time = "Online tijd";
|
|
|
150 |
$R_remaining_time = "Reterende tijd";
|
|
|
151 |
}
|
|
|
152 |
else if($Language == 'fr'){
|
|
|
153 |
$R_ChilliError = "L'authentification doit être réussie au travers du service du portail captif.";
|
|
|
154 |
$R_login = "Authentification réussie.<HR>La fermeture de cette fenêtre interrompt votre session.";
|
|
|
155 |
$R_logout = "Fermeture de la session";
|
|
|
156 |
$R_loginfailed = "Echec d'authentification";
|
|
|
157 |
$R_loggingin = "Identification sur le portail captif";
|
|
|
158 |
$R_loggedcont = "Contrôle d'accès au réseau";
|
|
|
159 |
$R_loggedout = "Votre session est fermée";
|
|
|
160 |
$R_user = "Identifiant";
|
|
|
161 |
$R_password = "Mot de passe";
|
|
|
162 |
$R_passwordchg = "Modifier son mot de passe";
|
|
|
163 |
$R_wait = "Patientez un instant ...";
|
|
|
164 |
$R_onlinetime = "Temps de connexion:";
|
|
|
165 |
$R_remainingtime = "Deconnexion dans :";
|
|
|
166 |
$R_encrypted = "La connexion avec le portail doit être chiffrée";
|
|
|
167 |
$R_boutonO = "Authentification";
|
|
|
168 |
$R_boutonF = "Fermer";
|
|
|
169 |
$R_loggedin_stringl0 = "Sécurité des Systèmes d'Information";
|
|
|
170 |
$R_loggedin_stringl1 = "Bienvenue sur le portail captif ALCASAR";
|
|
|
171 |
$R_loggedin_stringl2 = "Ce portail a été mis en place pour assurer réglementairement la traçabilité, l'imputabilité et la non-répudiation des connexions.";
|
|
|
172 |
$R_loggedin_stringl3 = "Votre activité sur le réseau est enregistrée conformément au respect de la vie privée.";
|
|
|
173 |
$R_loggedin_stringl4 = "Les données enregistrées ne pourront être exploitées que par une autorité judiciaire dans le cadre d'une enquête.";
|
|
|
174 |
$R_loggedin_stringl5 = "Ces données seront automatiquement supprimées au bout d'un an.";
|
|
|
175 |
$R_loggedout_string = "Déconnexion du portail captif effectuée !";
|
|
|
176 |
$R_reply_1 = "Votre durée de connexion journalière a été atteinte";
|
|
|
177 |
$R_reply_2 = "Votre durée de connexion mensuelle a été atteinte";
|
|
|
178 |
$R_reply_3 = "Vous tentez de vous connecter en dehors de votre période autorisée";
|
|
|
179 |
$R_reply_4 = "Votre compte a expiré";
|
399 |
franck |
180 |
$R_reply_5 = "Vous avez atteint le nombre maximum de connexions simultanées";
|
318 |
richard |
181 |
$R_ca_1 = "Intégrer le ";
|
|
|
182 |
$R_ca_2 = "certificat";
|
|
|
183 |
$R_ca_3 = "d'ALCASAR dans votre navigateur WEB";
|
|
|
184 |
$R_ca_4 = "- Aide -";
|
|
|
185 |
$R_online_time = "Temps de connexion";
|
|
|
186 |
$R_remaining_time = "Temps restant";
|
|
|
187 |
}
|
|
|
188 |
else{
|
|
|
189 |
$R_ChilliError = "The authentication must be successful through the captive portal service.";
|
|
|
190 |
$R_login = "Successful authentication.<HR>Closing this window interrupts your session";
|
|
|
191 |
$R_logout = "Closing connection";
|
|
|
192 |
$R_loginfailed = "Authentication Failed";
|
|
|
193 |
$R_loggingin = "Identification on the captive portal";
|
|
|
194 |
$R_loggedcont = "Network Access Control";
|
|
|
195 |
$R_loggedout = "Your session is closed";
|
|
|
196 |
$R_user = "User";
|
|
|
197 |
$R_password = "Password";
|
|
|
198 |
$R_passwordchg = "Change your password";
|
|
|
199 |
$R_wait = "Please wait a moment ...";
|
|
|
200 |
$R_onlinetime = "Connect time:";
|
|
|
201 |
$R_remainingtime = "Disconnection in:";
|
|
|
202 |
$R_encrypted = "The opening must use encrypted connection";
|
|
|
203 |
$R_boutonO = "Authentication";
|
|
|
204 |
$R_boutonF = "Close";
|
|
|
205 |
$R_loggedin_stringl0 = "Information System Security";
|
|
|
206 |
$R_loggedin_stringl1 = "Welcome on captive portal ALCASAR";
|
|
|
207 |
$R_loggedin_stringl2 = "The portal was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
|
|
|
208 |
$R_loggedin_stringl3 = "Your activity on the network is registered in accordance with privacy.";
|
|
|
209 |
$R_loggedin_stringl4 = "The recorded data can be able to be operated by a judicial authority in the course of an investigation.";
|
|
|
210 |
$R_loggedin_stringl5 = "These data will be automatically deleted after one year.";
|
|
|
211 |
$R_loggedout_string = "Logout made captive portal!";
|
|
|
212 |
$R_reply_1 = "Your daily connexion time has been reached";
|
|
|
213 |
$R_reply_2 = "Your monthly connexion time has been reached";
|
|
|
214 |
$R_reply_3 = "You try to connect outside of your allowed timespan";
|
|
|
215 |
$R_reply_4 = "your account expired";
|
|
|
216 |
$R_reply_5 = "You have reached the maximum number of simultaneous logins";
|
|
|
217 |
$R_ca_1 = "Integrate the ALCASAR";
|
|
|
218 |
$R_ca_2 = "certificate";
|
|
|
219 |
$R_ca_3 = "in your web browser";
|
|
|
220 |
$R_ca_4 = "-help-";
|
|
|
221 |
$R_online_time = "Online time";
|
|
|
222 |
$R_remaining_time = "Remaining time";
|
|
|
223 |
}
|
|
|
224 |
|
|
|
225 |
# Make sure that the form parameters are clean
|
|
|
226 |
#$OK_CHARS='-a-zA-Z0-9_.@&=%!';
|
|
|
227 |
#$_ = $input = <STDIN>;
|
|
|
228 |
#s/[^$OK_CHARS]/_/go;
|
|
|
229 |
#$input = $_;
|
|
|
230 |
|
|
|
231 |
# Make sure that the get query parameters are clean
|
|
|
232 |
#$OK_CHARS='-a-zA-Z0-9_.@&=%!';
|
|
|
233 |
#$_ = $query=$ENV{QUERY_STRING};
|
|
|
234 |
#s/[^$OK_CHARS]/_/go;
|
|
|
235 |
#$query = $_;
|
|
|
236 |
|
|
|
237 |
# If https not use, tell it's wrong
|
|
|
238 |
if (!($_SERVER['HTTPS'] == 'on')) {
|
|
|
239 |
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
|
|
|
240 |
<html>
|
|
|
241 |
<head>
|
|
|
242 |
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
|
|
|
243 |
<title>$R_loggedcont</title>
|
|
|
244 |
<meta http-equiv=\"Cache-control\" content=\"no-cache\">
|
|
|
245 |
<meta http-equiv=\"Pragma\" content=\"no-cache\">
|
|
|
246 |
</head>
|
|
|
247 |
<body bgColor = 'white'>
|
|
|
248 |
<h1 style=\"text-align: center;\">$R_loginfailed</h1>
|
|
|
249 |
<center>$R_encrypted</center>
|
|
|
250 |
</body>
|
|
|
251 |
</html>";
|
|
|
252 |
exit(0);
|
|
|
253 |
}
|
|
|
254 |
|
|
|
255 |
# Read form parameters which we care about
|
|
|
256 |
if (isset($_POST['UserName'])){ $username = $_POST['UserName'];} else {$username="";}
|
|
|
257 |
if (isset($_POST['Password'])){ $password = $_POST['Password'];} else {$password="";}
|
|
|
258 |
if (isset($_POST['challenge'])){$challenge = $_POST['challenge'];} else {$challenge="";}
|
|
|
259 |
if (isset($_POST['button'])){ $button = $_POST['button'];} else { $button="";}
|
|
|
260 |
if (isset($_POST['logout'])){ $logout = $_POST['logout'];} else {$logout="";}
|
|
|
261 |
if (isset($_POST['prelogin'])){ $prelogin = $_POST['prelogin'];} else {$prelogin="";}
|
|
|
262 |
if (isset($_POST['res'])){ $res = $_POST['res'];} else {$res="";}
|
|
|
263 |
if (isset($_POST['uamip'])){ $uamip = $_POST['uamip'];} else {$uamip="";}
|
|
|
264 |
if (isset($_POST['uamport'])){ $uamport = $_POST['uamport'];} else {$uamport="";}
|
|
|
265 |
if (isset($_POST['userurl'])){ $userurl = $_POST['userurl'];} else {$userurl="";}
|
|
|
266 |
if (isset($_POST['timeleft'])){ $timeleft = $_POST['timeleft'];} else {$timeleft="";}
|
|
|
267 |
if (isset($_POST['redirurl'])){ $redirurl = $_POST['redirurl'];} else {$redirurl="";}
|
|
|
268 |
|
|
|
269 |
# Read query parameters which we care about
|
|
|
270 |
if (isset($_GET['res'])) $res = $_GET['res'];
|
|
|
271 |
if (isset($_GET['challenge'])) $challenge = $_GET['challenge'];
|
|
|
272 |
if (isset($_GET['uamip'])) $uamip = $_GET['uamip'];
|
|
|
273 |
if (isset($_GET['uamport'])) $uamport = $_GET['uamport'];
|
|
|
274 |
if (isset($_GET['reply'])){ $reply = $_GET['reply'];} else {$reply="";}
|
|
|
275 |
if (isset($_GET['userurl'])) $userurl = $_GET['userurl'];
|
|
|
276 |
if (isset($_GET['timeleft'])) $timeleft = $_GET['timeleft'];
|
|
|
277 |
if (isset($_GET['redirurl'])) $redirurl = $_GET['redirurl'];
|
|
|
278 |
|
|
|
279 |
# translation of radius replies
|
|
|
280 |
if (isset($reply)){
|
|
|
281 |
switch(trim ($reply)) {
|
|
|
282 |
case 'Your maximum daily usage time has been reached' : $reply = $R_reply_1 ; break;
|
|
|
283 |
case 'Your maximum monthly usage time has been reached' : $reply = $R_reply_2 ; break;
|
|
|
284 |
case 'You are calling outside your allowed timespan' : $reply = $R_reply_3 ; break;
|
|
|
285 |
case 'Password Has Expired' : $reply = $R_reply_4 ; break;
|
|
|
286 |
case 'You are already logged in - access denied' : $reply = $R_reply_5 ; break;
|
|
|
287 |
}}
|
|
|
288 |
|
|
|
289 |
# If attempt to login
|
|
|
290 |
if ("$button" == "$R_boutonO") {
|
|
|
291 |
$hexchal = pack ("H32", $challenge);
|
|
|
292 |
$newchal = pack ("H*", md5($hexchal . $uamsecret));
|
|
|
293 |
$response = md5("\0" . $password . $newchal);
|
|
|
294 |
$newpwd = pack("a32", $password);
|
|
|
295 |
$pappassword = implode ("", unpack("H32", ($newpwd ^ $newchal)));
|
|
|
296 |
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
|
|
|
297 |
<html>
|
|
|
298 |
<head>
|
|
|
299 |
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
|
|
|
300 |
<title>$R_loggingin</title>
|
|
|
301 |
<meta http-equiv=\"Cache-control\" content=\"no-cache\">
|
|
|
302 |
<meta http-equiv=\"Pragma\" content=\"no-cache\">
|
|
|
303 |
<meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl\">
|
|
|
304 |
</head>
|
|
|
305 |
<body bgColor = 'white'>
|
|
|
306 |
<h1 style=\"text-align: center;\">$R_loggingin</h1>
|
|
|
307 |
<center>
|
|
|
308 |
$R_wait
|
|
|
309 |
</center>
|
|
|
310 |
</body>
|
|
|
311 |
</html>";
|
|
|
312 |
exit(0);
|
|
|
313 |
}
|
|
|
314 |
|
|
|
315 |
switch($res) {
|
|
|
316 |
case 'success': $result = 1; break; // If login successful
|
|
|
317 |
case 'failed': $result = 2; break; // If login failed
|
|
|
318 |
case 'logoff': $result = 3; break; // If logout successful
|
|
|
319 |
case 'already': $result = 4; break; // If tried to login while already logged in
|
|
|
320 |
case 'notyet': $result = 5; break; // If not logged in yet
|
|
|
321 |
case 'smartclient': $result = 6; break; // If login from smart client
|
|
|
322 |
case 'popup1': $result = 11; break; // If requested a logging in pop up window
|
|
|
323 |
case 'popup2': $result = 12; break; // If requested a success pop up window
|
|
|
324 |
case 'popup3': $result = 13; break; // If requested a logout pop up window
|
|
|
325 |
default: $result = 0; // Default: It was not a form request
|
|
|
326 |
}
|
|
|
327 |
|
|
|
328 |
# Otherwise it was not a form request
|
|
|
329 |
# Send out an error message
|
484 |
stephane |
330 |
if ($result == 0) { //erreur
|
318 |
richard |
331 |
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
|
|
|
332 |
<html>
|
|
|
333 |
<head>
|
|
|
334 |
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
|
|
|
335 |
<title>$R_loginfailed</title>
|
|
|
336 |
<meta http-equiv=\"Cache-control\" content=\"no-cache\">
|
|
|
337 |
<meta http-equiv=\"Pragma\" content=\"no-cache\">
|
|
|
338 |
</head>
|
|
|
339 |
<body bgColor = 'white'>
|
|
|
340 |
<h1 style=\"text-align: center;\">$R_loginfailed</h1>
|
|
|
341 |
<center>
|
|
|
342 |
$R_ChilliError
|
|
|
343 |
</center>
|
|
|
344 |
</body>
|
|
|
345 |
</html>";
|
|
|
346 |
exit(0);
|
|
|
347 |
}
|
|
|
348 |
|
|
|
349 |
# Generate the output
|
|
|
350 |
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
|
|
|
351 |
<html>
|
|
|
352 |
<head>
|
|
|
353 |
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
|
|
|
354 |
<title>$R_loggingin</title>
|
|
|
355 |
<meta http-equiv=\"Cache-control\" content=\"no-cache\">
|
|
|
356 |
<meta http-equiv=\"Pragma\" content=\"no-cache\">
|
484 |
stephane |
357 |
<script type=\"text/javascript\" language=\"JavaScript\">
|
|
|
358 |
var blur = 0; // not un use
|
|
|
359 |
var mytimeleft = 0; // not un use
|
|
|
360 |
alcasar_popup = null;
|
|
|
361 |
|
318 |
richard |
362 |
function popUp(URL) {
|
484 |
stephane |
363 |
if (self.name != \"alcasar_popup\") {
|
|
|
364 |
alcasar_popup = window.open(URL, 'alcasar_popup', 'width=500,height=250,directories=no,resizable=no,scrollbars=yes,location=no,toolbar=no,statusbar=no,menubar=no');
|
318 |
richard |
365 |
}
|
|
|
366 |
}
|
|
|
367 |
|
484 |
stephane |
368 |
function doOnLoad(result, userurl, redirurl, timeleft) {
|
|
|
369 |
if (timeleft) { // not in use
|
318 |
richard |
370 |
mytimeleft = timeleft;
|
|
|
371 |
}
|
484 |
stephane |
372 |
if (result == 1) { //success
|
|
|
373 |
//window.location = userurl;
|
|
|
374 |
if (alcasar_popup != null) alcasar_popup.focus();
|
|
|
375 |
";
|
|
|
376 |
if ($adminurl) { echo "window.location = \"$adminurl\";";}
|
|
|
377 |
else if ($redirurl) { echo "window.location = \"$redirurl\";";}
|
|
|
378 |
else if ($userurl) { echo "window.location = \"$userurl\";";}
|
|
|
379 |
else echo "window.home();";
|
318 |
richard |
380 |
echo "
|
|
|
381 |
}
|
484 |
stephane |
382 |
if ((result == 2) || (result == 3) || result == 5) { //failed or logoff or notyet
|
|
|
383 |
if (alcasar_popup != null) alcasar_popup.close();
|
|
|
384 |
document.form1.UserName.focus();
|
318 |
richard |
385 |
}
|
|
|
386 |
}
|
|
|
387 |
</script>
|
354 |
richard |
388 |
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
|
318 |
richard |
389 |
</head>
|
484 |
stephane |
390 |
<body onLoad=\"javascript:doOnLoad($result,'$userurl','$redirurl','$timeleft')\">
|
354 |
richard |
391 |
<center>";
|
|
|
392 |
#Modifications par stephane ERARD le 30 11 2010
|
484 |
stephane |
393 |
#Modifications par steweb57 le 06 02 2011
|
|
|
394 |
if ($debug){
|
318 |
richard |
395 |
# begin debugging
|
484 |
stephane |
396 |
print "<center>THE INPUT by GET method (for debugging):<br>";
|
|
|
397 |
foreach ($_GET as $key => $value) {
|
|
|
398 |
print $key . "=" . $value . "<br>";
|
|
|
399 |
}
|
|
|
400 |
print "<br>";
|
|
|
401 |
print "<center>THE INPUT by POST method (for debugging):<br>";
|
|
|
402 |
foreach ($_POST as $key => $value) {
|
|
|
403 |
print $key . "=" . $value . "<br>";
|
|
|
404 |
}
|
|
|
405 |
print "<br></center>";
|
318 |
richard |
406 |
# end debugging
|
484 |
stephane |
407 |
}
|
318 |
richard |
408 |
|
484 |
stephane |
409 |
if ($result == 2) { //failed
|
318 |
richard |
410 |
echo "
|
354 |
richard |
411 |
<DIV id=\"logon\">
|
|
|
412 |
<h2>$R_loginfailed</h2>";
|
318 |
richard |
413 |
if ($reply) {
|
|
|
414 |
#traitement du reply ...
|
|
|
415 |
echo "<center> $reply </BR></BR></center>";
|
|
|
416 |
}
|
|
|
417 |
}
|
|
|
418 |
|
484 |
stephane |
419 |
if ($result == 3 || $result == 5) { //logoff or notyet
|
318 |
richard |
420 |
echo "
|
354 |
richard |
421 |
<DIV id=\"logon\">
|
|
|
422 |
<h1>$organisme</h1>
|
|
|
423 |
<h2>$R_loggedcont</h2>";
|
318 |
richard |
424 |
}
|
484 |
stephane |
425 |
|
|
|
426 |
if ($result == 2 || $result == 3 || $result == 5) { //failed or logoff or notyet
|
318 |
richard |
427 |
echo "
|
354 |
richard |
428 |
<IMG id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
|
|
|
429 |
<form name=\"form1\" method=\"post\" action=\"$loginpath\">
|
|
|
430 |
<input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
|
|
|
431 |
<input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
|
|
|
432 |
<input type=\"hidden\" name=\"uamport\" value=\"$uamport\">
|
|
|
433 |
<input type=\"hidden\" name=\"userurl\" value=\"$userurl\">
|
|
|
434 |
<TABLE id=\"boite-logon\">
|
|
|
435 |
<TR>
|
|
|
436 |
<TD width=\"20%\" rowspan=\"4\"><IMG id=\"logo-organ\" src=\"/images/organisme.png\"></TD>
|
|
|
437 |
<TD width=\"30%\" align=\"right\">$R_user</TD>
|
|
|
438 |
<TD width=\"50%\" align=\"left\"><INPUT type=\"text\" maxLength=\"32\" name=\"UserName\"></TD>
|
|
|
439 |
</TR>
|
|
|
440 |
<TR>
|
|
|
441 |
<TD align=\"right\">$R_password</TD>
|
|
|
442 |
<TD align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\"></TD>
|
|
|
443 |
</TR>
|
|
|
444 |
<TR>
|
484 |
stephane |
445 |
<TD height=\"23\" colSpan=\"2\" align=\"center\"><INPUT value=\"$R_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$statuspath')\"></TD>
|
354 |
richard |
446 |
</TR>
|
|
|
447 |
<TR>
|
484 |
stephane |
448 |
<TD colSpan=2 align=center><H6><A href=\"https://$uamip/pass/\">$R_passwordchg</A></H6></TD>
|
354 |
richard |
449 |
</TR>
|
|
|
450 |
</TABLE>
|
|
|
451 |
<TABLE id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\">
|
|
|
452 |
<TR>
|
484 |
stephane |
453 |
<TD align=\"center\"><FONT color=\"red\"><B>$R_loggedin_stringl0</B></FONT></TD>
|
354 |
richard |
454 |
</TR>
|
|
|
455 |
<TR>
|
484 |
stephane |
456 |
<TD align=\"center\"><FONT color=\"black\"><B>$R_loggedin_stringl1</B></FONT></TD>
|
354 |
richard |
457 |
</TR>
|
|
|
458 |
<TR>
|
|
|
459 |
<TD align=\"left\">
|
|
|
460 |
<UL>
|
|
|
461 |
<LI>$R_loggedin_stringl2</LI>
|
|
|
462 |
<LI>$R_loggedin_stringl4</LI>
|
|
|
463 |
<LI>$R_loggedin_stringl3</LI>
|
|
|
464 |
<LI>$R_loggedin_stringl5</LI>
|
|
|
465 |
</UL>
|
|
|
466 |
<P id=\"aide-certif\">
|
|
|
467 |
$R_ca_1 <A href=\"/certs/certificat_alcasar_ca.crt\">$R_ca_2</a> $R_ca_3 <a href=\"/alcasar-certificat.pdf\">$R_ca_4</A>
|
|
|
468 |
</P>
|
|
|
469 |
</TD>
|
|
|
470 |
</TR>
|
|
|
471 |
</TABLE>
|
484 |
stephane |
472 |
|
318 |
richard |
473 |
</center>
|
|
|
474 |
</form>
|
484 |
stephane |
475 |
</DIV>
|
318 |
richard |
476 |
</body>
|
|
|
477 |
</html>";
|
|
|
478 |
}
|
354 |
richard |
479 |
#Fin des modifications
|
484 |
stephane |
480 |
if ($result == 1) { //sucess
|
318 |
richard |
481 |
echo "
|
354 |
richard |
482 |
<table id=\"auth_reussi\">
|
318 |
richard |
483 |
<tr>
|
|
|
484 |
<td>
|
340 |
richard |
485 |
<img height=\"150\" src=\"/images/logo-alcasar.png\">
|
318 |
richard |
486 |
</td>
|
|
|
487 |
<td>
|
354 |
richard |
488 |
<p class=\"text_auth\">$R_login</p>
|
318 |
richard |
489 |
</td>
|
484 |
stephane |
490 |
</tr>
|
|
|
491 |
<tr>
|
|
|
492 |
<td></td>
|
|
|
493 |
<td>";
|
318 |
richard |
494 |
if ($reply) {
|
|
|
495 |
## traitement reply
|
484 |
stephane |
496 |
echo "$reply</br></br>";
|
318 |
richard |
497 |
}
|
|
|
498 |
echo "
|
484 |
stephane |
499 |
<a href=\"http://$uamip:$uamport/logoff\">$R_logout</a>
|
318 |
richard |
500 |
</td>
|
|
|
501 |
</tr>
|
|
|
502 |
</table>
|
484 |
stephane |
503 |
</body>
|
|
|
504 |
</html>";
|
318 |
richard |
505 |
}
|
484 |
stephane |
506 |
if ($result == 11) { //popup 1 (login)
|
318 |
richard |
507 |
echo "
|
354 |
richard |
508 |
<h2 style=\"text-align: center;\">$R_loggingin</h2>
|
318 |
richard |
509 |
<center>$R_wait</center>
|
|
|
510 |
</body>
|
|
|
511 |
</html>";
|
|
|
512 |
}
|
|
|
513 |
exit(0);
|
|
|
514 |
?>
|