2,6 → 2,8 |
$private_ip = "192.168.182.1"; |
$hostname = "alcasar"; |
$network_pb = False; |
$cert_add = "http://alcasar/certs"; |
|
$direct_access = False; |
$diagnostic = "eth0 link down"; |
$remote_ip = ($_SERVER['REMOTE_ADDR']); |
10,6 → 12,14 |
$user = explode (" ", $tab[0]); |
# on discrimine les accès directs sur Alcasar par rapport aux redirections |
if (($_SERVER['HTTP_HOST'] == $private_ip) || ($_SERVER['HTTP_HOST'] == "alcasar") || ($_SERVER['HTTP_HOST'] == $hostname)){$direct_access=True;} |
|
#### Connexion DB à faire ! |
#### Avec retour 3 dernière connexion de $user[5] |
$result_user = "3 dernières connexions :"; |
|
#### |
|
|
# Choice of language |
$Language = 'en'; |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){ |
24,17 → 34,21 |
$l_explain_access_deny = "Vous tentez d'accéder à une ressource dont le contenu est réputé contenir des informations inappropriées."; |
$l_explain_net_pb = "Votre portail détecte que l'accès à Internet est indisponible."; |
$l_contact_access_deny = "Contactez le responsable de la sécurité (OSSI/RSSI) si vous pensez que ce filtrage est abusif."; |
$l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information"; |
$l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information."; |
$l_welcome = "Page principale de votre portail captif"; |
$l_acc_access = "<a href=\"https://$hostname/acc\">Accès au centre de gestion (ALCASAR Control Center)</A>"; |
$l_acc_access = "<a href=\"https://$hostname/acc\">Accès au centre de gestion</A>"; |
$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Installer le certificat racine</A>"; |
$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Installation du certificat de l'autorité racine d'ALCASAR</A>"; |
$l_certif_explain = "Permet l'échange de données sécurisées entre voter station de consultation et le portail captif ALCASAR.<BR>Si ce certificat n'est pas enregistré sur votre station de consultation il est possible que des alertes de sécurités soient émises par votre navigateur.<br><br>"; |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Aide pour les certificats</a>"; |
if ($user[4] == "0") { |
$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système"; |
$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système."; |
$l_logout = "<a href=\"http://www.google.fr\">Ouvrir une session Internet</A>";} |
else { |
$l_logout_explain = "Ferme la session de l'usager : <b>$user[5]</b>"; |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Déconnexion</A>";} |
$l_logout_explain = "Ferme la session de l'usager actuellement connecté. <br><br>Utilisateur connecté :<br><br><a href=\"http://$hostname:3990/logoff\" title=\"Deconnecter l'utilisateur $user[5]\"><b>$user[5]</b></a><br><br>$result_user"; |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Se déconnecter d'internet</A>";} |
$l_password_change = "<a href=\"https://$hostname/pass\">Changer votre mot de passe</A>"; |
$l_password_change_explain = "Vous devez posséder un compte de consultation Internet."; |
$l_password_change_explain = "Vous redirige sur la pages de changement du mot de passe de votre compte d'accès à internet.<br><br>Vous devez avoir un compte internet valide."; |
$l_back_page = "<a href=\"javascript:history.back()\">Page précédente</a>"; |
} |
else { |
48,41 → 62,76 |
$l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive."; |
$l_contact_net_pb = "Contact your network responsive or your Internet provider for more information"; |
$l_welcome = "Your captive portal main page"; |
$l_acc_access = "<a href=\"https://$hostname/acc\">Access to the ALCASAR Control Center</A>"; |
if ($user[4] == "0") { |
$l_acc_access = "<a href=\"https://$hostname/acc\">ALCASAR Control Center</A>"; |
$l_install_certif = "<a href=\"$cert_add/certificate_alcasar_ca.crt\">Install ALCASAR AC Certificate</A>"; |
$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.cert\">Install ALCASAR AC Certificate</A>"; |
$l_certif_explain = "A TRADUIRE<br><br>"; |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Help for ALCASAR certificate</a>"; |
if ($user[4] == "0") { |
$l_logout_explain = "No Internet consultation session is actualy open on your system"; |
$l_logout = "<a href=\"http://www.google.fr\">Open an Internet session</A>";} |
else { |
$l_logout_explain = "Close the session of the user : <b>$user[5]</b>"; |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff</A>";} |
$l_logout_explain = "Close the session of the user actualy connecterd.<br> User logged-on :<br><br><a href=\"http://$hostname:3990/logoff\" title=\"Disconnect user $user[5]\"><b>$user[5]</b></a><br><br>$result_user"; |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff from internet</A>";} |
$l_password_change = "<a href=\"https://$hostname/pass\">Change your password</A>"; |
$l_password_change_explain = "You should already have an Internet access account."; |
$l_password_change_explain = "Ridirect you on password change page.<br><br> You should already have an Internet access account."; |
$l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>"; |
} |
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied)); |
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny)); |
|
# Attribution des icones / images |
$img_rep = "images/"; |
$img_organisme = "organisme.png"; |
$img_access = "globe_acces_70.png"; |
$img_connect = "globe_70.png"; |
$img_warning = "globe_warning_70.png"; |
$img_pwd = "cle_ombre.png"; |
$img_certificate = "certificat.png"; |
$img_acc = "logo-alcasar_70.png"; |
$img_false = "interdit.png"; |
$img_internet = $img_connect; |
|
if ($user[4] == "0") { |
if (! $network_pb) { |
$img_internet = $img_access; |
} |
else { |
$img_internet = $img_warning; |
} |
} |
else { |
$img_internet = $img_connect; |
} |
|
|
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 |
echo "<html><head><title>ALCASAR - $l_title"; |
?> |
</title> |
<LINK rel=stylesheet type=text/css href="css/style_intercept.css"> |
<script> |
function valoriserDiv5(param){ |
document.getElementById("box_info").innerHTML = param.innerHTML; |
} |
</script> |
</head> |
|
<BODY> |
<? |
<BODY onload="valoriserDiv5(text_conn);"> |
<?php |
if ($direct_access){ |
echo " |
<DIV id=\"cadre_titre\" class=\"titre_controle\"> |
<P id=\"acces_controle\" class=\"titre_controle\">$l_title</P>"; |
if ($network_pb) { |
echo " <SPAN>$l_explain_net_pb</SPAN>"; |
if ($network_pb) { |
echo " <SPAN>$l_explain_net_pb</SPAN>"; |
} |
} |
else { |
echo" |
<DIV id=\"cadre_titre\" class=\"titre_refus\"> |
<P id=\"acces_controle\" class=\"titre_refus\">$l_title</P>"; |
} |
else { |
echo" |
<DIV id=\"cadre_titre\" class=\"titre_refus\"> |
<P id=\"acces_controle\" class=\"titre_refus\">$l_title</P>"; |
} |
?> |
<DIV id="boite_logo"> |
<IMG src="images/organisme.png"> |
90,50 → 139,67 |
</DIV> |
<DIV id="contenu_acces"> |
<DIV id="box_url"> |
<? if (! $direct_access){echo "$l_required_domain : $_SERVER[HTTP_HOST]";}?> |
<?php if (! $direct_access){echo "$l_required_domain : $_SERVER[HTTP_HOST]";}?> |
</DIV> |
<? if ($direct_access){ |
<?php |
if ($direct_access){ |
echo " <DIV id=\"box_bienvenue\"> |
$l_welcome |
</DIV> |
<DIV class=\"box_menu_courte\" id=\"box_1\"> |
<IMG src=\"images/cle.png\"> |
<DIV class=\"box_menu\" id=\"box_conn\" onmouseover=\"valoriserDiv5(text_conn);\"> |
<SPAN>$l_logout</SPAN> |
<IMG src=\"$img_rep$img_internet\"> |
</DIV> |
<DIV class=\"box_menu\" id=\"box_certif\" onmouseover=\"valoriserDiv5(text_certif);\"> |
<SPAN>$l_install_certif</SPAN> |
<IMG src=\"$img_rep$img_certificate\"> |
</DIV> |
|
<DIV class=\"box_menu\" id=\"box_mdp\" onmouseover=\"valoriserDiv5(text_mdp);\"> |
<IMG src=\"$img_rep$img_pwd\"> |
<SPAN>$l_password_change</SPAN> |
</DIV> |
<DIV class=\"box_menu\" id=\"box_acc\" onmouseover=\"valoriserDiv5(text_acc);\"> |
<SPAN>$l_acc_access</SPAN> |
<IMG src=\"$img_rep$img_acc\"> |
</DIV> |
<DIV class=\"div-cache\" id=\"text_conn\"> |
<H2>$l_logout</H2> |
<P>$l_logout_explain</P> |
<IMG src=\"$img_rep$img_internet\"> |
</DIV> |
<DIV class=\"div-cache\" id=\"text_certif\"> |
<H2>$l_install_certif_more</H2> |
<P>$l_certif_explain $l_certif_explain_help</P> |
<IMG src=\"$img_rep$img_certificate\"> |
</DIV> |
<DIV class=\"div-cache\" id=\"text_mdp\"> |
<H2>$l_password_change</H2> |
<P>$l_password_change_explain</P> |
<IMG src=\"$img_rep$img_pwd\"> |
</DIV> |
<DIV class=\"div-cache\" id=\"text_acc\"> |
<H2>$l_acc_access</H2> |
<P>$l_explain</P> |
<IMG src=\"$img_rep$img_acc\"> |
</DIV> |
<DIV id=\"box_info\"> |
</DIV>"; |
if ($user[4] == "0") { |
echo " |
<DIV class=\"box_menu_courte\" id=\"box_2\"> |
<SPAN>"; |
if (! $network_pb) { echo "$l_logout";} |
echo " </SPAN> |
<IMG src=\"images/globe_acces.png\"> |
<P>$l_logout_explain</P> |
</DIV>";} |
else { |
echo " |
<DIV class=\"box_menu_courte\" id=\"box_2\"> |
<SPAN>$l_logout</SPAN> |
<IMG src=\"images/globe.png\"> |
<P>$l_logout_explain</P> |
</DIV>";} |
echo " <DIV class=\"box_menu_large\" id=\"box_3\"> |
<SPAN>$l_acc_access</SPAN> |
<IMG src=\"images/logo-alcasar.png\"> |
<P>$l_explain</P> |
</DIV>";} |
else {echo " |
} |
else { |
echo " |
<DIV id=\"box_refuse\"> |
<img src=\"images/interdit.png\"> |
<img src=\"$img_rep$img_false\"> |
<P>$l_explain</P> |
</DIV> |
<DIV id=\"liens_redir\"> |
<P>$l_back_page</P> |
</DIV>";} |
if (($network_pb)&&(! $direct_access)) |
{ |
echo " <SPAN>Diagnostic : $diagnostic</SPAN>"; |
} |
</DIV>"; |
} |
if (($network_pb)&&(! $direct_access)) { |
echo " <SPAN>Diagnostic : $diagnostic</SPAN>"; |
} |
|
?> |
</DIV> |
</BODY> |