Subversion Repositories ALCASAR

Rev

Rev 59 | Go to most recent revision | Details | Compare with Previous | 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
 
59 richard 13
$organisme = "rexy";
1 root 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.
139 richard 28
$uamsecret = "sfk5D8Yn";
1 root 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 = 'fr';
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. <BR> La conexión de red está funcionando. <br> Haga clic en Sí para cerrar la conexión a cerrar la sesión!";
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";
59 richard 70
  $R_ca_1 = "How integrate the ALCASAR C.A";
71
  $R_ca_2 = "certificate";
72
  $R_ca_3 = "in your web browser?";
73
  $R_ca_4 = "<help>";
1 root 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";
59 richard 104
  $R_ca_1 = "How integrate the ALCASAR C.A";
105
  $R_ca_2 = "certificate";
106
  $R_ca_3 = "in your web browser?";
107
  $R_ca_4 = "<help>";
1 root 108
}
109
else if($Language == 'nl'){
110
  $R_ChilliError	= "De authenticatie moet een succes worden via de captive portal dienst.";
111
  $R_login			= "Succesvolle authenticatie. <BR> De netwerkverbinding werkt. <br> Klikt u op de afsluiting van de verbinding af te sluiten uw sessie!";
112
  $R_logout			= "Slotkoers verbinding";
113
  $R_loginfailed	= "Authenticatie mislukt";
114
  $R_loggingin		= "Identificatie van de captive-portaal";
115
  $R_loggedcont		= "Network Access Control";
116
  $R_loggedout		= "Uw sessie is gesloten";
117
  $R_user			= "Gebruiker";
118
  $R_password		= "Wachtwoord";
119
  $R_passwordchg	= "Wijzig uw wachtwoord";
120
  $R_wait			= "Wacht een moment ...";
121
  $R_onlinetime		= "Sluit tijd:";
122
  $R_remainingtime	= "Verbreking in:";
123
  $R_encrypted		= "De opening moet gebruiken gecodeerde verbinding";
124
  $R_boutonO		= "Authenticatie";
125
  $R_boutonF		= "Sluiten";
126
  $R_loggedin_stringl0 = "Information System Security";
127
  $R_loggedin_stringl1 = "Welkom portaal ALCASAR";
128
  $R_loggedin_stringl2 = "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
129
  $R_loggedin_stringl3 = "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
130
  $R_loggedin_stringl4 = "De geregistreerde gegevens kunnen worden kunnen worden bediend door een rechterlijke instantie in de loop van een onderzoek.";
131
  $R_loggedin_stringl5 = "Deze gegevens worden automatisch verwijderd na een jaar.";
132
  $R_loggedout_string = "Logout gemaakt intern portaal!";
133
  $R_reply_1 = "Your daily connexion time has been reached";
134
  $R_reply_2 = "Your monthly connexion time has been reached";
135
  $R_reply_3 = "You try to connect outside of your allowed timespan";
136
  $R_reply_4 = "your account expired";
137
  $R_reply_5 = "You have reached the maximum number of simultaneous logins";
59 richard 138
  $R_ca_1 = "How integrate the ALCASAR C.A";
139
  $R_ca_2 = "certificate";
140
  $R_ca_3 = "in your web browser?";
141
  $R_ca_4 = "<help>";
1 root 142
}
143
else if($Language == 'en'){
144
  $R_ChilliError	= "The authentication must be successful through the captive portal service.";
145
  $R_login			= "Successful authentication. <BR> The network connection is working. <br> Remember to click Close the connection to close your session!";
146
  $R_logout			= "Closing connection";
147
  $R_loginfailed	= "Authentication Failed";
148
  $R_loggingin		= "Identification on the captive portal";
149
  $R_loggedcont		= "Network Access Control";
150
  $R_loggedout		= "Your session is closed";
151
  $R_user			= "User";
152
  $R_password		= "Password";
153
  $R_passwordchg	= "Change your password";
154
  $R_wait			= "Please wait a moment ...";
155
  $R_onlinetime		= "Connect time:";
156
  $R_remainingtime	= "Disconnection in:";
157
  $R_encrypted		= "The opening must use encrypted connection";
158
  $R_boutonO		= "Authentication";
159
  $R_boutonF		= "Close";
160
  $R_loggedin_stringl0 = "Information System Security";
161
  $R_loggedin_stringl1 = "Welcome on captive portal ALCASAR";
162
  $R_loggedin_stringl2 = "The portal was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
163
  $R_loggedin_stringl3 = "Your activity on the network is registered in accordance with privacy.";
164
  $R_loggedin_stringl4 = "The recorded data can be able to be operated by a judicial authority in the course of an investigation.";
165
  $R_loggedin_stringl5 = "These data will be automatically deleted after one year.";
166
  $R_loggedout_string = "Logout made captive portal!";
167
  $R_reply_1 = "Your daily connexion time has been reached";
168
  $R_reply_2 = "Your monthly connexion time has been reached";
169
  $R_reply_3 = "You try to connect outside of your allowed timespan";
170
  $R_reply_4 = "your account expired";
171
  $R_reply_5 = "You have reached the maximum number of simultaneous logins";
59 richard 172
  $R_ca_1 = "Integrate the ALCASAR C.A";
173
  $R_ca_2 = "certificate";
174
  $R_ca_3 = "in your web browser";
175
  $R_ca_4 = "-help-";
1 root 176
}
177
else{
178
  $R_ChilliError	= "L'authentification doit &ecirc;tre r&eacute;ussie au travers du service du portail captif.";
179
  $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 !";
180
  $R_logout			= "Fermeture de la connexion";
181
  $R_loginfailed	= "Echec d'authentification";
182
  $R_loggingin		= "Identification sur le portail captif";
183
  $R_loggedcont		= "Contr&ocirc;le d'acc&egrave;s au r&eacute;seau";
184
  $R_loggedout		= "Votre session est fermée";
185
  $R_user			= "Identifiant";
186
  $R_password		= "Mot de passe";
187
  $R_passwordchg	= "Modifier son mot de passe";
188
  $R_wait			= "Patientez un instant ...";
189
  $R_onlinetime		= "Temps de connexion:";
190
  $R_remainingtime	= "Deconnexion dans :";
191
  $R_encrypted		= "La connexion avec le portail doit &ecirc;tre chiffr&eacute;e";
192
  $R_boutonO		= "Authentification";
193
  $R_boutonF		= "Fermer";
194
  $R_loggedin_stringl0 = "S&eacute;curit&eacute; des Syst&egrave;mes d'information";
195
  $R_loggedin_stringl1 = "Bienvenue sur le portail captif ALCASAR";
196
  $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.";
197
  $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.";
198
  $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.";
199
  $R_loggedin_stringl5 = "Ces donn&eacute;es seront automatiquement supprim&eacute;es au bout d'un an.";
200
  $R_loggedout_string = "D&eacute;connexion du portail captif effectu&eacute;e !";
201
  $R_reply_1 = "Votre dur&eacute;e de connexion journali&egrave;re a &eacute;t&eacute; atteinte";
202
  $R_reply_2 = "Votre dur&eacute;e de connexion mensuelle a &eacute;t&eacute; atteinte";
203
  $R_reply_3 = "Vous tentez de vous connecter en dehors de votre p&eacute;riode autoris&eacute;e";
204
  $R_reply_4 = "Votre compte a expir&eacute";
205
  $R_reply_5 = "Vous avez atteint le nombre maximum de connexions simultanées";
59 richard 206
  $R_ca_1 = "Int&eacute;grer le ";
207
  $R_ca_2 = "certificat";
208
  $R_ca_3 = "de l'A.C d'ALCASAR dans votre navigateur web";
209
  $R_ca_4 = "-aide-";
1 root 210
}
211
 
