Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 3164 → Rev 3165

/web/intercept.php
2,16 → 2,10
# $Id$
#
# intercept.php for ALCASAR captive portal
# By Mondru AB.
# Modify by Rexy & steweb57
# by Rexy & steweb57
# UI & css style by Stéphane ERARD & Alexandre VEZIN
# Help for language translation by B. AUBARD (thanks)
 
# The contents of this file may be used under the terms of the GNU
# General Public License Version 2, provided that the above copyright
# notice and this permission notice is included in all copies or
# substantial portions of the software.
 
# Redirects from CoovaChilli (chilli daemon) :
# Response to login:
# success : if login successful
74,6 → 68,13
$alcasarpath = (($useHTTPS) ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'];
$statuspath = (($conf['HTTPS_CHILLI'] === 'on') ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/status.php';
 
# Redirection if HTTPS needed and not used
if (($conf['HTTPS_LOGIN'] === 'on') && (!$useHTTPS)) {
header('HTTP/1.1 301 Moved Permanently');
header('Location: https://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/intercept.php');
exit();
}
 
// Choice of language
$Language = 'en';
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
94,7 → 95,6
$l_wait = "Por favor, espere un momento ...";
$l_onlinetime = "Tiempo de conexión:";
$l_remainingtime = "Desconexión en:";
$l_encrypted = "La conexión con el portal apertura debe ser cifrada (https)";
$l_boutonO = "Autenticación";
$l_boutonF = "Cerrar";
$l_loggedin_stringl1 = "Información del Sistema de Seguridad";
130,7 → 130,6
$l_wait = "Por favor, aguarde um momento ...";
$l_onlinetime = "Tempo de conexão:";
$l_remainingtime = "Desconectado em:";
$l_encrypted = "A conexão com o portal deve ser criptografada (https)";
$l_boutonO = "Autenticação";
$l_boutonF = "Fechar";
$l_loggedin_stringl1 = "Sistema de Informação e segurança";
166,7 → 165,6
$l_wait = "请等待 ...";
$l_onlinetime = "连接时间";
$l_remainingtime = "断开连接于";
$l_encrypted = "与门户的连接必须加密 (https)";
$l_boutonO = "验证";
$l_boutonF = "关闭";
$l_loggedin_stringl1 = "信息系统安全";
202,7 → 200,6
$l_wait = "...إنتظر بعض اللحظات";
$l_onlinetime = ":مدة الإتصال";
$l_remainingtime = ":انقطاع الإتصال في";
$l_encrypted = "يجب تشفير الإتصال بالبوابة (https)";
$l_boutonO = "مصادقة";
$l_boutonF = "أغلق";
$l_loggedin_stringl1 = "سلامة نظم المعلومات";
238,7 → 235,6
$l_wait = "Bitte warten Sie einen Moment ...";
$l_onlinetime = "Online-Zeit:";
$l_remainingtime = "Abmelden:";
$l_encrypted = "Die Verbindung muss verschlüsselt sein (https)";
$l_boutonO = "Authentifizierung";
$l_boutonF = "Schließen";
$l_loggedin_stringl1 = "Information System Security";
274,7 → 270,6
$l_wait = "Wacht een moment ...";
$l_onlinetime = "Sluit tijd:";
$l_remainingtime = "Verbreking in:";
$l_encrypted = "De opening moet gebruiken gecodeerde verbinding (https)";
$l_boutonO = "Authenticatie";
$l_boutonF = "Sluiten";
$l_loggedin_stringl1 = "Information System Security";
310,7 → 305,6
$l_wait = "Patientez un instant ...";
$l_onlinetime = "Temps de connexion:";
$l_remainingtime = "Deconnexion dans :";
$l_encrypted = "La connexion avec le portail doit être chiffrée (https)";
$l_boutonO = "Authentification";
$l_boutonF = "Fermer";
$l_loggedin_stringl1 = "Sécurité des Systèmes d'Information";
346,7 → 340,6
$l_wait = "Please wait a moment ...";
$l_onlinetime = "Connect time:";
$l_remainingtime = "Disconnection in:";
$l_encrypted = "The connection with the portal must be encrypted (https)";
$l_boutonO = "Authentication";
$l_boutonF = "Close";
$l_loggedin_stringl1 = "Information System Security";
370,30 → 363,6
$l_email_registration = "Register by E-mail";
}
 
# If HTTPS not use, tell it's wrong
if (($conf['HTTPS_LOGIN'] === 'on') && ((!isset($_SERVER['HTTPS'])) || (empty($_SERVER['HTTPS'])) || ($_SERVER['HTTPS'] === 'off'))) {
// Cleaning the cache
header('Expires: Tue, 01 Jan 2000 00:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><?= $l_loggedcont ?></title>
</head>
<body style="background-color: white;">
<h1 style="text-align: center;"><?= $l_loginfailed ?></h1>
<center><?= $l_encrypted ?></center>
</body>
</html>
<?php
exit();
}
 
# Read form parameters which we care about
# avoid the "user as a MAC address" attempts
if ((isset($_POST['username'])) && (preg_match('/^([0-9A-F]{2}-){5}[0-9A-F]{2}$/', $_POST['username']) !== 1))
/web/status.php
50,6 → 50,13
$service_wifi4eu_code = $conf['WIFI4EU_CODE'];
$service_wifi4eu_server = 'https://collection.wifi4eu.ec.europa.eu/wifi4eu.min.js';
 
// Redirection if HTTPS needed and not used
if (($conf['HTTPS_LOGIN'] === 'on') && (!$useHTTPS)) {
header('HTTP/1.1 301 Moved Permanently');
header('Location: https://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/status.php');
exit();
}
 
// Wait for chilli (update its tables)
sleep(1); // TODO: wait after login only?
// Retrieve user info in tab $user[]
68,8 → 75,7
return $time[0].' h '.$time[1].' m '.$time[2].' s';
}
 
# Choice of language
// TODO: reste quelques traductions à faire
// Choice of language
$Language = 'en';
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
323,13 → 329,6
$user_needKeepOpen = (preg_match("/^$remote_ip:PERM/m", file_get_contents($filename)) === 0);
}
 
////////////////////////////////////////////////////////////////////////////////////////
/////////////////////// TEST VARIABLES ///////////////////////
//////////////////////////////////////////////////////////////
//$nb_open_session = 2; // >2
//$user_needKeepOpen = true; // true/false
////////////////////////////////////////////////////////////////////////////////////////
 
// Cleaning the cache
header('Expires: Tue, 01 Jan 2000 00:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');