Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 470 → Rev 475

/web/intercept.php.old
0,0 → 1,593
<?php
#
# intercept.php for Alcasar captive portal
# Copyright (C) 2003, 2004 Mondru AB.
# Modify by REXY
# 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.
 
$organisme = "etrs-ssic";
# Redirects from CoovaChilli (chilli daemon) :
# Response to login:
# success : if login successful
# failed : if login failed
# logoff : if logout successful
# already : if tried to login while already logged in
# notyet : if not logged in yet
# smartclient :if login from smart client
# popup1 : if requested a logging in pop up window
# popup2 : if requested a success pop up window
# popup3 : if requested a logout pop up window
# Default : it was not a form request
 
# Shared secret used to encrypt challenge with radius.
$uamsecret = "bZBMKhn2";
 
# URL loaded after success authenticates (let blank for browser defaults)
$adminurl = "";
 
# Our own path
$loginpath = $_SERVER['PHP_SELF'];
 
# Choice of language
$Language = 'en';
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
if($Language == 'es'){
$R_ChilliError = "La autenticación debe ser un éxito a través del servicio de portal cautivo.";
$R_login = "El éxito de la autenticación.<HR>Cierre esta ventana interrumpte la sesion.";
$R_logout = "Conexión de cierre";
$R_loginfailed = "Error de autenticación";
$R_loggingin = "Identificación en el portal cautivo";
$R_loggedcont = "Red de Control de Acceso";
$R_loggedout = "Su sesión se cierra";
$R_user = "Usuario";
$R_password = "Contraseña";
$R_passwordchg = "Cambie su contraseña";
$R_wait = "Por favor, espere un momento ...";
$R_onlinetime = "Tiempo de conexión:";
$R_remainingtime = "Desconexión en:";
$R_encrypted = "La apertura debe usar conexión cifrada";
$R_boutonO = "Autenticación";
$R_boutonF = "Cerrar";
$R_loggedin_stringl0 = "Information System Security";
$R_loggedin_stringl1 = "Bienvenido portal ALCASAR";
$R_loggedin_stringl2 = "El portal fue creado reglamentos para garantizar la trazabilidad, la rendición de cuentas y el no repudio de las conexiones.";
$R_loggedin_stringl3 = "Su actividad en la red es registrada, de conformidad con la privacidad.";
$R_loggedin_stringl4 = "Los datos registrados pueden ser capaces de ser operado por una autoridad judicial en el curso de una investigación.";
$R_loggedin_stringl5 = "Estos datos se eliminan automáticamente después de un año.";
$R_loggedout_string = "Cerrar sesión hizo portal cautivo!";
$R_reply_1 = "Your daily connexion time has been reached";
$R_reply_2 = "Your monthly connexion time has been reached";
$R_reply_3 = "You try to connect outside of your allowed timespan";
$R_reply_4 = "your account expired";
$R_reply_5 = "You have reached the maximum number of simultaneous logins";
$R_ca_1 = "How integrate the ALCASAR";
$R_ca_2 = "certificate";
$R_ca_3 = "in your web browser?";
$R_ca_4 = "-help-";
$R_online_time = "Tiempo en linea";
$R_remaining_time = "Tiempo restante";
}
else if($Language == 'de'){
$R_ChilliError = "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
$R_login = "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung";
$R_logout = "Beenden der Verbindung";
$R_loginfailed = "Authentifizierungsfehler Eigenverbrauch";
$R_loggingin = "Kennzeichnung auf dem Eigenverbrauch";
$R_loggedcont = "Network Access Control";
$R_loggedout = "Ihre Sitzung ist geschlossen";
$R_user = "Benutzer";
$R_password = "Passwort";
$R_passwordchg = "Passwort ändern";
$R_wait = "Bitte warten Sie einen Moment ...";
$R_onlinetime = "Online-Zeit:";
$R_remainingtime = "Abmelden:";
$R_encrypted = "Die Öffnung muß der Anschluß Zahlen";
$R_boutonO = "Authentifizierung";
$R_boutonF = "Schließen";
$R_loggedin_stringl0 = "Information System Security";
$R_loggedin_stringl1 = "Willkommen portal ALCASAR";
$R_loggedin_stringl2 = "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, der Zurechenbarkeit und der Nicht-Anerkennung der Verbindungen.";
$R_loggedin_stringl3 = "Ihre Tätigkeit im Netzwerk registriert ist nach Schutz der Privatsphäre.";
$R_loggedin_stringl4 = "Die gespeicherten Daten nicht pouront genutzt werden, dass von einer Justizbehörde im Rahmen einer Untersuchung.";
$R_loggedin_stringl5 = "Diese Daten werden automatisch gelöscht nach einem Jahr.";
$R_loggedout_string = "Trennung des Portals erfolgt Gefangener!";
$R_reply_1 = "Your daily connexion time has been reached";
$R_reply_2 = "Your monthly connexion time has been reached";
$R_reply_3 = "You try to connect outside of your allowed timespan";
$R_reply_4 = "your account expired";
$R_reply_5 = "You have reached the maximum number of simultaneous logins";
$R_ca_1 = "How integrate the ALCASAR";
$R_ca_2 = "certificate";
$R_ca_3 = "in your web browser?";
$R_ca_4 = "-help-";
$R_online_time = "Online-zeit";
$R_remaining_time = "Restzeit";
 
}
else if($Language == 'nl'){
$R_ChilliError = "De authenticatie moet een succes worden via de captive portal dienst.";
$R_login = "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie.";
$R_logout = "Slotkoers verbinding";
$R_loginfailed = "Authenticatie mislukt";
$R_loggingin = "Identificatie van de captive-portaal";
$R_loggedcont = "Network Access Control";
$R_loggedout = "Uw sessie is gesloten";
$R_user = "Gebruiker";
$R_password = "Wachtwoord";
$R_passwordchg = "Wijzig uw wachtwoord";
$R_wait = "Wacht een moment ...";
$R_onlinetime = "Sluit tijd:";
$R_remainingtime = "Verbreking in:";
$R_encrypted = "De opening moet gebruiken gecodeerde verbinding";
$R_boutonO = "Authenticatie";
$R_boutonF = "Sluiten";
$R_loggedin_stringl0 = "Information System Security";
$R_loggedin_stringl1 = "Welkom portaal ALCASAR";
$R_loggedin_stringl2 = "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
$R_loggedin_stringl3 = "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
$R_loggedin_stringl4 = "De geregistreerde gegevens kunnen worden kunnen worden bediend door een rechterlijke instantie in de loop van een onderzoek.";
$R_loggedin_stringl5 = "Deze gegevens worden automatisch verwijderd na een jaar.";
$R_loggedout_string = "Logout gemaakt intern portaal!";
$R_reply_1 = "Your daily connexion time has been reached";
$R_reply_2 = "Your monthly connexion time has been reached";
$R_reply_3 = "You try to connect outside of your allowed timespan";
$R_reply_4 = "your account expired";
$R_reply_5 = "You have reached the maximum number of simultaneous logins";
$R_ca_1 = "How integrate the ALCASAR";
$R_ca_2 = "certificate";
$R_ca_3 = "in your web browser?";
$R_ca_4 = "-help-";
$R_online_time = "Online tijd";
$R_remaining_time = "Reterende tijd";
}
else if($Language == 'fr'){
$R_ChilliError = "L'authentification doit &ecirc;tre r&eacute;ussie au travers du service du portail captif.";
$R_login = "Authentification r&eacute;ussie.<HR>La fermeture de cette fenêtre interrompt votre session.";
$R_logout = "Fermeture de la session";
$R_loginfailed = "Echec d'authentification";
$R_loggingin = "Identification sur le portail captif";
$R_loggedcont = "Contr&ocirc;le d'acc&egrave;s au r&eacute;seau";
$R_loggedout = "Votre session est fermée";
$R_user = "Identifiant";
$R_password = "Mot de passe";
$R_passwordchg = "Modifier son mot de passe";
$R_wait = "Patientez un instant ...";
$R_onlinetime = "Temps de connexion:";
$R_remainingtime = "Deconnexion dans :";
$R_encrypted = "La connexion avec le portail doit &ecirc;tre chiffr&eacute;e";
$R_boutonO = "Authentification";
$R_boutonF = "Fermer";
$R_loggedin_stringl0 = "S&eacute;curit&eacute; des Syst&egrave;mes d'Information";
$R_loggedin_stringl1 = "Bienvenue sur le portail captif ALCASAR";
$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.";
$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.";
$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.";
$R_loggedin_stringl5 = "Ces donn&eacute;es seront automatiquement supprim&eacute;es au bout d'un an.";
$R_loggedout_string = "D&eacute;connexion du portail captif effectu&eacute;e !";
$R_reply_1 = "Votre dur&eacute;e de connexion journali&egrave;re a &eacute;t&eacute; atteinte";
$R_reply_2 = "Votre dur&eacute;e de connexion mensuelle a &eacute;t&eacute; atteinte";
$R_reply_3 = "Vous tentez de vous connecter en dehors de votre p&eacute;riode autoris&eacute;e";
$R_reply_4 = "Votre compte a expir&eacute";
$R_reply_5 = "Vous avez atteint le nombre maximum de connexions simultan&eacute;es";
$R_ca_1 = "Int&eacute;grer le ";
$R_ca_2 = "certificat";
$R_ca_3 = "d'ALCASAR dans votre navigateur WEB";
$R_ca_4 = "- Aide -";
$R_online_time = "Temps de connexion";
$R_remaining_time = "Temps restant";
}
else{
$R_ChilliError = "The authentication must be successful through the captive portal service.";
$R_login = "Successful authentication.<HR>Closing this window interrupts your session";
$R_logout = "Closing connection";
$R_loginfailed = "Authentication Failed";
$R_loggingin = "Identification on the captive portal";
$R_loggedcont = "Network Access Control";
$R_loggedout = "Your session is closed";
$R_user = "User";
$R_password = "Password";
$R_passwordchg = "Change your password";
$R_wait = "Please wait a moment ...";
$R_onlinetime = "Connect time:";
$R_remainingtime = "Disconnection in:";
$R_encrypted = "The opening must use encrypted connection";
$R_boutonO = "Authentication";
$R_boutonF = "Close";
$R_loggedin_stringl0 = "Information System Security";
$R_loggedin_stringl1 = "Welcome on captive portal ALCASAR";
$R_loggedin_stringl2 = "The portal was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
$R_loggedin_stringl3 = "Your activity on the network is registered in accordance with privacy.";
$R_loggedin_stringl4 = "The recorded data can be able to be operated by a judicial authority in the course of an investigation.";
$R_loggedin_stringl5 = "These data will be automatically deleted after one year.";
$R_loggedout_string = "Logout made captive portal!";
$R_reply_1 = "Your daily connexion time has been reached";
$R_reply_2 = "Your monthly connexion time has been reached";
$R_reply_3 = "You try to connect outside of your allowed timespan";
$R_reply_4 = "your account expired";
$R_reply_5 = "You have reached the maximum number of simultaneous logins";
$R_ca_1 = "Integrate the ALCASAR";
$R_ca_2 = "certificate";
$R_ca_3 = "in your web browser";
$R_ca_4 = "-help-";
$R_online_time = "Online time";
$R_remaining_time = "Remaining time";
}
# Make sure that the form parameters are clean
#$OK_CHARS='-a-zA-Z0-9_.@&=%!';
#$_ = $input = <STDIN>;
#s/[^$OK_CHARS]/_/go;
#$input = $_;
 