212
# Make sure that the form parameters are clean
213
#$OK_CHARS='-a-zA-Z0-9_.@&=%!';
214
#$_ = $input = <STDIN>;
215
#s/[^$OK_CHARS]/_/go;
216
#$input = $_;
217
 
218
# Make sure that the get query parameters are clean
219
#$OK_CHARS='-a-zA-Z0-9_.@&=%!';
220
#$_ = $query=$ENV{QUERY_STRING};
221
#s/[^$OK_CHARS]/_/go;
222
#$query = $_;
223
 
224
# If https not use, tell it's wrong
225
if (!($_SERVER['HTTPS'] == 'on')) {
226
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
227
<html>
228
<head>
229
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
230
  <title>$R_loggedcont</title>
231
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
232
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
233
</head>
234
<body bgColor = 'white'>
235
  <h1 style=\"text-align: center;\">$R_loginfailed</h1>
236
  <center>$R_encrypted</center>
237
</body>
238
</html>";
239
    exit(0);
240
}
241
 
242
# Read form parameters which we care about
243
if (isset($_POST['UserName'])){	$username	= $_POST['UserName'];} else {$username="";}
244
if (isset($_POST['Password'])){	$password	= $_POST['Password'];} else {$password="";}
245
if (isset($_POST['challenge'])){$challenge	= $_POST['challenge'];} else {$challenge="";}
246
if (isset($_POST['button'])){	$button		= $_POST['button'];} else { $button="";}
247
if (isset($_POST['logout'])){	$logout		= $_POST['logout'];} else {$logout="";}
248
if (isset($_POST['prelogin'])){	$prelogin	= $_POST['prelogin'];} else {$prelogin="";}
249
if (isset($_POST['res'])){	$res		= $_POST['res'];} else {$res="";}
250
if (isset($_POST['uamip'])){	$uamip		= $_POST['uamip'];} else {$uamip="";}
251
if (isset($_POST['uamport'])){	$uamport	= $_POST['uamport'];} else {$uamport="";}
252
if (isset($_POST['userurl'])){	$userurl	= $_POST['userurl'];} else {$userurl="";}
253
if (isset($_POST['timeleft'])){	$timeleft	= $_POST['timeleft'];} else {$timeleft="";}
254
if (isset($_POST['redirurl'])){	$redirurl	= $_POST['redirurl'];} else {$redirurl="";}
255
 
