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