# Make sure that the get query parameters are clean
#$OK_CHARS='-a-zA-Z0-9_.@&=%!';
#$_ = $query=$ENV{QUERY_STRING};
#s/[^$OK_CHARS]/_/go;
#$query = $_;
 
# If https not use, tell it's wrong
if (!($_SERVER['HTTPS'] == 'on')) {
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
<title>$R_loggedcont</title>
<meta http-equiv=\"Cache-control\" content=\"no-cache\">
<meta http-equiv=\"Pragma\" content=\"no-cache\">
</head>
<body bgColor = 'white'>
<h1 style=\"text-align: center;\">$R_loginfailed</h1>
<center>$R_encrypted</center>
</body>
</html>";
exit(0);
}
 
# Read form parameters which we care about
if (isset($_POST['UserName'])){ $username = $_POST['UserName'];} else {$username="";}
if (isset($_POST['Password'])){ $password = $_POST['Password'];} else {$password="";}
if (isset($_POST['challenge'])){$challenge = $_POST['challenge'];} else {$challenge="";}
if (isset($_POST['button'])){ $button = $_POST['button'];} else { $button="";}
if (isset($_POST['logout'])){ $logout = $_POST['logout'];} else {$logout="";}
if (isset($_POST['prelogin'])){ $prelogin = $_POST['prelogin'];} else {$prelogin="";}
if (isset($_POST['res'])){ $res = $_POST['res'];} else {$res="";}
if (isset($_POST['uamip'])){ $uamip = $_POST['uamip'];} else {$uamip="";}
if (isset($_POST['uamport'])){ $uamport = $_POST['uamport'];} else {$uamport="";}
if (isset($_POST['userurl'])){ $userurl = $_POST['userurl'];} else {$userurl="";}
if (isset($_POST['timeleft'])){ $timeleft = $_POST['timeleft'];} else {$timeleft="";}
if (isset($_POST['redirurl'])){ $redirurl = $_POST['redirurl'];} else {$redirurl="";}
 
