Subversion Repositories ALCASAR

Rev

Rev 40 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 40 Rev 59
Line 8... Line 8...
8
# The contents of this file may be used under the terms of the GNU
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
9
# General Public License Version 2, provided that the above copyright
10
# notice and this permission notice is included in all copies or
10
# notice and this permission notice is included in all copies or
11
# substantial portions of the software.
11
# substantial portions of the software.
12
 
12
 
13
$organisme = "";
13
$organisme = "rexy";
14
# Redirects from CoovaChilli (chilli daemon) :
14
# Redirects from CoovaChilli (chilli daemon) :
15
# Response to login:
15
# Response to login:
16
  # success :	if login successful
16
  # success :	if login successful
17
  # failed :	if login failed
17
  # failed :	if login failed
18
  # logoff :	if logout successful
18
  # logoff :	if logout successful
Line 23... Line 23...
23
  # popup2 :	if requested a success pop up window
23
  # popup2 :	if requested a success pop up window
24
  # popup3 :	if requested a logout pop up window
24
  # popup3 :	if requested a logout pop up window
25
  # Default :	it was not a form request
25
  # Default :	it was not a form request
26
 
26
 
27
# Shared secret used to encrypt challenge with radius.
27
# Shared secret used to encrypt challenge with radius.
28
$uamsecret = "";
28
$uamsecret = "PJSafPdA";
29
 
29
 
30
# URL loaded after success authenticates (let blank for browser defaults)
30
# URL loaded after success authenticates (let blank for browser defaults)
31
$adminurl = "";
31
$adminurl = "";
32
 
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
33
# Our own path
38
$loginpath = $_SERVER['PHP_SELF'];
34
$loginpath = $_SERVER['PHP_SELF'];
39
 
35
 
40
# Choice of language
36
# Choice of language
41
$Language = 'fr';
37
$Language = 'fr';
Line 69... Line 65...
69
  $R_reply_1 = "Your daily connexion time has been reached";
65
  $R_reply_1 = "Your daily connexion time has been reached";
70
  $R_reply_2 = "Your monthly connexion time has been reached";
66
  $R_reply_2 = "Your monthly connexion time has been reached";
71
  $R_reply_3 = "You try to connect outside of your allowed timespan";
67
  $R_reply_3 = "You try to connect outside of your allowed timespan";
72
  $R_reply_4 = "your account expired";
68
  $R_reply_4 = "your account expired";
73
  $R_reply_5 = "You have reached the maximum number of simultaneous logins";
69
  $R_reply_5 = "You have reached the maximum number of simultaneous logins";
-
 
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>";
74
}
74
}
75
else if($Language == 'de'){
75
else if($Language == 'de'){
76
  $R_ChilliError	= "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
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!";
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";
78
  $R_logout			= "Beenden der Verbindung";
Line 99... Line 99...
99
  $R_reply_1 = "Your daily connexion time has been reached";
99
  $R_reply_1 = "Your daily connexion time has been reached";
100
  $R_reply_2 = "Your monthly 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";
101
  $R_reply_3 = "You try to connect outside of your allowed timespan";
102
  $R_reply_4 = "your account expired";
102
  $R_reply_4 = "your account expired";
103
  $R_reply_5 = "You have reached the maximum number of simultaneous logins";
103
  $R_reply_5 = "You have reached the maximum number of simultaneous logins";
-
 
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>";
104
}
108
}
105
else if($Language == 'nl'){
109
else if($Language == 'nl'){
106
  $R_ChilliError	= "De authenticatie moet een succes worden via de captive portal dienst.";
110
  $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!";
111
  $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";
112
  $R_logout			= "Slotkoers verbinding";
Line 129... Line 133...
129
  $R_reply_1 = "Your daily connexion time has been reached";
133
  $R_reply_1 = "Your daily connexion time has been reached";
130
  $R_reply_2 = "Your monthly connexion time has been reached";
134
  $R_reply_2 = "Your monthly connexion time has been reached";
131
  $R_reply_3 = "You try to connect outside of your allowed timespan";
135
  $R_reply_3 = "You try to connect outside of your allowed timespan";
132
  $R_reply_4 = "your account expired";
136
  $R_reply_4 = "your account expired";
133
  $R_reply_5 = "You have reached the maximum number of simultaneous logins";
137
  $R_reply_5 = "You have reached the maximum number of simultaneous logins";
-
 
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>";
134
}
142
}
135
else if($Language == 'en'){
143
else if($Language == 'en'){
136
  $R_ChilliError	= "The authentication must be successful through the captive portal service.";
144
  $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!";
145
  $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";
146
  $R_logout			= "Closing connection";
Line 159... Line 167...
159
  $R_reply_1 = "Your daily connexion time has been reached";
167
  $R_reply_1 = "Your daily connexion time has been reached";
160
  $R_reply_2 = "Your monthly connexion time has been reached";
168
  $R_reply_2 = "Your monthly connexion time has been reached";
161
  $R_reply_3 = "You try to connect outside of your allowed timespan";
169
  $R_reply_3 = "You try to connect outside of your allowed timespan";
162
  $R_reply_4 = "your account expired";
170
  $R_reply_4 = "your account expired";
163
  $R_reply_5 = "You have reached the maximum number of simultaneous logins";
171
  $R_reply_5 = "You have reached the maximum number of simultaneous logins";
-
 
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-";
164
}
176
}
165
else{
177
else{
166
  $R_ChilliError	= "L'authentification doit &ecirc;tre r&eacute;ussie au travers du service du portail captif.";
178
  $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 !";
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 !";
168
  $R_logout			= "Fermeture de la connexion";
180
  $R_logout			= "Fermeture de la connexion";
Line 189... Line 201...
189
  $R_reply_1 = "Votre dur&eacute;e de connexion journali&egrave;re a &eacute;t&eacute; atteinte";
201
  $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";
202
  $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";
203
  $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";
204
  $R_reply_4 = "Votre compte a expir&eacute";
193
  $R_reply_5 = "Vous avez atteint le nombre maximum de connexions simultanées";
205
  $R_reply_5 = "Vous avez atteint le nombre maximum de connexions simultanées";
-
 
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-";
194
}
210
}
195
 
