Line 1... |
Line 1... |
1 |
<?php
|
1 |
<?php
|
2 |
# $Id: intercept.php 2205 2017-05-06 14:07:27Z tom.houdayer $
|
2 |
# $Id: intercept.php 2238 2017-05-20 20:54:43Z tom.houdayer $
|
3 |
#
|
3 |
#
|
4 |
# intercept.php for ALCASAR captive portal
|
4 |
# intercept.php for ALCASAR captive portal
|
5 |
# Copyright (C) 2003, 2004 Mondru AB.
|
5 |
# Copyright (C) 2003, 2004 Mondru AB.
|
6 |
# Modify by REXY & steweb57
|
6 |
# Modify by REXY & steweb57
|
7 |
# UI & css style by stephane ERARD
|
7 |
# UI & css style by stephane ERARD
|
Line 22... |
Line 22... |
22 |
# Default : it was not a form request -> client go to login form
|
22 |
# Default : it was not a form request -> client go to login form
|
23 |
|
23 |
|
24 |
/****************************************************************
|
24 |
/****************************************************************
|
25 |
* GLOBAL FILE PATHS *
|
25 |
* GLOBAL FILE PATHS *
|
26 |
*****************************************************************/
|
26 |
*****************************************************************/
|
27 |
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
|
27 |
define('CONF_FILE', '/usr/local/etc/alcasar.conf');
|
28 |
define ("DOMAIN_ALLOWED_LIST", "/usr/local/etc/alcasar-uamdomain");
|
28 |
define('DOMAIN_ALLOWED_LIST', '/usr/local/etc/alcasar-uamdomain');
|
29 |
|
29 |
|
30 |
/****************************************************************
|
30 |
/****************************************************************
|
31 |
* FILE reading test *
|
31 |
* FILE reading test *
|
32 |
*****************************************************************/
|
32 |
*****************************************************************/
|
33 |
$conf_files = array(CONF_FILE,DOMAIN_ALLOWED_LIST);
|
33 |
$conf_files = array(CONF_FILE, DOMAIN_ALLOWED_LIST);
|
34 |
foreach ($conf_files as $file) {
|
34 |
foreach ($conf_files as $file) {
|
35 |
if (!file_exists($file)) {
|
35 |
if (!file_exists($file)) {
|
36 |
exit("Fichier ".$file." non présent");
|
36 |
exit("Fichier $file non présent");
|
37 |
}
|
37 |
}
|
38 |
if (!is_readable($file)) {
|
38 |
if (!is_readable($file)) {
|
39 |
exit("Vous n'avez pas les droits de lecture sur le fichier ".$file);
|
39 |
exit("Vous n'avez pas les droits de lecture sur le fichier $file");
|
40 |
}
|
40 |
}
|
41 |
}
|
41 |
}
|
42 |
/****************************************************************
|
42 |
/****************************************************************
|
43 |
* Read CONF_FILE *
|
43 |
* Read CONF_FILE *
|
44 |
*****************************************************************/
|
44 |
*****************************************************************/
|
45 |
$file_conf = fopen(CONF_FILE, 'r');
|
45 |
$file_conf = fopen(CONF_FILE, 'r');
|
46 |
if (!$file_conf) {
|
46 |
if (!$file_conf) {
|
47 |
exit('Error opening the file '.CONF_FILE);
|
47 |
exit('Error opening the file '.CONF_FILE);
|
48 |
}
|
48 |
}
|
49 |
while (!feof($file_conf)) {
|
49 |
while (!feof($file_conf)) {
|
50 |
$tampon = fgets($file_conf, 4096);
|
50 |
$buffer = fgets($file_conf, 4096);
|
51 |
if ((strpos($tampon, '=') !== false) && (substr($tampon, 0, 1) !== '#')) {
|
51 |
if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) {
|
52 |
$tmp = explode('=', $tampon);
|
52 |
$tmp = explode('=', $buffer);
|
53 |
$conf[$tmp[0]] = trim($tmp[1]);
|
53 |
$conf[$tmp[0]] = trim($tmp[1]);
|
54 |
}
|
54 |
}
|
55 |
}
|
55 |
}
|
56 |
fclose($file_conf);
|
56 |
fclose($file_conf);
|
57 |
|
57 |
|
58 |
$organisme = trim($conf["ORGANISM"]);
|
58 |
$organisme = $conf["ORGANISM"];
|
59 |
|
59 |
|
60 |
# Shared secret used to encrypt password with coova.
|
60 |
# Shared secret used to encrypt password with coova.
|
61 |
$uamsecret = "";
|
61 |
$uamsecret = "";
|
62 |
|
62 |
|
63 |
# URL loaded after success authenticates (let blank for browser defaults)
|
63 |
# URL loaded after success authenticates (let blank for browser defaults)
|
64 |
$adminurl = "";
|
64 |
$adminurl = "";
|
65 |
|
65 |
|
66 |
# Our own path
|
66 |
# Our own path
|
67 |
$loginpath = htmlspecialchars($_SERVER['PHP_SELF']);
|
67 |
$loginpath = htmlspecialchars($_SERVER['PHP_SELF']);
|
68 |
$alcasarpath = 'http://'.trim($conf['HOSTNAME']).'.'.trim($conf['DOMAIN']);
|
68 |
$alcasarpath = 'http://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'];
|
69 |
$statuspath = $alcasarpath.'/status.php';
|
69 |
$statuspath = $alcasarpath.'/status.php';
|
70 |
|
70 |
|
71 |
# Choice of language
|
71 |
# Choice of language
|
72 |
$Language = 'en';
|
72 |
$Language = 'en';
|
73 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
73 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
74 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
74 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
75 |
$Language = strtolower(substr(chop($Langue[0]),0,2));
|
75 |
$Language = strtolower(substr(chop($Langue[0]),0,2));
|
76 |
}
|
76 |
}
|
77 |
if ($Language === 'es') {
|
77 |
if ($Language === 'es') { // Spanish
|
78 |
$l_ChilliError = "La autenticación debe ser un éxito a través del servicio de portal cautivo.";
|
78 |
$l_ChilliError = "La autenticación debe ser un éxito a través del servicio de portal cautivo.";
|
79 |
$l_login = "El éxito de la autenticación.<HR>Cierre esta ventana interrumpte la sesion.";
|
79 |
$l_login = "El éxito de la autenticación.<HR>Cierre esta ventana interrumpte la sesion.";
|
80 |
$l_logout = "Conexión de cierre";
|
80 |
$l_logout = "Conexión de cierre";
|
81 |
$l_loginfailed = "Error de autenticación";
|
81 |
$l_loginfailed = "Error de autenticación";
|
82 |
$l_loggingin = "Identificación en el portal cautivo";
|
82 |
$l_loggingin = "Identificación en el portal cautivo";
|
Line 105... |
Line 105... |
105 |
$l_reply_6 = "Your authorized connexion time has been reached";
|
105 |
$l_reply_6 = "Your authorized connexion time has been reached";
|
106 |
$l_online_time = "Tiempo en linea";
|
106 |
$l_online_time = "Tiempo en linea";
|
107 |
$l_remaining_time = "Tiempo restante";
|
107 |
$l_remaining_time = "Tiempo restante";
|
108 |
$l_uam_domain = "Sitios web autorizados : ";
|
108 |
$l_uam_domain = "Sitios web autorizados : ";
|
109 |
$l_autoregistration = "Registo automático";
|
109 |
$l_autoregistration = "Registo automático";
|
110 |
} else if ($Language === 'pt') {
|
110 |
} else if ($Language === 'pt') { // Portuguese
|
111 |
$l_ChilliError = "A autenticação precisa ser bem sucedida através do portal.";
|
111 |
$l_ChilliError = "A autenticação precisa ser bem sucedida através do portal.";
|
112 |
$l_login = "Sucesso na autenticação.<HR>Matenha esse pop-up apenas minimizado para não interromper a conexão";
|
112 |
$l_login = "Sucesso na autenticação.<HR>Matenha esse pop-up apenas minimizado para não interromper a conexão";
|
113 |
$l_logout = "Encerrar conexão";
|
113 |
$l_logout = "Encerrar conexão";
|
114 |
$l_loginfailed = "Falha na autenticação";
|
114 |
$l_loginfailed = "Falha na autenticação";
|
115 |
$l_loggingin = "Identificação do portal cativo";
|
115 |
$l_loggingin = "Identificação do portal cativo";
|
Line 138... |
Line 138... |
138 |
$l_reply_6 = "Seu tempo de conexão autorizada finalizou";
|
138 |
$l_reply_6 = "Seu tempo de conexão autorizada finalizou";
|
139 |
$l_online_time = "Tempo Online";
|
139 |
$l_online_time = "Tempo Online";
|
140 |
$l_remaining_time = "Tempo restante";
|
140 |
$l_remaining_time = "Tempo restante";
|
141 |
$l_uam_domain = "Sites autorizados : ";
|
141 |
$l_uam_domain = "Sites autorizados : ";
|
142 |
$l_autoregistration = "Registo automático";
|
142 |
$l_autoregistration = "Registo automático";
|
143 |
} else if ($Language === 'zh') {
|
143 |
} else if ($Language === 'zh') { // Chinese
|
144 |
$l_ChilliError = "验证必须通过强制门户服务";
|
144 |
$l_ChilliError = "验证必须通过强制门户服务";
|
145 |
$l_login = "验证成功<HR>关闭此窗口中断连接";
|
145 |
$l_login = "验证成功<HR>关闭此窗口中断连接";
|
146 |
$l_logout = "关闭连接";
|
146 |
$l_logout = "关闭连接";
|
147 |
$l_loginfailed = "验证失败";
|
147 |
$l_loginfailed = "验证失败";
|
148 |
$l_loggingin = "强制门户身份识别";
|
148 |
$l_loggingin = "强制门户身份识别";
|
Line 171... |
Line 171... |
171 |
$l_reply_6 = "已经到达您的允许连接时间";
|
171 |
$l_reply_6 = "已经到达您的允许连接时间";
|
172 |
$l_online_time = "在线时间";
|
172 |
$l_online_time = "在线时间";
|
173 |
$l_remaining_time = "剩余时间";
|
173 |
$l_remaining_time = "剩余时间";
|
174 |
$l_uam_domain = "授权网站 : ";
|
174 |
$l_uam_domain = "授权网站 : ";
|
175 |
$l_autoregistration = "短信注册";
|
175 |
$l_autoregistration = "短信注册";
|
176 |
} else if($Language === 'ar') {
|
176 |
} else if($Language === 'ar') { // Arabic
|
177 |
$l_ChilliError = "يجب نجاح المصادقة على البوابة الأسيرة";
|
177 |
$l_ChilliError = "يجب نجاح المصادقة على البوابة الأسيرة";
|
178 |
$l_login = "إغلاق هذه النافذة يقطع دورة عملك";
|
178 |
$l_login = "إغلاق هذه النافذة يقطع دورة عملك";
|
179 |
$l_logout = "إغلاق الدورة";
|
179 |
$l_logout = "إغلاق الدورة";
|
180 |
$l_loginfailed = "فشل المصادقة";
|
180 |
$l_loginfailed = "فشل المصادقة";
|
181 |
$l_loggingin = "التعريف على البوابة الأسيرة";
|
181 |
$l_loggingin = "التعريف على البوابة الأسيرة";
|
Line 204... |
Line 204... |
204 |
$l_reply_6 = "استكملت مذة الإتصال المسموحة";
|
204 |
$l_reply_6 = "استكملت مذة الإتصال المسموحة";
|
205 |
$l_online_time = "مذة الإتصال";
|
205 |
$l_online_time = "مذة الإتصال";
|
206 |
$l_remaining_time = "الوقت المتبق";
|
206 |
$l_remaining_time = "الوقت المتبق";
|
207 |
$l_uam_domain = ":المواقع المسموحة ";
|
207 |
$l_uam_domain = ":المواقع المسموحة ";
|
208 |
$l_autoregistration = "تسجيل ذاتي (SMS)";
|
208 |
$l_autoregistration = "تسجيل ذاتي (SMS)";
|
209 |
} else if($Language === 'de') {
|
209 |
} else if($Language === 'de') { // German
|
210 |
$l_ChilliError = "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
|
210 |
$l_ChilliError = "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
|
211 |
$l_login = "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung";
|
211 |
$l_login = "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung";
|
212 |
$l_logout = "Beenden der Verbindung";
|
212 |
$l_logout = "Beenden der Verbindung";
|
213 |
$l_loginfailed = "Authentifizierungsfehler Eigenverbrauch";
|
213 |
$l_loginfailed = "Authentifizierungsfehler Eigenverbrauch";
|
214 |
$l_loggingin = "Kennzeichnung auf dem Eigenverbrauch";
|
214 |
$l_loggingin = "Kennzeichnung auf dem Eigenverbrauch";
|
Line 237... |
Line 237... |
237 |
$l_reply_6 = "Your authorized connexion time has been reached";
|
237 |
$l_reply_6 = "Your authorized connexion time has been reached";
|
238 |
$l_online_time = "Online-zeit";
|
238 |
$l_online_time = "Online-zeit";
|
239 |
$l_remaining_time = "Restzeit";
|
239 |
$l_remaining_time = "Restzeit";
|
240 |
$l_uam_domain = "Autorisierten websites : ";
|
240 |
$l_uam_domain = "Autorisierten websites : ";
|
241 |
$l_autoregistration = "Automatische registrierung";
|
241 |
$l_autoregistration = "Automatische registrierung";
|
242 |
} else if($Language === 'nl') {
|
242 |
} else if($Language === 'nl') { // Dutch
|
243 |
$l_ChilliError = "De authenticatie moet een succes worden via de captive portal dienst.";
|
243 |
$l_ChilliError = "De authenticatie moet een succes worden via de captive portal dienst.";
|
244 |
$l_login = "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie.";
|
244 |
$l_login = "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie.";
|
245 |
$l_logout = "Slotkoers verbinding";
|
245 |
$l_logout = "Slotkoers verbinding";
|
246 |
$l_loginfailed = "Authenticatie mislukt";
|
246 |
$l_loginfailed = "Authenticatie mislukt";
|
247 |
$l_loggingin = "Identificatie van de captive-portaal";
|
247 |
$l_loggingin = "Identificatie van de captive-portaal";
|
Line 270... |
Line 270... |
270 |
$l_reply_6 = "Your authorized connexion time has been reached";
|
270 |
$l_reply_6 = "Your authorized connexion time has been reached";
|
271 |
$l_online_time = "Online tijd";
|
271 |
$l_online_time = "Online tijd";
|
272 |
$l_remaining_time = "Reterende tijd";
|
272 |
$l_remaining_time = "Reterende tijd";
|
273 |
$l_uam_domain = "Geautoriseerde website : ";
|
273 |
$l_uam_domain = "Geautoriseerde website : ";
|
274 |
$l_autoregistration = "Automatische registratie";
|
274 |
$l_autoregistration = "Automatische registratie";
|
275 |
} else if($Language === 'fr') {
|
275 |
} else if($Language === 'fr') { // French
|
276 |
$l_ChilliError = "L'authentification doit être réussie sur le portail captif.";
|
276 |
$l_ChilliError = "L'authentification doit être réussie sur le portail captif.";
|
277 |
$l_login = "Authentification réussie.<HR>La fermeture de cette fenêtre interrompt votre session.";
|
277 |
$l_login = "Authentification réussie.<HR>La fermeture de cette fenêtre interrompt votre session.";
|
278 |
$l_logout = "Fermeture de la session";
|
278 |
$l_logout = "Fermeture de la session";
|
279 |
$l_loginfailed = "Echec d'authentification";
|
279 |
$l_loginfailed = "Echec d'authentification";
|
280 |
$l_loggingin = "Identification sur le portail captif";
|
280 |
$l_loggingin = "Identification sur le portail captif";
|
Line 303... |
Line 303... |
303 |
$l_reply_6 = "Votre durée de connexion autorisée a été atteinte";
|
303 |
$l_reply_6 = "Votre durée de connexion autorisée a été atteinte";
|
304 |
$l_online_time = "Temps de connexion";
|
304 |
$l_online_time = "Temps de connexion";
|
305 |
$l_remaining_time = "Temps restant";
|
305 |
$l_remaining_time = "Temps restant";
|
306 |
$l_uam_domain = "Sites autorisés : ";
|
306 |
$l_uam_domain = "Sites autorisés : ";
|
307 |
$l_autoregistration = "Auto enregistrement (sms)";
|
307 |
$l_autoregistration = "Auto enregistrement (sms)";
|
308 |
} else {
|
308 |
} else { // English
|
309 |
$l_ChilliError = "The authentication must be successful through the captive portal service.";
|
309 |
$l_ChilliError = "The authentication must be successful through the captive portal service.";
|
310 |
$l_login = "Successful authentication.<HR>Closing this window interrupts your session";
|
310 |
$l_login = "Successful authentication.<HR>Closing this window interrupts your session";
|
311 |
$l_logout = "Closing connection";
|
311 |
$l_logout = "Closing connection";
|
312 |
$l_loginfailed = "Authentication Failed";
|
312 |
$l_loginfailed = "Authentication Failed";
|
313 |
$l_loggingin = "Identification on the captive portal";
|
313 |
$l_loggingin = "Identification on the captive portal";
|
Line 340... |
Line 340... |
340 |
$l_autoregistration = "Auto registration (sms)";
|
340 |
$l_autoregistration = "Auto registration (sms)";
|
341 |
}
|
341 |
}
|
342 |
|
342 |
|
343 |
# If https not use, tell it's wrong
|
343 |
# If https not use, tell it's wrong
|
344 |
if ((!isset($_SERVER['HTTPS'])) || (empty($_SERVER['HTTPS'])) || ($_SERVER['HTTPS'] === 'off')) {
|
344 |
if ((!isset($_SERVER['HTTPS'])) || (empty($_SERVER['HTTPS'])) || ($_SERVER['HTTPS'] === 'off')) {
|
- |
|
345 |
// Cleaning the cache
|
- |
|
346 |
header('Expires: Tue, 01 Jan 2000 00:00:00 GMT');
|
- |
|
347 |
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
- |
|
348 |
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
|
- |
|
349 |
header('Cache-Control: post-check=0, pre-check=0', false);
|
- |
|
350 |
header('Pragma: no-cache');
|
345 |
?>
|
351 |
?>
|
346 |
<!doctype html>
|
352 |
<!DOCTYPE html>
|
347 |
<html>
|
353 |
<html>
|
348 |
<head>
|
354 |
<head>
|
349 |
<meta charset="utf-8">
|
355 |
<meta charset="utf-8">
|
350 |
<title><?= $l_loggedcont ?></title>
|
356 |
<title><?= $l_loggedcont ?></title>
|
351 |
<meta http-equiv="Cache-control" content="no-cache">
|
- |
|
352 |
<meta http-equiv="Pragma" content="no-cache">
|
- |
|
353 |
</head>
|
357 |
</head>
|
354 |
<body style="background-color: white;">
|
358 |
<body style="background-color: white;">
|
355 |
<h1 style="text-align: center;"><?= $l_loginfailed ?></h1>
|
359 |
<h1 style="text-align: center;"><?= $l_loginfailed ?></h1>
|
356 |
<center><?= $l_encrypted ?></center>
|
360 |
<center><?= $l_encrypted ?></center>
|
357 |
</body>
|
361 |
</body>
|
Line 411... |
Line 415... |
411 |
}
|
415 |
}
|
412 |
|
416 |
|
413 |
$newpwd = pack('a*', $password);
|
417 |
$newpwd = pack('a*', $password);
|
414 |
// Encode plain text password with challenge
|
418 |
// Encode plain text password with challenge
|
415 |
$pappassword = implode('', unpack('H*', ($newpwd ^ $newchal)));
|
419 |
$pappassword = implode('', unpack('H*', ($newpwd ^ $newchal)));
|
- |
|
420 |
|
- |
|
421 |
|
- |
|
422 |
// Cleaning the cache
|
- |
|
423 |
header('Expires: Tue, 01 Jan 2000 00:00:00 GMT');
|
- |
|
424 |
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
- |
|
425 |
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
|
- |
|
426 |
header('Cache-Control: post-check=0, pre-check=0', false);
|
- |
|
427 |
header('Pragma: no-cache');
|
- |
|
428 |
|
- |
|
429 |
header('Location: http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl');
|
416 |
?>
|
430 |
?>
|
417 |
<!doctype html>
|
431 |
<!DOCTYPE html>
|
418 |
<html>
|
432 |
<html>
|
419 |
<head>
|
433 |
<head>
|
420 |
<meta charset="utf-8">
|
434 |
<meta charset="utf-8">
|
421 |
<title><?= $l_loggingin ?></title>
|
435 |
<title><?= $l_loggingin ?></title>
|
422 |
<meta http-equiv="Cache-control" content="no-cache">
|
- |
|
423 |
<meta http-equiv="Pragma" content="no-cache">
|
- |
|
424 |
<meta http-equiv="refresh" content="0;url=<?= "http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl" ?>">
|
436 |
<meta http-equiv="refresh" content="0;url=<?= "http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl" ?>">
|
425 |
</head>
|
437 |
</head>
|
426 |
<body style="background-color: white;">
|
438 |
<body style="background-color: white;">
|
427 |
<h1 style="text-align: center;"><?= $l_loggingin ?></h1>
|
439 |
<h1 style="text-align: center;"><?= $l_loggingin ?></h1>
|
428 |
<center><?= $l_wait ?></center>
|
440 |
<center><?= $l_wait ?></center>
|
Line 456... |
Line 468... |
456 |
$filter_id = $row['value']; // on obtient le Filter-Id de l'utilisateur
|
468 |
$filter_id = $row['value']; // on obtient le Filter-Id de l'utilisateur
|
457 |
if($filter_id[3] === '1') {
|
469 |
if($filter_id[3] === '1') {
|
458 |
//set the fourth bit of filter-id to '0'
|
470 |
//set the fourth bit of filter-id to '0'
|
459 |
$sql = "set @CurrentFilter=(SELECT value from radreply where username='$user_uid');set @CurrentFilterLeft=(SELECT LEFT(@CurrentFilter,3));set @CurrentFilterRight=(SELECT RIGHT(@CurrentFilter,4));UPDATE radreply SET value = CONCAT((@CurrentFilterLeft),'0', (@CurrentFilterRight)) WHERE username='$user_uid'";
|
471 |
$sql = "set @CurrentFilter=(SELECT value from radreply where username='$user_uid');set @CurrentFilterLeft=(SELECT LEFT(@CurrentFilter,3));set @CurrentFilterRight=(SELECT RIGHT(@CurrentFilter,4));UPDATE radreply SET value = CONCAT((@CurrentFilterLeft),'0', (@CurrentFilterRight)) WHERE username='$user_uid'";
|
460 |
$res = mysqli_multi_query($link,$sql);
|
472 |
$res = mysqli_multi_query($link,$sql);
|
461 |
header('Location: https://'.trim($conf['HOSTNAME']).'.'.trim($conf['DOMAIN']).'/index.php?warn=1&url='.urlencode($_GET['userurl'])); //we present to user information about imputability logs
|
473 |
header('Location: https://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/index.php?warn=1&url='.urlencode($_GET['userurl'])); //we present to user information about imputability logs
|
462 |
exit();
|
474 |
exit();
|
463 |
}
|
475 |
}
|
464 |
}
|
476 |
}
|
465 |
}
|
477 |
}
|
466 |
}
|
478 |
}
|
Line 468... |
Line 480... |
468 |
|
480 |
|
469 |
|
481 |
|
470 |
// Otherwise it was not a form request
|
482 |
// Otherwise it was not a form request
|
471 |
// Send out an error message
|
483 |
// Send out an error message
|
472 |
if ($result === 0) { //erreur
|
484 |
if ($result === 0) { //erreur
|
- |
|
485 |
// Cleaning the cache
|
- |
|
486 |
header('Expires: Tue, 01 Jan 2000 00:00:00 GMT');
|
- |
|
487 |
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
- |
|
488 |
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
|
- |
|
489 |
header('Cache-Control: post-check=0, pre-check=0', false);
|
- |
|
490 |
header('Pragma: no-cache');
|
- |
|
491 |
|
- |
|
492 |
header('Location: http://$uamip:$uamport/prelogin');
|
473 |
?>
|
493 |
?>
|
474 |
<!doctype html>
|
494 |
<!DOCTYPE html>
|
475 |
<html>
|
495 |
<html>
|
476 |
<head>
|
496 |
<head>
|
477 |
<meta charset="utf-8">
|
497 |
<meta charset="utf-8">
|
478 |
<title><?= $l_loggingin ?></title>
|
498 |
<title><?= $l_loggingin ?></title>
|
479 |
<meta http-equiv="Cache-control" content="no-cache">
|
- |
|
480 |
<meta http-equiv="Pragma" content="no-cache">
|
- |
|
481 |
<meta http-equiv="refresh" content="0;url=<?= "http://$uamip:$uamport/prelogin" ?>">
|
499 |
<meta http-equiv="refresh" content="0;url=<?= "http://$uamip:$uamport/prelogin" ?>">
|
482 |
</head>
|
500 |
</head>
|
483 |
<body style="background-color: white;">
|
501 |
<body style="background-color: white;">
|
484 |
<h1 style="text-align: center;"><?= $l_loggingin ?></h1>
|
502 |
<h1 style="text-align: center;"><?= $l_loggingin ?></h1>
|
485 |
<center><?= $l_wait ?></center>
|
503 |
<center><?= $l_wait ?></center>
|
486 |
</body>
|
504 |
</body>
|
487 |
</html>
|
505 |
</html>
|
488 |
<?php
|
506 |
<?php
|
489 |
exit();
|
507 |
exit();
|
490 |
}
|
508 |
}
|
- |
|
509 |
|
- |
|
510 |
// Cleaning the cache
|
- |
|
511 |
header('Expires: Tue, 01 Jan 2000 00:00:00 GMT');
|
- |
|
512 |
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
- |
|
513 |
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
|
- |
|
514 |
header('Cache-Control: post-check=0, pre-check=0', false);
|
- |
|
515 |
header('Pragma: no-cache');
|
491 |
?>
|
516 |
?>
|
492 |
<!doctype html>
|
517 |
<!DOCTYPE html>
|
493 |
<html>
|
518 |
<html>
|
494 |
<head>
|
519 |
<head>
|
495 |
<meta charset="utf-8">
|
520 |
<meta charset="utf-8">
|
496 |
<title><?= $l_loggingin ?></title>
|
521 |
<title><?= $l_loggingin ?></title>
|
497 |
<meta http-equiv="Cache-control" content="no-cache">
|
- |
|
498 |
<meta http-equiv="Pragma" content="no-cache">
|
- |
|
499 |
<script type="text/javascript">
|
522 |
<script type="text/javascript">
|
500 |
function doOnLoad(result, userurl, redirurl, adminurl, timeleft) {
|
523 |
function doOnLoad(result, userurl, redirurl, adminurl, timeleft) {
|
501 |
if ((result === 1) || (result === 4)) { //success or already
|
524 |
if ((result === 1) || (result === 4)) { //success or already
|
502 |
var url;
|
525 |
var url;
|
503 |
if (adminurl !== '') {
|
526 |
if (adminurl !== '') {
|
Line 587... |
Line 610... |
587 |
$tab = file(DOMAIN_ALLOWED_LIST);
|
610 |
$tab = file(DOMAIN_ALLOWED_LIST);
|
588 |
if ($tab) { // the file isn't empty
|
611 |
if ($tab) { // the file isn't empty
|
589 |
echo '<div id="authorized_domain">'.$l_uam_domain;
|
612 |
echo '<div id="authorized_domain">'.$l_uam_domain;
|
590 |
foreach ($tab as $line) {
|
613 |
foreach ($tab as $line) {
|
591 |
if (trim($line) !== '') { // the line isn't empty
|
614 |
if (trim($line) !== '') { // the line isn't empty
|
592 |
$domain_allowed = explode("#", $line);
|
615 |
$domain_allowed = explode('#', $line);
|
593 |
if (trim($domain_allowed[1]) !== '') {
|
616 |
if (trim($domain_allowed[1]) !== '') {
|
594 |
$domain = explode('"', $domain_allowed[0]);
|
617 |
$domain = explode('"', $domain_allowed[0]);
|
595 |
// remove every '.' from the beginning of domain
|
618 |
// remove every '.' from the beginning of domain
|
596 |
$domain[1] = ltrim($domain[1], '.');
|
619 |
$domain[1] = ltrim($domain[1], '.');
|
597 |
echo '<a href="http://'.trim($domain[1]).'">'.trim($domain_allowed[1]).'</a> ';
|
620 |
echo '<a href="http://'.trim($domain[1]).'">'.trim($domain_allowed[1]).'</a> ';
|