# Read query parameters which we care about
if (isset($_GET['res'])) $res = $_GET['res'];
if (isset($_GET['challenge'])) $challenge = $_GET['challenge'];
if (isset($_GET['uamip'])) $uamip = $_GET['uamip'];
if (isset($_GET['uamport'])) $uamport = $_GET['uamport'];
if (isset($_GET['reply'])){ $reply = $_GET['reply'];} else {$reply="";}
if (isset($_GET['userurl'])) $userurl = $_GET['userurl'];
if (isset($_GET['timeleft'])) $timeleft = $_GET['timeleft'];
if (isset($_GET['redirurl'])) $redirurl = $_GET['redirurl'];
 
# translation of radius replies
if (isset($reply)){
switch(trim ($reply)) {
case 'Your maximum daily usage time has been reached' : $reply = $R_reply_1 ; break;
case 'Your maximum monthly usage time has been reached' : $reply = $R_reply_2 ; break;
case 'You are calling outside your allowed timespan' : $reply = $R_reply_3 ; break;
case 'Password Has Expired' : $reply = $R_reply_4 ; break;
case 'You are already logged in - access denied' : $reply = $R_reply_5 ; break;
}}
 
# If attempt to login
if ("$button" == "$R_boutonO") {
$hexchal = pack ("H32", $challenge);
$newchal = pack ("H*", md5($hexchal . $uamsecret));
$response = md5("\0" . $password . $newchal);
$newpwd = pack("a32", $password);
$pappassword = implode ("", unpack("H32", ($newpwd ^ $newchal)));
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
<title>$R_loggingin</title>
<meta http-equiv=\"Cache-control\" content=\"no-cache\">
<meta http-equiv=\"Pragma\" content=\"no-cache\">
<meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl\">
</head>
<body bgColor = 'white'>
<h1 style=\"text-align: center;\">$R_loggingin</h1>
<center>
$R_wait
</center>
</body>
</html>";
exit(0);
}
 
switch($res) {
case 'success': $result = 1; break; // If login successful
case 'failed': $result = 2; break; // If login failed
case 'logoff': $result = 3; break; // If logout successful
case 'already': $result = 4; break; // If tried to login while already logged in
case 'notyet': $result = 5; break; // If not logged in yet
case 'smartclient': $result = 6; break; // If login from smart client
case 'popup1': $result = 11; break; // If requested a logging in pop up window
case 'popup2': $result = 12; break; // If requested a success pop up window
case 'popup3': $result = 13; break; // If requested a logout pop up window
default: $result = 0; // Default: It was not a form request
}
 
# Otherwise it was not a form request
# Send out an error message
if ($result == 0) {
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
<title>$R_loginfailed</title>
<meta http-equiv=\"Cache-control\" content=\"no-cache\">
<meta http-equiv=\"Pragma\" content=\"no-cache\">
</head>
<body bgColor = 'white'>
<h1 style=\"text-align: center;\">$R_loginfailed</h1>
<center>
$R_ChilliError
</center>
</body>
</html>";
exit(0);
}
 
# Generate the output
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
<title>$R_loggingin</title>
<meta http-equiv=\"Cache-control\" content=\"no-cache\">
<meta http-equiv=\"Pragma\" content=\"no-cache\">
<SCRIPT LANGUAGE=\"JavaScript\">
var blur = 0;
var starttime = new Date();
var startclock = starttime.getTime();
var mytimeleft = 0;
 
