Subversion Repositories ALCASAR

Rev

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

Rev 3139 Rev 3165
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: intercept.php 3139 2023-07-02 14:22:12Z rexy $
2
# $Id: intercept.php 3165 2024-01-10 10:34:50Z rexy $
3
#
3
#
4
# intercept.php for ALCASAR captive portal
4
# intercept.php for ALCASAR captive portal
5
# By Mondru AB.
-
 
6
# Modify by Rexy & steweb57
5
# by Rexy & steweb57
7
# UI & css style by Stéphane ERARD & Alexandre VEZIN
6
# UI & css style by Stéphane ERARD & Alexandre VEZIN
8
# Help for language translation by B. AUBARD (thanks)
7
# Help for language translation by B. AUBARD (thanks)
9
 
8
 
10
# The contents of this file may be used under the terms of the GNU
-
 
11
# General Public License Version 2, provided that the above copyright
-
 
12
# notice and this permission notice is included in all copies or
-
 
13
# substantial portions of the software.
-
 
14
 
-
 
15
# Redirects from CoovaChilli (chilli daemon) :
9
# Redirects from CoovaChilli (chilli daemon) :
16
# Response to login:
10
# Response to login:
17
  # success :	if login successful
11
  # success :	if login successful
18
  # failed :	if login failed
12
  # failed :	if login failed
19
  # logoff :	if logout successful
13
  # logoff :	if logout successful