256
# Read query parameters which we care about
257
if (isset($_GET['res']))	$res		= $_GET['res'];
258
if (isset($_GET['challenge']))	$challenge	= $_GET['challenge'];
259
if (isset($_GET['uamip']))	$uamip		= $_GET['uamip'];
260
if (isset($_GET['uamport']))	$uamport	= $_GET['uamport'];
261
if (isset($_GET['reply'])){	$reply		= $_GET['reply'];} else {$reply="";}
262
if (isset($_GET['userurl']))	$userurl	= $_GET['userurl'];
263
if (isset($_GET['timeleft']))	$timeleft	= $_GET['timeleft'];
264
if (isset($_GET['redirurl']))	$redirurl	= $_GET['redirurl'];
265
 
266
# translation of radius replies
267
if (isset($reply)){
268
	switch(trim ($reply)) {
269
  case 'Your maximum daily usage time has been reached' : $reply = $R_reply_1 ; break;
270
  case 'Your maximum monthly usage time has been reached' : $reply = $R_reply_2 ; break;
271
  case 'You are calling outside your allowed timespan' : $reply = $R_reply_3 ; break;
272
  case 'Password Has Expired' : $reply =  $R_reply_4 ; break;
273
  case 'You are already logged in - access denied' : $reply = $R_reply_5 ; break;
274
  }}
275
 
276
# If attempt to login
277
if ("$button" == "$R_boutonO") {
278
  $hexchal = pack ("H32", $challenge);
59 richard 279
  $newchal = pack ("H*", md5($hexchal . $uamsecret));
1 root 280
  $response = md5("\0" . $password . $newchal);
281
  $newpwd = pack("a32", $password);
282
  $pappassword = implode ("", unpack("H32", ($newpwd ^ $newchal)));
283
  echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
284
<html>
285
<head>
286
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
287
  <title>$R_loggingin</title>
288
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
59 richard 289
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
290
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl\">
291
  </head>
1 root 292
<body bgColor = 'white'>
293
<h1 style=\"text-align: center;\">$R_loggingin</h1>
294
  <center>
295
    $R_wait
296
  </center>
297
</body>
298
</html>";
299
    exit(0);
300
}
301
 
302
switch($res) {
303
  case 'success':     $result =  1; break; // If login successful
304
  case 'failed':      $result =  2; break; // If login failed
305
  case 'logoff':      $result =  3; break; // If logout successful
306
  case 'already':     $result =  4; break; // If tried to login while already logged in
307
  case 'notyet':      $result =  5; break; // If not logged in yet
308
  case 'smartclient': $result =  6; break; // If login from smart client
309
  case 'popup1':      $result = 11; break; // If requested a logging in pop up window
310
  case 'popup2':      $result = 12; break; // If requested a success pop up window
311
  case 'popup3':      $result = 13; break; // If requested a logout pop up window
312
  default: $result = 0; // Default: It was not a form request
313
}
314
 
315
# Otherwise it was not a form request
316
# Send out an error message
317
if ($result == 0) {
318
    echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
319
<html>
320
<head>
321
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
322
  <title>$R_loginfailed</title>
323
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
324
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
325
</head>
326
<body bgColor = 'white'>
327
  <h1 style=\"text-align: center;\">$R_loginfailed</h1>
328
  <center>
329
    $R_ChilliError
330
  </center>
331
</body>
332
</html>";
333
    exit(0);
334
}
335
 
