Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

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