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