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
 
354 richard 13
$organisme = "etrs-ssic";
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.
354 richard 28
$uamsecret = "bZBMKhn2";
318 richard 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>
354 richard 441
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
318 richard 442
</head>
354 richard 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
  <center>";
445
#Modifications par stephane ERARD le 30 11 2010
446
 
447
 
318 richard 448
# begin debugging
449
#  print "<center>THE INPUT by GET method (for debugging):<br>";
450
#  foreach ($_GET as $key => $value) {
451
#    print $key . "=" . $value . "<br>";
452
#  }
453
#  print "<br>";
454
#  print "<center>THE INPUT by POST method (for debugging):<br>";
455
#  foreach ($_POST as $key => $value) {
456
#    print $key . "=" . $value . "<br>";
457
#  }
458
#  print "<br></center>";
459
# end debugging
460
 
461
if ($result == 2) {
462
    echo "
354 richard 463
	<DIV id=\"logon\">
464
	<h2>$R_loginfailed</h2>";
318 richard 465
    if ($reply) {
466
#traitement du reply ...
467
    echo "<center> $reply </BR></BR></center>";
468
    }
469
}
470
 
471
if ($result == 5) {
472
    echo "
354 richard 473
	<DIV id=\"logon\">
474
	<h1>$organisme</h1>
475
	<h2>$R_loggedcont</h2>";
318 richard 476
}
477
 
478
if ($result == 2 || $result == 5) {
479
  echo "
354 richard 480
	<IMG id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
481
	<form name=\"form1\" method=\"post\" action=\"$loginpath\">
482
	<input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
483
	<input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
484
	<input type=\"hidden\" name=\"uamport\" value=\"$uamport\">
485
	<input type=\"hidden\" name=\"userurl\" value=\"$userurl\">
486
		<TABLE id=\"boite-logon\">
487
			<TR>
488
				<TD width=\"20%\" rowspan=\"4\"><IMG id=\"logo-organ\" src=\"/images/organisme.png\"></TD>
489
				<TD width=\"30%\" align=\"right\">$R_user</TD>
490
				<TD width=\"50%\" align=\"left\"><INPUT type=\"text\" maxLength=\"32\" name=\"UserName\"></TD>
491
			</TR>
492
			<TR>
493
				<TD align=\"right\">$R_password</TD>
494
				<TD align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\"></TD>
495
			</TR>
496
			<TR>
497
				<TD height=\"23\" colSpan=\"2\" align=\"middle\"><INPUT value=\"$R_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$loginpath?res=popup1&uamip=$uamip&uamport=$uamport')\"></TD>
498
			</TR>
499
			<TR>
500
				<TD colSpan=2 align=middle><H6><A href=\"https://$uamip/pass/\">$R_passwordchg</A></H6></TD>
501
			</TR>
502
		</TABLE>
503
		<TABLE id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\">
504
			<TR>
505
				<TD align=\"middle\"><FONT color=\"red\"><B>$R_loggedin_stringl0</B></FONT></TD>
506
			</TR>
507
			<TR>
508
				<TD align=\"middle\"><FONT color=\"black\"><B>$R_loggedin_stringl1</B></FONT></TD>
509
			</TR>
510
			<TR>
511
				<TD align=\"left\">
512
					<UL>
513
						<LI>$R_loggedin_stringl2</LI>
514
						<LI>$R_loggedin_stringl4</LI>
515
						<LI>$R_loggedin_stringl3</LI> 
516
						<LI>$R_loggedin_stringl5</LI>
517
					</UL>
518
					<P id=\"aide-certif\">
519
					$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> 
520
					</P>
521
				</TD>
522
			</TR>
523
		</TABLE>
524
	</DIV>
318 richard 525
  </center>
526
  </form>
527
</body>
528
</html>";
529
}
354 richard 530
#Fin des modifications
318 richard 531
if ($result == 1) {
532
  echo "
354 richard 533
  <table id=\"auth_reussi\">
318 richard 534
  <tr>
535
  <td>
340 richard 536
  <img height=\"150\" src=\"/images/logo-alcasar.png\">
318 richard 537
  </td>
538
  <td>
354 richard 539
  <p class=\"text_auth\">$R_login</p>
318 richard 540
  </td>
541
  </tr>";
542
  if ($reply) { 
543
 ## traitement reply
544
     echo "<center> $reply </br></br></center>";
545
  }
546
  echo "
547
  <center>
548
    <a href=\"http://$uamip:$uamport/logoff\">$R_logout</a>
549
  </center>
550
</body>
551
</html>";
552
}
553
 
554
if (($result == 4) || ($result == 12)) {
555
  echo "
354 richard 556
  <table id=\"auth_reussi\">
318 richard 557
  <tr>
558
  <td>
340 richard 559
  <img height=\"150\" src=\"/images/logo-alcasar.png\">
318 richard 560
  </td>
561
  <td>
354 richard 562
  <p class=\"text_auth\">$R_login</p>
318 richard 563
  </td>
564
  </tr>
565
  <tr><td colspan=2><center>
354 richard 566
    <p class=\"lien_deco\"><a href=\"http://$uamip:$uamport/logoff\">$R_logout</a></p>
318 richard 567
  </center></td></tr>
568
  </table>
569
  </body>
570
  </html>";
571
}
572
 
573
if ($result == 11) {
574
  echo "
354 richard 575
  <h2 style=\"text-align: center;\">$R_loggingin</h2>
318 richard 576
  <center>$R_wait</center>
577
</body>
578
</html>";
579
}
580
 
581
if (($result == 3) || ($result == 13)) {
582
  echo "
583
  <center>
354 richard 584
  <p class=\"log_out\">$R_loggedout</p>
318 richard 585
  <FORM>
586
  <INPUT TYPE=\"button\" VALUE=\"$R_boutonF\" onClick=\"window.close()\">
587
  </FORM></CENTER>
588
</body>
589
</html>";
590
}
591
 
592
exit(0);
593
?>