Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

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