function doTime() {
window.setTimeout( \"doTime()\", 1000 );
t = new Date();
time = Math.round((t.getTime() - starttime.getTime())/1000);
if (mytimeleft) {
time = mytimeleft - time;
if (time <= 0) {
window.location = \"$loginpath?res=popup3&uamip=$uamip&uamport=$uamport\";
}
}
if (time < 0) time = 0;
hours = (time - (time % 3600)) / 3600;
time = time - (hours * 3600);
mins = (time - (time % 60)) / 60;
secs = time - (mins * 60);
if (hours < 10) hours = \"0\" + hours;
if (mins < 10) mins = \"0\" + mins;
if (secs < 10) secs = \"0\" + secs;
title = \"$R_online_time : \" + hours + \":\" + mins + \":\" + secs;
if (mytimeleft) {
title = \"$R_remaining_time : \" + hours + \":\" + mins + \":\" + secs;
}
if(document.all || document.getElementById){
document.title = title;
}
else {
self.status = title;
}
}
 
function popUp(URL) {
if (self.name != \"chillispot_popup\") {
chillispot_popup = window.open(URL, 'chillispot_popup', 'width=500,height=250,resizable,scrollbars=yes,location=yes,toolbar=no,statusbar=no,menubar=no');
}
}
 
function doOnLoad(result, URL, userurl, redirurl, timeleft) {
if (timeleft) {
mytimeleft = timeleft;
}
if ((result == 1) && (self.name == \"chillispot_popup\")) {
doTime();
window.onbeforeunload = DecO($result);
}
if ((result == 1) && (self.name != \"chillispot_popup\")) {
popUp(URL);
}
if ((result == 2) || result == 5) {
document.form1.UserName.focus()
}
if ((result == 2) && (self.name != \"chillispot_popup\")) {
popUp();
chillispot_popup.close();
}
if ((result == 12) && (self.name == \"chillispot_popup\")) {
doTime();
";
if ($adminurl) { echo "opener.location = \"$adminurl\";";}
else if ($redirurl) { echo "opener.location = \"$redirurl\";";}
else if ($userurl) { echo "opener.location = \"$userurl\";";}
else echo "opener.home();";
echo "
self.focus();
blur = 0;
}
if ((result == 13) && (self.name == \"chillispot_popup\")) {
self.focus();
blur = 1;
}
}
 
function DecO(result) {
if ((result == 12) && (self.name == \"chillispot_popup\")) {
window.location = \"http://$uamip:$uamport/logoff \";
self.focus();
blur = 1;
//alert ('$R_loggedout');
}
}
</script>
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
</head>
<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)\">
<center>";
#Modifications par stephane ERARD le 30 11 2010
# begin debugging
# print "<center>THE INPUT by GET method (for debugging):<br>";
# foreach ($_GET as $key => $value) {
# print $key . "=" . $value . "<br>";
# }
# print "<br>";
# print "<center>THE INPUT by POST method (for debugging):<br>";
# foreach ($_POST as $key => $value) {
# print $key . "=" . $value . "<br>";
# }
# print "<br></center>";
# end debugging
 
if ($result == 2) {
echo "
<DIV id=\"logon\">
<h2>$R_loginfailed</h2>";
if ($reply) {
#traitement du reply ...
echo "<center> $reply </BR></BR></center>";
}
}
 
if ($result == 5) {
echo "
<DIV id=\"logon\">
<h1>$organisme</h1>
<h2>$R_loggedcont</h2>";
}
 
if ($result == 2 || $result == 5) {
echo "
<IMG id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
<form name=\"form1\" method=\"post\" action=\"$loginpath\">
<input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
<input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
<input type=\"hidden\" name=\"uamport\" value=\"$uamport\">
<input type=\"hidden\" name=\"userurl\" value=\"$userurl\">
<TABLE id=\"boite-logon\">
<TR>
<TD width=\"20%\" rowspan=\"4\"><IMG id=\"logo-organ\" src=\"/images/organisme.png\"></TD>
<TD width=\"30%\" align=\"right\">$R_user</TD>
<TD width=\"50%\" align=\"left\"><INPUT type=\"text\" maxLength=\"32\" name=\"UserName\"></TD>
</TR>
<TR>
<TD align=\"right\">$R_password</TD>
<TD align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\"></TD>
</TR>
<TR>
<TD height=\"23\" colSpan=\"2\" align=\"middle\"><INPUT value=\"$R_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$loginpath?res=popup1&uamip=$uamip&uamport=$uamport')\"></TD>
</TR>
<TR>
<TD colSpan=2 align=middle><H6><A href=\"https://$uamip/pass/\">$R_passwordchg</A></H6></TD>
</TR>
</TABLE>
<TABLE id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\">
<TR>
<TD align=\"middle\"><FONT color=\"red\"><B>$R_loggedin_stringl0</B></FONT></TD>
</TR>
<TR>
<TD align=\"middle\"><FONT color=\"black\"><B>$R_loggedin_stringl1</B></FONT></TD>
</TR>
<TR>
<TD align=\"left\">
<UL>
<LI>$R_loggedin_stringl2</LI>
<LI>$R_loggedin_stringl4</LI>
<LI>$R_loggedin_stringl3</LI>
<LI>$R_loggedin_stringl5</LI>
</UL>
<P id=\"aide-certif\">
$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>
</P>
</TD>
</TR>
</TABLE>
</DIV>
</center>
</form>
</body>
</html>";
}
#Fin des modifications
if ($result == 1) {
echo "
<table id=\"auth_reussi\">
<tr>
<td>
<img height=\"150\" src=\"/images/logo-alcasar.png\">
</td>
<td>
<p class=\"text_auth\">$R_login</p>
</td>
</tr>";
if ($reply) {
## traitement reply
echo "<center> $reply </br></br></center>";
}
echo "
<center>
<a href=\"http://$uamip:$uamport/logoff\">$R_logout</a>
</center>
</body>
</html>";
}
 
if (($result == 4) || ($result == 12)) {
echo "
<table id=\"auth_reussi\">
<tr>
<td>
<img height=\"150\" src=\"/images/logo-alcasar.png\">
</td>
<td>
<p class=\"text_auth\">$R_login</p>
</td>
</tr>
<tr><td colspan=2><center>
<p class=\"lien_deco\"><a href=\"http://$uamip:$uamport/logoff\">$R_logout</a></p>
</center></td></tr>
</table>
</body>
</html>";
}
 
if ($result == 11) {
echo "
<h2 style=\"text-align: center;\">$R_loggingin</h2>
<center>$R_wait</center>
</body>
</html>";
}
 
if (($result == 3) || ($result == 13)) {
echo "
<center>
<p class=\"log_out\">$R_loggedout</p>
<FORM>
<INPUT TYPE=\"button\" VALUE=\"$R_boutonF\" onClick=\"window.close()\">
</FORM></CENTER>
</body>
</html>";
}
 
exit(0);
?>
/web/intercept.php
10,7 → 10,7
# notice and this permission notice is included in all copies or
# substantial portions of the software.
 
$organisme = "etrs-ssic";
$organisme = "steweb57";
# Redirects from CoovaChilli (chilli daemon) :
# Response to login:
# success : if login successful
25,7 → 25,7
# Default : it was not a form request
 
# Shared secret used to encrypt challenge with radius.
$uamsecret = "bZBMKhn2";
$uamsecret = "Mkb0pAEE";
 
# URL loaded after success authenticates (let blank for browser defaults)
$adminurl = "";
32,6 → 32,7
 
# Our own path
$loginpath = $_SERVER['PHP_SELF'];
$statuspath = "http://alcasar/status.php";
 
# Choice of language
$Language = 'en';
365,7 → 366,7
if (mytimeleft) {
time = mytimeleft - time;
if (time <= 0) {
window.location = \"$loginpath?res=popup3&uamip=$uamip&uamport=$uamport\";
window.location = \"$statuspath?res=popup3&uamip=$uamip&uamport=$uamport\";
}
}
if (time < 0) time = 0;
395,6 → 396,7
}
 
function doOnLoad(result, URL, userurl, redirurl, timeleft) {
URL = \"$statuspath\";
if (timeleft) {
mytimeleft = timeleft;
}
403,7 → 405,8
window.onbeforeunload = DecO($result);
}
if ((result == 1) && (self.name != \"chillispot_popup\")) {
popUp(URL);
// popUp(URL);
window.location = userurl;
}
if ((result == 2) || result == 5) {
document.form1.UserName.focus()
494,7 → 497,7
<TD align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\"></TD>
</TR>
<TR>
<TD height=\"23\" colSpan=\"2\" align=\"middle\"><INPUT value=\"$R_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$loginpath?res=popup1&uamip=$uamip&uamport=$uamport')\"></TD>
<TD height=\"23\" colSpan=\"2\" align=\"middle\"><INPUT value=\"$R_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$statuspath')\"></TD>
</TR>
<TR>
<TD colSpan=2 align=middle><H6><A href=\"https://$uamip/pass/\">$R_passwordchg</A></H6></TD>
/web/css/status.css
0,0 → 1,395
/*
Feuille de style pour les pages d'interceptions cot? utilisateurs d'ALCASAR
Auteur : St?phane ERARD
Licence : GNU GPL
 
*/
 
 
/* r?gles g?n?rales */
 
/* Couleurs de polices */
:link, :visited, :hover:link, :hover:visited, H2, #box_url, #box_refuse {
COLOR: #000000;
}
BODY, H, #boite-logon {
COLOR: #666666;
}
#acces_controle, .log_out {
COLOR: white;
}
 
/* Style de police */
 
BODY, :link, :visited, :hover:link, :hover:visited {
FONT-FAMILY: "DejaVu Sans";
}
INPUT, #box_url {
FONT-FAMILY: Arial;
}
#acces_controle, #box_url, #box_bienvenue, #cadre_titre SPAN {
FONT-WEIGHT: bold;
}
 
/*Couleurs de fond */
 
BODY {
BACKGROUND-COLOR: #666666;
}
 
INPUT, #contenu_acces, #logon, #auth_reussi {
BACKGROUND-COLOR: #ffffff;
}
 
/* R?gles des balises HTML */
 
H1, H2, #aide-certif {
TEXT-ALIGN: center;
padding: 0px;
margin: 3px;
}
P, UL, LI{
TEXT-ALIGN: justify;
}
 