336
# Generate the output
337
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
338
<html>
339
<head>
340
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
341
  <title>$R_loggingin</title>
342
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
343
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
344
  <SCRIPT LANGUAGE=\"JavaScript\">
345
    var blur = 0;
346
    var starttime = new Date();
347
    var startclock = starttime.getTime();
348
    var mytimeleft = 0;
349
 
350
    function doTime() {
351
      window.setTimeout( \"doTime()\", 1000 );
352
      t = new Date();
353
      time = Math.round((t.getTime() - starttime.getTime())/1000);
354
      if (mytimeleft) {
355
        time = mytimeleft - time;
356
        if (time <= 0) {
357
          window.location = \"$loginpath?res=popup3&uamip=$uamip&uamport=$uamport\";
358
        }
359
      }
360
      if (time < 0) time = 0;
361
      hours = (time - (time % 3600)) / 3600;
362
      time = time - (hours * 3600);
363
      mins = (time - (time % 60)) / 60;
364
      secs = time - (mins * 60);
365
      if (hours < 10) hours = \"0\" + hours;
366
      if (mins < 10) mins = \"0\" + mins;
367
      if (secs < 10) secs = \"0\" + secs;
368
      title = \"Online time: \" + hours + \":\" + mins + \":\" + secs;
369
      if (mytimeleft) {
370
        title = \"Remaining time: \" + hours + \":\" + mins + \":\" + secs;
371
      }
372
      if(document.all || document.getElementById){
373
         document.title = title;
374
      }
375
      else {   
376
        self.status = title;
377
      }
378
    }
379
 
380
    function popUp(URL) {
381
      if (self.name != \"chillispot_popup\") {
382
        chillispot_popup = window.open(URL, 'chillispot_popup', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=375');
383
      }
384
    }
385
 
386
    function doOnLoad(result, URL, userurl, redirurl, timeleft) {
387
      if (timeleft) {
388
        mytimeleft = timeleft;
389
      }
390
      if ((result == 1) && (self.name == \"chillispot_popup\")) {
391
        doTime();
392
      }
393
      if ((result == 1) && (self.name != \"chillispot_popup\")) {
394
        chillispot_popup = window.open(URL, 'chillispot_popup', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=375');
395
      }
396
      if ((result == 2) || result == 5) {
397
        document.form1.UserName.focus()
398
      }
399
      if ((result == 2) && (self.name != \"chillispot_popup\")) {
400
        chillispot_popup = window.open('', 'chillispot_popup', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=200');
401
        chillispot_popup.close();
402
      }
403
      if ((result == 12) && (self.name == \"chillispot_popup\")) {
404
	doTime();
405
	";
406
if ($adminurl) { echo "opener.location = \"$adminurl\";";}
407
else if	($redirurl) { echo "opener.location = \"$redirurl\";";}
408
else if ($userurl) { echo "opener.location = \"$userurl\";";}
409
else echo "opener.home();";
410
        echo "
411
        self.focus();
412
        blur = 0;
413
      }
414
      if ((result == 13) && (self.name == \"chillispot_popup\")) {
415
        self.focus();
416
        blur = 1;
417
      }
418
    }
419
 
420
    function DecO(result) {
421
      if ((result == 12) && (self.name == \"chillispot_popup\")) {
422
        window.location = \"http://$uamip:$uamport/logoff \";
423
	self.focus();
424
	blur = 1;
425
	alert ('$R_loggedout');
426
	}
427
     }
428
  </script>
429
<link rel=\"stylesheet\" href=\"/css/style.css\" type=\"text/css\">
430
</head>
431
<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'>";
432
 
433
# begin debugging
434
#  print "<center>THE INPUT by GET method (for debugging):<br>";
435
#  foreach ($_GET as $key => $value) {
436
#    print $key . "=" . $value . "<br>";
437
#  }
438
#  print "<br>";
439
#  print "<center>THE INPUT by POST method (for debugging):<br>";
440
#  foreach ($_POST as $key => $value) {
441
#    print $key . "=" . $value . "<br>";
442
#  }
443
#  print "<br></center>";
444
# end debugging
445
 
446
if ($result == 2) {
447
    echo "
448
  <h1 style=\"text-align: center;\">$R_loginfailed</h1>";
449
    if ($reply) {
450
#traitement du reply ...
451
    echo "<center> $reply </BR></BR></center>";
452
    }
453
}
454
 
455
if ($result == 5) {
456
    echo "
457
<h1 style=\"text-align: center;\">$organisme</h1>
458
<h1 style=\"text-align: center;\">$R_loggedcont</h1>";
459
}
460
 
461
if ($result == 2 || $result == 5) {
462
  echo "
463
  <form name=\"form1\" method=\"post\" action=\"$loginpath\">
464
  <input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
465
  <input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
466
  <input type=\"hidden\" name=\"uamport\" value=\"$uamport\">
467
  <input type=\"hidden\" name=\"userurl\" value=\"$userurl\">
468
  <center>
469
  <table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" width=\"100%\">
470
    <tr>
471
      <td rowspan=\"2\" align=\"right\" width=\"25%\" ><img src=\"/images/organisme.png\" width=\"90\"></td>
472
      <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>
473
      <td rowspan=\"2\" align=\"left\" width=\"25%\"><img src=\"/images/logo-alcasar.gif\" width=\"90\"></td>
474
    </tr><tr>
475
      <td width=\"50%\" align=\"center\">$R_password&nbsp;<input STYLE=\"font-family: Arial\" type=\"password\" name=\"Password\" size=\"20\" maxlength=\"32\"></td>
476
    </tr><tr>
477
      <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>
478
    </tr>
479
    <tr>
480
      <td align=\"center\" colspan=\"4\"><H6><a href=\"https://$uamip/pass/\">$R_passwordchg</H6></td>
481
    </tr>
482
    <tr>
483
      <td align=\"center\" colspan=\"4\"><font color=\"red\"><b>$R_loggedin_stringl0</b></td>
484
    </tr><tr>
485
      <td align=\"left\" colspan=\"4\"><b></td>
486
    </tr><tr>
487
      <td align=\"center\" colspan=\"4\"><font color=\"black\"><b>$R_loggedin_stringl1</b></font></td>
488
    </tr><tr>
489
      <td align=\"left\" colspan=\"4\"><b>
490
      <li>
491
$R_loggedin_stringl2</li>
59 richard 492
      <li>
1 root 493
$R_loggedin_stringl3</li>
59 richard 494
      <li>
1 root 495
$R_loggedin_stringl4</li>
59 richard 496
      <li>
1 root 497
$R_loggedin_stringl5</li>
59 richard 498
      <hr>
139 richard 499
$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>
1 root 500
      </b></td>
501
    </tr>
502
  </table>
503
  </center>
504
  </form>
505
</body>
506
</html>";
507
}
508
 
509
if ($result == 1) {
510
  echo "
511
  <table>
512
  <tr>
513
  <td>
514
  <img src=\"/images/logo-alcasar.gif\">
515
  </td>
516
  <td>
517
  <h2 style=\"text-align: center;\">$R_login</h2>
518
  </td>
519
  </tr>";
520
  if ($reply) { 
521
 ## traitement reply
522
     echo "<center> $reply </br></br></center>";
523
  }
524
  echo "
525
  <center>
526
    <a href=\"http://$uamip:$uamport/logoff\">$R_logout</a>
527
  </center>
528
</body>
529
</html>";
530
}
531
 
532
if (($result == 4) || ($result == 12)) {
533
  echo "
534
  <table>
535
  <tr>
536
  <td>
537
  <img src=\"/images/logo-alcasar.gif\">
538
  </td>
539
  <td>
540
  <h2 style=\"text-align: center;\">$R_login</h2>
541
  </td>
542
  </tr>
543
  <tr><td colspan=2><center>
544
    <h2><a href=\"http://$uamip:$uamport/logoff\">$R_logout</a></h2>
545
  </center></td></tr>
546
  </table>
547
  </body>
548
  </html>";
549
}
550
 
551
if ($result == 11) {
552
  echo "
553
  <h1 style=\"text-align: center;\">$R_loggingin</h1>
554
  <center>$R_wait</center>
555
</body>
556
</html>";
557
}
558
 
559
if (($result == 3) || ($result == 13)) {
560
  echo "
561
  <center>
562
  <h1 style=\"text-align: center;\">$R_loggedout</h1>
563
  <FORM>
564
  <INPUT TYPE=\"button\" VALUE=\"$R_boutonF\" onClick=\"window.close()\">
565
  </FORM></CENTER>
566
</body>
567
</html>";
568
}
569
 
570
exit(0);
571
?>