Line 72... Line 66...
72
$loginpath = htmlspecialchars($_SERVER['PHP_SELF']);
66
$loginpath = htmlspecialchars($_SERVER['PHP_SELF']);
73
$useHTTPS = ((isset($_SERVER['HTTPS'])) && (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] !== 'off'));
67
$useHTTPS = ((isset($_SERVER['HTTPS'])) && (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] !== 'off'));
74
$alcasarpath = (($useHTTPS) ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'];
68
$alcasarpath = (($useHTTPS) ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'];
75
$statuspath = (($conf['HTTPS_CHILLI'] === 'on') ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/status.php';
69
$statuspath = (($conf['HTTPS_CHILLI'] === 'on') ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/status.php';
76
 
70
 
-
 
71
# Redirection if HTTPS needed and not used
-
 
72
if (($conf['HTTPS_LOGIN'] === 'on') && (!$useHTTPS)) {
-
 
73
	header('HTTP/1.1 301 Moved Permanently');
-
 
74
	header('Location: https://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/intercept.php');
-
 
75
	exit();
-
 
76
}
-
 
77
 
77
// Choice of language
78
// Choice of language
78
$Language = 'en';
79
$Language = 'en';
79
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
80
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
80
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
81
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
81
	$Language = strtolower(substr(chop($Langue[0]), 0, 2));
82
	$Language = strtolower(substr(chop($Langue[0]), 0, 2));
Line 92... Line 93...
92
	$l_password			= "Contraseña";
93
	$l_password			= "Contraseña";
93
	$l_mandatory			= "* Campos requeridos";
94
	$l_mandatory			= "* Campos requeridos";
94
	$l_wait				= "Por favor, espere un momento ...";
95
	$l_wait				= "Por favor, espere un momento ...";
95
	$l_onlinetime			= "Tiempo de conexión:";
96
	$l_onlinetime			= "Tiempo de conexión:";
96
	$l_remainingtime		= "Desconexión en:";
97
	$l_remainingtime		= "Desconexión en:";
97
	$l_encrypted			= "La conexión con el portal apertura debe ser cifrada (https)";
-
 
98
	$l_boutonO			= "Autenticación";
98
	$l_boutonO			= "Autenticación";
99
	$l_boutonF			= "Cerrar";
99
	$l_boutonF			= "Cerrar";
100
	$l_loggedin_stringl1		= "Información del Sistema de Seguridad";
100
	$l_loggedin_stringl1		= "Información del Sistema de Seguridad";
101
	$l_loggedin_stringl2		= "El portal fue creado para garantizar la trazabilidad, la rendición de cuentas y el no repudio de las conexiones.";
101
	$l_loggedin_stringl2		= "El portal fue creado para garantizar la trazabilidad, la rendición de cuentas y el no repudio de las conexiones.";
102
	$l_loggedin_stringl3		= "Su actividad en la red es registrada, de conformidad con criterios de privacidad.";
102
	$l_loggedin_stringl3		= "Su actividad en la red es registrada, de conformidad con criterios de privacidad.";
Line 128... Line 128...
128
	$l_password			= "Senha";
128
	$l_password			= "Senha";
129
	$l_mandatory			= "* Campos obrigatórios";
129
	$l_mandatory			= "* Campos obrigatórios";
130
	$l_wait				= "Por favor, aguarde um momento ...";
130
	$l_wait				= "Por favor, aguarde um momento ...";
131
	$l_onlinetime			= "Tempo de conexão:";
131
	$l_onlinetime			= "Tempo de conexão:";
132
	$l_remainingtime		= "Desconectado em:";
132
	$l_remainingtime		= "Desconectado em:";
133
	$l_encrypted			= "A conexão com o portal deve ser criptografada (https)";
-
 
134
	$l_boutonO			= "Autenticação";
133
	$l_boutonO			= "Autenticação";
135
	$l_boutonF			= "Fechar";
134
	$l_boutonF			= "Fechar";
136
	$l_loggedin_stringl1		= "Sistema de Informação e segurança";
135
	$l_loggedin_stringl1		= "Sistema de Informação e segurança";
137
	$l_loggedin_stringl2		= "Este controle foi criado para garantir acesso seguro.";
136
	$l_loggedin_stringl2		= "Este controle foi criado para garantir acesso seguro.";
138
	$l_loggedin_stringl3		= "A autenticação será criptografada em 256 bits, impedindo captura por escâner de rede.";
137
	$l_loggedin_stringl3		= "A autenticação será criptografada em 256 bits, impedindo captura por escâner de rede.";
Line 164... Line 163...
164
	$l_password			= "密码";
163
	$l_password			= "密码";
165
	$l_mandatory			= "* 必须填写";
164
	$l_mandatory			= "* 必须填写";
166
	$l_wait				= "请等待 ...";
165
	$l_wait				= "请等待 ...";
167
	$l_onlinetime			= "连接时间";
166
	$l_onlinetime			= "连接时间";
168
	$l_remainingtime		= "断开连接于";
167
	$l_remainingtime		= "断开连接于";
169
	$l_encrypted			= "与门户的连接必须加密 (https)";
-
 
170
	$l_boutonO			= "验证";
168
	$l_boutonO			= "验证";
171
	$l_boutonF			= "关闭";
169
	$l_boutonF			= "关闭";
172
	$l_loggedin_stringl1		= "信息系统安全";
170
	$l_loggedin_stringl1		= "信息系统安全";
173
	$l_loggedin_stringl2		= "这种控制实施以法定保证可追溯性,可归罪性和连接的不否认性.";
171
	$l_loggedin_stringl2		= "这种控制实施以法定保证可追溯性,可归罪性和连接的不否认性.";
174
	$l_loggedin_stringl3		= "您的网络活动是私密登记的.";
172
	$l_loggedin_stringl3		= "您的网络活动是私密登记的.";
Line 200... Line 198...
200
	$l_password			= "كلمة السر";
198
	$l_password			= "كلمة السر";
201
	$l_mandatory			="* الحقول المطلوبة";
199
	$l_mandatory			="* الحقول المطلوبة";
202
	$l_wait				= "...إنتظر بعض اللحظات";
200
	$l_wait				= "...إنتظر بعض اللحظات";
203
	$l_onlinetime			= ":مدة الإتصال";
201
	$l_onlinetime			= ":مدة الإتصال";
204
	$l_remainingtime		= ":انقطاع الإتصال في";
202
	$l_remainingtime		= ":انقطاع الإتصال في";
205
	$l_encrypted			= "يجب تشفير الإتصال بالبوابة (https)";
-
 
206
	$l_boutonO			= "مصادقة";
203
	$l_boutonO			= "مصادقة";
207
	$l_boutonF			= "أغلق";
204
	$l_boutonF			= "أغلق";
208
	$l_loggedin_stringl1		= "سلامة نظم المعلومات";
205
	$l_loggedin_stringl1		= "سلامة نظم المعلومات";
209
	$l_loggedin_stringl2		= "وُضعت هذه المراقبة للضمان القانوني لتتبع ومساءلة وعدم تنصل الإتصالات";
206
	$l_loggedin_stringl2		= "وُضعت هذه المراقبة للضمان القانوني لتتبع ومساءلة وعدم تنصل الإتصالات";
210
	$l_loggedin_stringl3		= "نشاطك على الشبكة مسجل وفقاً لاحترام الحريات الشخصية";
207
	$l_loggedin_stringl3		= "نشاطك على الشبكة مسجل وفقاً لاحترام الحريات الشخصية";
Line 236... Line 233...
236
	$l_password			= "Passwort";
233
	$l_password			= "Passwort";
237
	$l_mandatory			= "* Benötigte Felder";
234
	$l_mandatory			= "* Benötigte Felder";
238
	$l_wait				= "Bitte warten Sie einen Moment ...";
235
	$l_wait				= "Bitte warten Sie einen Moment ...";
239
	$l_onlinetime			= "Online-Zeit:";
236
	$l_onlinetime			= "Online-Zeit:";
240
	$l_remainingtime		= "Abmelden:";
237
	$l_remainingtime		= "Abmelden:";
241
	$l_encrypted			= "Die Verbindung muss verschlüsselt sein (https)";
-
 
242
	$l_boutonO			= "Authentifizierung";
238
	$l_boutonO			= "Authentifizierung";
243
	$l_boutonF			= "Schließen";
239
	$l_boutonF			= "Schließen";
244
	$l_loggedin_stringl1		= "Information System Security";
240
	$l_loggedin_stringl1		= "Information System Security";
245
	$l_loggedin_stringl2		= "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, die Zurechenbarkeit und die Nicht-Abstreitbarkeit der Verbindungen zu sichern.";
241
	$l_loggedin_stringl2		= "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, die Zurechenbarkeit und die Nicht-Abstreitbarkeit der Verbindungen zu sichern.";
246
	$l_loggedin_stringl3		= "Ihre Tätigkeiten im Netzwerk werden im Hinblick auf den Schutz Ihrer Privatsphäre gespeichert.";
242
	$l_loggedin_stringl3		= "Ihre Tätigkeiten im Netzwerk werden im Hinblick auf den Schutz Ihrer Privatsphäre gespeichert.";
Line 272... Line 268...
272
	$l_password			= "Wachtwoord";
268
	$l_password			= "Wachtwoord";
273
	$l_mandatory			= "* Verplichte velden";
269
	$l_mandatory			= "* Verplichte velden";
274
	$l_wait				= "Wacht een moment ...";
270
	$l_wait				= "Wacht een moment ...";
275
	$l_onlinetime			= "Sluit tijd:";
271
	$l_onlinetime			= "Sluit tijd:";
276
	$l_remainingtime		= "Verbreking in:";
272
	$l_remainingtime		= "Verbreking in:";
277
	$l_encrypted			= "De opening moet gebruiken gecodeerde verbinding (https)";
-
 
278
	$l_boutonO			= "Authenticatie";
273
	$l_boutonO			= "Authenticatie";
279
	$l_boutonF			= "Sluiten";
274
	$l_boutonF			= "Sluiten";
280
	$l_loggedin_stringl1		= "Information System Security";
275
	$l_loggedin_stringl1		= "Information System Security";
281
	$l_loggedin_stringl2		= "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
276
	$l_loggedin_stringl2		= "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
282
	$l_loggedin_stringl3		= "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
277
	$l_loggedin_stringl3		= "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
Line 308... Line 303...
308
	$l_password			= "Mot de passe";
303
	$l_password			= "Mot de passe";
309
	$l_mandatory			= "* champs requis";
304
	$l_mandatory			= "* champs requis";
310
	$l_wait				= "Patientez un instant ...";
305
	$l_wait				= "Patientez un instant ...";
311
	$l_onlinetime			= "Temps de connexion:";
306
	$l_onlinetime			= "Temps de connexion:";
312
	$l_remainingtime		= "Deconnexion dans :";
307
	$l_remainingtime		= "Deconnexion dans :";
313
	$l_encrypted			= "La connexion avec le portail doit être chiffrée (https)";
-
 
314
	$l_boutonO			= "Authentification";
308
	$l_boutonO			= "Authentification";
315
	$l_boutonF			= "Fermer";
309
	$l_boutonF			= "Fermer";
316
	$l_loggedin_stringl1		= "Sécurité des Systèmes d'Information";
310
	$l_loggedin_stringl1		= "Sécurité des Systèmes d'Information";
317
	$l_loggedin_stringl2		= "Ce contrôle a été mis en place pour assurer réglementairement la traçabilité, l'imputabilité et la non-répudiation des connexions.";
311
	$l_loggedin_stringl2		= "Ce contrôle a été mis en place pour assurer réglementairement la traçabilité, l'imputabilité et la non-répudiation des connexions.";
318
	$l_loggedin_stringl3		= "Votre activité sur le réseau est enregistrée conformément au respect de la vie privée.";
312
	$l_loggedin_stringl3		= "Votre activité sur le réseau est enregistrée conformément au respect de la vie privée.";
Line 344... Line 338...
344
	$l_password			= "Password";
338
	$l_password			= "Password";
345
	$l_mandatory			= "* field required";
339
	$l_mandatory			= "* field required";
346
	$l_wait				= "Please wait a moment ...";
340
	$l_wait				= "Please wait a moment ...";
347
	$l_onlinetime			= "Connect time:";
341
	$l_onlinetime			= "Connect time:";
348
	$l_remainingtime		= "Disconnection in:";
342
	$l_remainingtime		= "Disconnection in:";
349
	$l_encrypted			= "The connection with the portal must be encrypted (https)";
-
 
350
	$l_boutonO			= "Authentication";
343
	$l_boutonO			= "Authentication";
351
	$l_boutonF			= "Close";
344
	$l_boutonF			= "Close";
352
	$l_loggedin_stringl1		= "Information System Security";
345
	$l_loggedin_stringl1		= "Information System Security";
353
	$l_loggedin_stringl2		= "That control was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
346
	$l_loggedin_stringl2		= "That control was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
354
	$l_loggedin_stringl3		= "Your activity on the network is registered in accordance with privacy.";
347
	$l_loggedin_stringl3		= "Your activity on the network is registered in accordance with privacy.";
Line 368... Line 361...
368
	$l_uam_domain			= "Open access websites : ";
361
	$l_uam_domain			= "Open access websites : ";
369
	$l_sms_registration		= "Register by SMS";
362
	$l_sms_registration		= "Register by SMS";
370
	$l_email_registration		= "Register by E-mail";
363
	$l_email_registration		= "Register by E-mail";
371
}
364
}
372
 
365
 
373
# If HTTPS not use, tell it's wrong
-
 
374
if (($conf['HTTPS_LOGIN'] === 'on') && ((!isset($_SERVER['HTTPS'])) || (empty($_SERVER['HTTPS'])) || ($_SERVER['HTTPS'] === 'off'))) {
-
 
375
	// Cleaning the cache
-
 
376
	header('Expires: Tue, 01 Jan 2000 00:00:00 GMT');
-
 
377
	header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
-
 
378
	header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
-
 
379
	header('Cache-Control: post-check=0, pre-check=0', false);
-
 
380
	header('Pragma: no-cache');
-
 
381
	?>
-
 
382
	<!DOCTYPE html>
-
 
383
	<html>
-
 
384
	<head>
-
 
385
		<meta charset="utf-8">
-
 
386
		<title><?= $l_loggedcont ?></title>
-
 
387
	</head>
-
 
388
	<body style="background-color: white;">
-
 
389
		<h1 style="text-align: center;"><?= $l_loginfailed ?></h1>
-
 
390
		<center><?= $l_encrypted ?></center> 
-
 
391
	</body>
-
 
392
	</html>
-
 
393
	<?php
-
 
394
	exit();
-
 
395
}
-
 
396
 
-
 
397
# Read form parameters which we care about
366
# Read form parameters which we care about
398
# avoid the "user as a MAC address" attempts
367
# avoid the "user as a MAC address" attempts
399
if ((isset($_POST['username'])) && (preg_match('/^([0-9A-F]{2}-){5}[0-9A-F]{2}$/', $_POST['username']) !== 1))
368
if ((isset($_POST['username'])) && (preg_match('/^([0-9A-F]{2}-){5}[0-9A-F]{2}$/', $_POST['username']) !== 1))
400
				$username	= htmlspecialchars(trim($_POST['username']));	else $username = '';
369
				$username	= htmlspecialchars(trim($_POST['username']));	else $username = '';
401
if (isset($_POST['password']))	$password	= htmlspecialchars($_POST['password']);		else $password = '';
370
if (isset($_POST['password']))	$password	= htmlspecialchars($_POST['password']);		else $password = '';