BODY {
BACKGROUND-IMAGE: url(/images/fond.png);
BACKGROUND-REPEAT: repeat-x;
TEXT-ALIGN: center;
FONT-SIZE: 12px;
MARGIN: 0px;
}
H1 {
FONT-SIZE: 55px;
}
H2 {
FONT-SIZE: 30px;
}
H6, #aide-certif{
FONT-SIZE: 100%;
}
UL {
MARGIN: 5px;
PADDING-BOTTOM: 5px;
PADDING-LEFT: 10px;
PADDING-RIGHT: 115px;
PADDING-TOP: 5px;
}
LI {
LIST-STYLE-TYPE: square;
PADDING-TOP: 2px;
}
TABLE {
FONT-SIZE: 90%;
}
IMG {
HEIGHT: 150px;
}
INPUT {
BORDER: #666666 1px solid;
PADDING: 2px;
FONT-FAMILY: Arial;
HEIGHT: 22px;
}
 
/* Taille et position des logos */
 
#logo-alcasar {
POSITION: absolute;
BOTTOM: 25px;
RIGHT: 5px;
HEIGHT: 130px;
}
#logo-organ {
POSITION: relative;
TOP: 0px;
RIGHT: -10px;
MAX-WIDTH: 150px;
MAX-HEIGHT: 150px;
}
 