211
 
196
# Make sure that the form parameters are clean
212
# Make sure that the form parameters are clean
197
#$OK_CHARS='-a-zA-Z0-9_.@&=%!';
213
#$OK_CHARS='-a-zA-Z0-9_.@&=%!';
198
#$_ = $input = <STDIN>;
214
#$_ = $input = <STDIN>;
Line 258... Line 274...
258
  }}
274
  }}
259
 
275
 
260
# If attempt to login
276
# If attempt to login
261
if ("$button" == "$R_boutonO") {
277
if ("$button" == "$R_boutonO") {
262
  $hexchal = pack ("H32", $challenge);
278
  $hexchal = pack ("H32", $challenge);
263
  if ($uamsecret) {
-
 
264
    $newchal = pack ("H*", md5($hexchal . $uamsecret));
279
  $newchal = pack ("H*", md5($hexchal . $uamsecret));
265
  } else {
-
 
266
    $newchal = $hexchal;
-
 
267
  }
-
 
268
  $response = md5("\0" . $password . $newchal);
280
  $response = md5("\0" . $password . $newchal);
269
  $newpwd = pack("a32", $password);
281
  $newpwd = pack("a32", $password);
270
  $pappassword = implode ("", unpack("H32", ($newpwd ^ $newchal)));
282
  $pappassword = implode ("", unpack("H32", ($newpwd ^ $newchal)));
271
  echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
283
  echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
272
<html>
284
<html>
273
<head>
285
<head>
274
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
286
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
275
  <title>$R_loggingin</title>
287
  <title>$R_loggingin</title>
276
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
288
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
277
  <meta http-equiv=\"Pragma\" content=\"no-cache\">";
289
  <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\">";
290
  <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>
291
  </head>
284
<body bgColor = 'white'>
292
<body bgColor = 'white'>
285
<h1 style=\"text-align: center;\">$R_loggingin</h1>
293
<h1 style=\"text-align: center;\">$R_loggingin</h1>
286
  <center>
294
  <center>
287
    $R_wait
295
    $R_wait
288
  </center>
296
  </center>
Line 479... Line 487...
479
      <td align=\"center\" colspan=\"4\"><font color=\"black\"><b>$R_loggedin_stringl1</b></font></td>
487
      <td align=\"center\" colspan=\"4\"><font color=\"black\"><b>$R_loggedin_stringl1</b></font></td>
480
    </tr><tr>
488
    </tr><tr>
481
      <td align=\"left\" colspan=\"4\"><b>
489
      <td align=\"left\" colspan=\"4\"><b>
482
      <li>
490
      <li>
483
$R_loggedin_stringl2</li>
491
$R_loggedin_stringl2</li>
484
	<li>
492
      <li>
485
$R_loggedin_stringl3</li>
493
$R_loggedin_stringl3</li>
486
	<li>
494
      <li>
487
$R_loggedin_stringl4</li>
495
$R_loggedin_stringl4</li>
488
	<li>
496
      <li>
489
$R_loggedin_stringl5</li>
497
$R_loggedin_stringl5</li>
-
 
498
      <hr>
-
 
499
$R_ca_1 <a href=\"/certs/certificat_alcasar_ca.pem\">$R_ca_2</a> $R_ca_3 <a href=\"/certs/certificat_alcasar_ca.pem\">$R_ca_4</a>
490
      </b></td>
500
      </b></td>
491
    </tr>
501
    </tr>
492
  </table>
502
  </table>
493
  </center>
503
  </center>
494
  </form>
504
  </form>