/* Placement et proportion de la boite de saisie et de l'aide */
 
#logon {
POSITION: relative;
WIDTH: 620px;
TOP: 20px;
 
 
/* ombrage CSS3*/
 
-moz-box-shadow: 0px 0px 12px #000;
-webkit-box-shadow: 0px 0px 12px #000;
box-shadow: 0px 0px 12px #000;
}
 
#boite-logon {
BACKGROUND-IMAGE: url(/images/fond-bdd.png);
BACKGROUND-REPEAT: repeat-x;
PADDING: 10px;
WIDTH: 420px;
HEIGHT: 189px;
}
#boite-logon TD {
PADDING-TOP: 10px;
}
#boite-info {
BORDER: 0px;
MARGIN-TOP: 25px;
WIDTH: 580px;
PADDING-TOP: 10px;
}
/*Boite de dialogue de deconnection*/
 
#auth_reussi {
WIDTH: 450px;
MARGIN-TOP: 12px;
PADDING-TOP: 5px;
PADDING-LEFT: 10px;
PADDING-RIGHT: 10px;
PADDING-BOTTOM: 0px;
}
 
.text_auth {
FONT-SIZE: 20px;
}
.lien_deco {
TEXT-ALIGN: center;
FONT-SIZE: 18px;
MARGIN-BOTTOM: 15px;
}
.log_out {
FONT-SIZE: 24px;
TEXT-ALIGN: center;
MARGIN-TOP: 30px;
}
#boite-logon, #auth_reussi, #logon {
BORDER: 1px #efefef solid;
 
/* ombrage css3*/
 
-moz-box-shadow: 0px 0px 6px #000;
-webkit-box-shadow: 0px 0px 6px #000;
box-shadow: 0px 0px 6px #000;
}
 
/* style de la page acc?s contr?l?*/
 
#cadre_titre{
POSITION: relative;
WIDTH: 730px;
HEIGHT: 98px;
MARGIN-TOP: 40px;
MARGIN-LEFT: auto;
MARGIN-RIGHT: auto;
Z-INDEX: 2;
 
/* ombrage css3 */
 
-moz-box-shadow: 1px 4px 10px #000;
-webkit-box-shadow: 1px 4px 10px #000;
box-shadow: 1px 4px 10px #000;
}
#cadre_titre .titre_controle {
BACKGROUND-IMAGE: url(/images/fond-bandeau.png);
BACKGROUND-REPEAT: repeat-x;
}
#cadre_titre .titre_refus {
BACKGROUND-IMAGE: url(/images/fond-bandeau-rouge.png);
BACKGROUND-REPEAT: repeat-x;
}
#boite_logo{
POSITION: absolute;
TOP: -30px;
LEFT: -30px;
WIDTH: 150px;
HEIGHT: 150px;
Z-INDEX: 2;
}
#acces_controle {
TEXT-ALIGN: center;
FONT-SIZE: 40px;
PADDING-TOP: 25px;
PADDING-BOTTOM: 27px;
MARGIN: 0px;
}
#logo_acces {
POSITION: relative;
TOP: 0px;
LEFT: 0px;
}
#contenu_acces {
POSITION: relative;
WIDTH: 640px;
HEIGHT: 400px;
TOP: -20px;
PADDING-TOP: 0px;
MARGIN-LEFT: auto;
MARGIN-RIGHT: auto;
Z-INDEX: 1;
 
/* ombrage CSS3 */
 
-moz-box-shadow: 1px 1px 10px #000;
-webkit-box-shadow: 1px 1px 10px #000;
box-shadow: 1px 1px 10px #000;
}
#logo_acces IMG, #box_refuse IMG {
WIDTH: 95px;
HEIGHT: 95px;
}
 
/* Boite des liens*/
 
#box_url {
POSITION: relative;
TOP: 35px;
TEXT-ALIGN: right;
FONT-SIZE: 14px;
MARGIN-RIGHT: 20px;
}
#box_bienvenue {
FONT-SIZE: 18px;
}
#cadre_titre SPAN {
POSITION: absolute;
TOP: 70px;
WIDTH: 510px;
LEFT: 110px;
FONT-SIZE: 14px;
COLOR: red;
TEXT-ALIGN: center;
BORDER: 2px red solid;
PADDING: 2px;
BACKGROUND-COLOR: white;
}
#contenu_acces SPAN {
POSITION: relative;
BOTTOM: -150px;
FONT-FAMILY: "courier new";
}
#box_refuse {
FONT-SIZE: 16px;
MARGIN-LEFT: 130px;
MARGIN-RIGHT: 20px;
MARGIN-TOP: 40px;
WIDTH: 460px;
}
#box_refuse IMG {
POSITION: absolute;
TOP: -10px;
LEFT: -110px;
}
#box_refuse, #box_bienvenue {
POSITION: relative;
TOP: 55px;
}
#box_1 {
LEFT: 40px;
}
#box_2 {
LEFT: 350px;
}
#box_3 {
WIDTH: 575px;
LEFT: 40px;
BOTTOM: 20px;
}
#box_1 P, #box_2 P, #box_3 P {
MARGIN-LEFT: 80px;
MARGIN-RIGHT: 25px;
MARGIN-TOP: 8px;
FONT-SIZE: 10px;
}
#box_1 SPAN, #box_2 SPAN, #box_3 SPAN {
POSITION: relative;
MARGIN-LEFT: 75px;
MARGIN-RIGHT: 5px;
FONT-SIZE: 12px;
TOP: 2px;
}
.box_menu_courte, .box_menu_large {
POSITION: absolute;
HEIGHT: 80px;
BACKGROUND-IMAGE: url(/images/fond-bdd.png);
BACKGROUND-REPEAT: repeat-x;
VERTICAL-ALIGN: bottom;
TEXT-ALIGN: left;
BORDER: 2px #efefef solid;
 
/* ombrage CSS3 */
-moz-box-shadow: 1px 1px 6px #666;
-webkit-box-shadow: 1px 1px 6px #666;
box-shadow: 1px 1px 6px #666;
}
.box_menu_courte {
WIDTH: 265px;
TOP: 150px;
}
.box_menu_courte IMG, .box_menu_large IMG {
POSITION: absolute;
WIDTH: 100px;
HEIGHT: 100px;
TOP: -40px;
LEFT: -30px;
}
.box_menu_courte, .box_menu_large, #logon , #contenu_acces, #acces_controle, #cadre_titre {
/* Arrondi CSS3 Firefox*/
-moz-border-radius: 10px;
/* Arrondi CSS3 Autres Nav*/
border-radius: 10px;
}
#liens_redir {
POSITION: relative;
BOTTOM: -100px;
LEFT: 90px;
TEXT-ALIGN: center;
}
#liens_redir P A {
FONT-SIZE: 12px;
TEXT-ALIGN: center;
MARGIN: 15px;
}
/*
Ajout stephane weber
*/
#errorTable, #statusTable, #waitTable, #disconnectTable {
BACKGROUND-COLOR: #ffffff;
}
#errorTable, #statusTable, #waitTable, #disconnectTable {
WIDTH: 450px;
/*
MARGIN-TOP: 12px;
*/
MARGIN: 0px;
PADDING-TOP: 5px;
PADDING-LEFT: 10px;
PADDING-RIGHT: 10px;
PADDING-BOTTOM: 0px;
}
#errorTable, #statusTable, #waitTable, #disconnectTable {
BORDER: 1px #efefef solid;
 
/* ombrage css3*/
 
-moz-box-shadow: 0px 0px 6px #000;
-webkit-box-shadow: 0px 0px 6px #000;
box-shadow: 0px 0px 6px #000;
}
.chilliLabel {
/* A DEFINIR*/
/*
text-align: right;
padding-right: 5px;
*/
}
.chilliValue {
/* A DEFINIR*/
}
.wait {
HEIGHT: 16px;
}
/*
Fin Ajout stephane weber
*/
/web/status.php
0,0 → 1,214
<?php
#
# status.php for Alcasar captive portal
# by steweb57
#
$organisme = "steweb57";
 
# Choice of language
//reste quelques traductions à faire
$Language = 'en';
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
if($Language == 'es'){
$R_login1 = "El éxito de la autenticación.";
$R_login2 = "Cierre esta ventana interrumpte la sesion.";
$R_logout = "Conexión de cierre";
$R_loggedout = "Su sesión se cierra";
$R_wait = "Por favor, espere un momento ...";
$R_state_label = "State";
$R_session_id_label = "Session ID";
$R_max_session_time_label = "Max Session Time";
$R_max_idle_time_label = "Max Idle Time";
$R_start_time_label = "Start Time";
$R_session_time_label = "Tiempo de conexión";
$R_idle_time_label = "Idle Time";
$R_downloaded_label = "Downloaded";
$R_uploaded_label = "Uploaded";
$R_original_url_label = "Original URL";
}
else if($Language == 'de'){
$R_login1 = "Erfolgreiche Authentifizierung.";
$R_login2 = "Schlißen dieses fensters unterbricht die sitzung";
$R_logout = "Beenden der Verbindung";
$R_loggedout = "Ihre Sitzung ist geschlossen";
$R_wait = "Bitte warten Sie einen Moment ...";
$R_state_label = "State";
$R_session_id_label = "Session ID";
$R_max_session_time_label = "Max Session Time";
$R_max_idle_time_label = "Max Idle Time";
$R_start_time_label = "Start Time";
$R_session_time_label = "Online-zeit";
$R_idle_time_label = "Idle Time";
$R_downloaded_label = "Downloaded";
$R_uploaded_label = "Uploaded";
$R_original_url_label = "Original URL";
}
else if($Language == 'nl'){
$R_login1 = "Succesvolle authenticatie.";
$R_login2 = "Dit venster te sluiten onderbreekt uw sessie.";
$R_logout = "Slotkoers verbinding";
$R_loggedout = "Uw sessie is gesloten";
$R_wait = "Wacht een moment ...";
$R_state_label = "State";
$R_session_id_label = "Session ID";
$R_max_session_time_label = "Max Session Time";
$R_max_idle_time_label = "Max Idle Time";
$R_start_time_label = "Start Time";
$R_session_time_label = "Online tijd";
$R_idle_time_label = "Idle Time";
$R_downloaded_label = "Downloaded";
$R_uploaded_label = "Uploaded";
$R_original_url_label = "Original URL";
}
else if($Language == 'fr'){
$R_login1 = "Authentification r&eacute;ussie.";
$R_login2 = "La fermeture de cette fenêtre interrompt votre session.";
$R_logout = "Fermeture de la session";
$R_loggedout = "Votre session est fermée";
$R_wait = "Patientez un instant ....";
$R_state_label = "Etat";
$R_session_id_label = "Session ID";
$R_max_session_time_label = "Temps de connexion autoris&eacute";
$R_max_idle_time_label = "Inactivit&eacute; max. autoris&eacute;e";
$R_start_time_label = "D&eacute;but de connexion";
$R_session_time_label = "Dur&eacute;e de connexion";
$R_idle_time_label = "Inactivit&eacute;";
$R_downloaded_label = "Donn&eacute;es t&eacute;l&eacute;charg&eacute;es";
$R_uploaded_label = "Donn&eacute;es envoy&eacute;es";
$R_original_url_label = "URL demand&eacute;";
}
else {
$R_login1 = "Successful authentication.";
$R_login2 = "Closing this window interrupts your session.";
$R_logout = "Closing connection";
$R_loggedout = "Your session is closed";
$R_wait = "Please wait a moment ...";
$R_state_label = "State";
$R_session_id_label = "Session ID";
$R_max_session_time_label = "Max Session Time";
$R_max_idle_time_label = "Max Idle Time";
$R_start_time_label = "Start Time";
$R_session_time_label = "Session Time";
$R_idle_time_label = "Idle Time";
$R_downloaded_label = "Downloaded";
$R_uploaded_label = "Uploaded";
$R_original_url_label = "Original URL";
}
/*
Connected
logout
Connected
Not available
N/A
*/
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="fr">
<!-- written by steweb57 -->
<head>
<title>Alcasar - <?php echo $organisme; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="./js/ChilliLibrary.js">
</script>
<script type="text/javascript" src="./js/statusControler.js">
</script>
<link type="text/css" href="./css/status.css" rel="stylesheet">
</head>
<body>
<div id="Chilli">
<div id="locationName"></div>
<div id="chilliPage">
<div id="logonPage" class="c1">
<table id="disconnectTable">
<tr>
<td><img height="150" src="./images/logo-alcasar.png" alt="logo"></td>
<td>
<p class="text_auth"><?php echo $R_loggedout; ?></p>
</td>
</tr>
</table>
</div>
<div id="statusPage" class="c1">
<table border="0" id="statusTable"><!-- style="padding-top:4px;font-size:70%" -->
<tr>
<td rowspan="2" valign="top"><img height="150" src="./images/logo-alcasar.png" alt="logo"></td>
<td>
<p class="text_auth">Bienvenue <span id="userName"></span>.</p>
<p class="text_auth"><?php echo $R_login1; ?></p>
<hr>
<?php echo $R_login2; ?></td>
</tr>
<tr>
<td align="center"><br>
<a href="#" onclick="return disconnect();" class="lien_deco"><?php echo $R_logout; ?></a><br>
<br></td>
</tr>
<!--tr id="connectRow">
<td id="statusMessageLabel" class="chilliLabel"><strong><?php echo $R_state_label; ?></strong></td>
<td id="statusMessage" class="chilliValue">Connected</td>
</tr-->
<!--tr id="sessionIdRow">
<td id="sessionIdLabel" class="chilliLabel"><strong><?php echo $R_session_id_label; ?></strong></td>
<td id="sessionId" class="chilliValue">Not available</td>
</tr-->
<tr id="sessionTimeoutRow">
<td id="sessionTimeoutLabel" class="chilliLabel"><strong><?php echo $R_max_session_time_label; ?></strong></td>
<td id="sessionTimeout" class="chilliValue">Not available</td>
</tr>
<tr id="idleTimeoutRow">
<td id="idleTimeoutLabel" class="chilliLabel"><strong><?php echo $R_max_idle_time_label; ?></strong></td>
<td id="idleTimeout" class="chilliValue">Not available</td>
</tr>
<tr id="startTimeRow">
<td id="startTimeLabel" class="chilliLabel"><strong><?php echo $R_start_time_label; ?></strong></td>
<td id="startTime" class="chilliValue">Not available</td>
</tr>
<tr id="sessionTimeRow">
<td id="sessionTimeLabel" class="chilliLabel"><strong><?php echo $R_session_time_label; ?></strong></td>
<td id="sessionTime" class="chilliValue">Not available</td>
</tr>
<tr id="idleTimeRow">
<td id="idleTimeLabel" class="chilliLabel"><strong><?php echo $R_idle_time_label; ?></strong></td>
<td id="idleTime" class="chilliValue">Not available</td>
</tr>
<tr id="inputOctetsRow">
<td id="inputOctetsLabel" class="chilliLabel"><strong><?php echo $R_downloaded_label; ?></strong></td>
<td id="inputOctets" class="chilliValue">N/A</td>
</tr>
<tr id="outputOctetsRow">
<td id="outputOctetsLabel" class="chilliLabel"><strong><?php echo $R_uploaded_label; ?></strong></td>
<td id="outputOctets" class="chilliValue">N/A</td>
</tr>
<tr id="originalURLRow">
<td id="originalURLLabel" class="chilliLabel"><strong><?php echo $R_original_url_label; ?></strong></td>
<td id="originalURL" class="chilliValue">N/A</td>
</tr>
</table>
</div>
<div id="waitPage">
<table id="waitTable">
<tr>
<td><img height="150" src="./images/logo-alcasar.png" alt="logo"></td>
<td>
<p class="text_auth"><img src="./images/wait.gif" width="16" height="16" class="wait" alt="wait..."><?php echo $R_wait; ?></p>
</td>
</tr>
</table>
</div>
<div id="errorPage">
<table id="errorTable">
<tr>
<td><img height="150" src="./images/logo-alcasar.png" alt="logo"></td>
<td><span id="errorMessage">Error</span></td>
</tr>
</table>
</div>
</div>
<!--div id="debugPage" style="display:inline;">
<textarea id="debugarea" rows="20" cols="60">
</textarea>
</div--></div>
</body>
</html>