Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1428 → Rev 1452

/web/index.php
49,7 → 49,7
$cert_add = "http://$hostname/certs";
$direct_access = False;
$diagnostic = "can't contact the default router";
$remote_ip = ($_SERVER['REMOTE_ADDR']);
$remote_ip = preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : "";
$tab = array();$user = array();
$connection_history = "";
$nb_connection_history = 3;
110,13 → 110,14
$l_access_welcome = "Bienvenue sur ALCASAR";
$l_access_unavailable = "ACCÈS INDISPONIBLE";
$l_required_domain = "Site WEB demandé";
$l_explain_acc_access = "Le centre de gestion permet d'administrer le portail. Vous devez posséder un compte d'administration ou de gestion pour y accéder.";
//$l_explain_acc_access = "Le centre de gestion permet d'administrer le portail. Vous devez posséder un compte d'administration ou de gestion pour y accéder.";
$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_welcome = "Page principale de votre portail captif";
$l_acc_access = "<a href=\"https://$hostname/acc\">Acc&egrave;s au centre de gestion</a>";
//$l_acc_access = "<a href=\"https://$hostname/acc\">ALCASAR Controle Center</a>";
$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Enregistrement par SMS</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&eacute; racine d'ALCASAR</a>";
$l_certif_explain = "Permet l'&eacute;change de donn&eacute;es s&eacute;curis&eacute;es entre votre station de consultation et le portail captif ALCASAR.<BR>Si ce certificat n'est pas enregistr&eacute; sur votre station de consultation, il est possible que des alertes de s&eacute;curit&eacute;s soient &eacute;mises par votre navigateur.<br><br>";
124,7 → 125,7
$l_category = "catégorie :";
if ((isset ($user[4])) && ($user[4] == "0")) {
$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre syst&egrave;me.";
$l_logout = "<a href=\"http://www.wikipedia.org\">Ouvrir une session Internet</a>";}
$l_logout = "<a href=\"http://www.qwant.com\">Ouvrir une session Internet</a>";}
else {
if ($user[5] != $user[0]) // authentication exception or not
{
139,7 → 140,11
}
$l_password_change = "<a href=\"https://$hostname/pass\">Changer votre mot de passe</a>";
$l_password_change_explain = "Vous redirige sur la page de changement du mot de passe de votre compte d'acc&egrave;s &agrave; internet.<br><br>Vous devez avoir un compte internet valide.";
$l_sms_explain = "Vous redirige vers une la page explicative de l'auto enregistrement par SMS.<br><br><strong>Identifiant:</strong> votre numéro de téléphone<br><strong>Mot de passe:</strong> votre message";
$l_back_page = "<a href=\"javascript:history.back()\">Page pr&eacute;c&eacute;dente</a>";
$l_service_sms = "Service SMS actif";
$l_service_sms_n = "Service SMS non actif";
$l_acc_sms = "Auto enregistrement par SMS";
}
else if($Language == 'pt'){
$l_access_denied = "Acesso negado";
152,7 → 157,8
$l_contact_access_deny = "Entre em contato com o administrador do sistema de segurança se acha que essa filtragem é abusiva.";
$l_contact_net_pb = "Entre em contato com a empresa fornecedora de Internet para mais informações";
$l_welcome = "Página do portal";
$l_acc_access = "<a href=\"https://$hostname/acc\">ALCASAR Controle Center</a>";
//$l_acc_access = "<a href=\"https://$hostname/acc\">ALCASAR Controle Center</a>";
$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Instalar Certificado Alcasar AC</a>";
$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.cert\">Instalar Certificado Alcasar AC</a>";
$l_certif_explain = "O certificado Permiti a troca de dados seguro entre seu computador e o portal Alcasar.<BR>Se este certificado não estiver incorporado no seu computador, alguns alertas de segurança deverá aparecer no navegador.<br><br>";
160,7 → 166,7
$l_category = "categoria :";
if ((isset ($user[4])) && ($user[4] == "0")) {
$l_logout_explain = "Não há conexão de Internet aberta em seu computador, deseja conectar?";
$l_logout = "<a href=\"http://www.wikipedia.org\">Abrir uma conexão de Internet</a>";}
$l_logout = "<a href=\"http://www.qwant.com\">Abrir uma conexão de Internet</a>";}
else {
if ($user[5] != $user[0]) // authentication exception or not
{
175,7 → 181,11
}
$l_password_change = "<a href=\"https://$hostname/pass\">Mudar sua senha</a>";
$l_password_change_explain = "Você será redirecionado à página de alteração de senha.<br><br> e deverá ter uma conta de usuário valido para efetuar a troca e acessar à Internet.";
$l_sms_explain = "Redirect you on auto registration page.<br><br><strong>Login:</strong> your phone number<br><strong>Password:</strong> SMS content";
$l_back_page = "<a href=\"javascript:history.back()\">Página anterior</a>";
$l_service_sms = "SMS service enable";
$l_service_sms_n = "SMS service disable";
$l_acc_sms = "Auto registration by SMS";
}
else {
$l_access_denied = "ACCESS DENIED";
188,7 → 198,8
$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\">ALCASAR Control Center</a>";
//$l_acc_access = "<a href=\"https://$hostname/acc\">ALCASAR Control Center</a>";
$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
$l_install_certif = "<a href=\"$cert_add/certificat_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 = "Allow secure data exchange between your computer and ALCASAR portal.<BR>If this certificate isn't incorporated in your computer, some security alerts should appear in your browser.<br><br>";
196,7 → 207,7
$l_category = "category :";
if ((isset ($user[4])) && ($user[4] == "0")) {
$l_logout_explain = "No Internet consultation session is actualy open on your system";
$l_logout = "<a href=\"http://www.wikipedia.org\">Open an Internet session</a>";}
$l_logout = "<a href=\"http://www.qwant.com\">Open an Internet session</a>";}
else {
if ($user[5] != $user[0]) // authentication exception or not
{
211,7 → 222,11
}
$l_password_change = "<a href=\"https://$hostname/pass\">Change your password</a>";
$l_password_change_explain = "Redirect you on password change page.<br><br> You should already have an Internet access account.";
$l_sms_explain = "Redirect you on auto registration page.<br><br><strong>Login:</strong> your phone number<br><strong>Password:</strong> SMS content";
$l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
$l_service_sms = "SMS service enable";
$l_service_sms_n = "SMS service disable";
$l_acc_sms = "Auto registration by SMS";
}
$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));
225,7 → 240,9
$img_pwd = "cle_ombre.png";
$img_certificate = "certificat.png";
$img_acc = "logo-alcasar_70.png";
$img_sms = "sms.png";
$img_false = "interdit.png";
$img_adm = "adm.png";
$img_internet = $img_connect;
 
if ((isset ($user[4])) && ($user[4] == "0")) {
279,21 → 296,47
<div id="contenu_acces">
<div id="box_url">
<?php
//search in the blacklist categories
if ((! $direct_access) && (! $network_pb)){
$pattern = preg_replace('/www./','',$_SERVER['HTTP_HOST']);
$pattern = filter_var($pattern, FILTER_VALIDATE_URL) == false ? "" : $pattern;
exec("grep -Re ^$pattern$ /etc/dansguardian/lists/blacklists/*/domains|cut -d'/' -f6", $output);
unset ($line);
foreach ($output as $row) {
$line=$line.(trim($row)).", ";
}
echo "$l_required_domain : $_SERVER[HTTP_HOST]";
if ($line != "") { echo "<BR>".rtrim ("$l_category $line", ", ");}
}
//search here in the blacklist categories (if ((! $direct_access) && (! $network_pb)){}
?>
</div>
<?php
# CHECK IF the SMS service is enable
$service_SMS_status=false;
 
$sms_div='
<div class="box_menu" id="box_acc" onmouseover="valoriserDiv5(text_acc);">
<span>'.$l_sms_access.'</span>
<img src="'.$img_rep.''.$img_sms.'">
</div>
';
 
$sms_div_over='
<div class="div-cache" id="text_acc">
<h2>'.$l_sms_access.'</h2>
<p>'.$l_sms_explain.'</p>
<p><font color="green"><center>'.$l_service_sms.'</center></font></p>
<img src="'.$img_rep.''.$img_sms.'">
</div>
';
 
if(!$service_SMS_status){
$sms_div='
<div class="box_menu" id="box_acc" onmouseover="valoriserDiv5(text_acc);">
<span>'.$l_sms_access.'</span>
<img src="'.$img_rep.''.$img_sms.'">
</div>
';
 
$sms_div_over='
<div class="div-cache" id="text_acc">
<h2>'.$l_sms_access.'</h2>
<p>'.$l_sms_explain.'</p>
<p><font color="red"><center>'.$l_service_sms_n.'</center></font></p>
<img src="'.$img_rep.''.$img_sms.'">
</div>
';
}
?>
<?php
if ($direct_access){
echo " <div id=\"box_bienvenue\">
311,10 → 354,7
<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>
$sms_div
<div class=\"div-cache\" id=\"text_conn\">
<h2>$l_logout</h2>
<p>$l_logout_explain</p>
330,11 → 370,7
<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>
$sms_div_over
<div id=\"box_info\">
</div>";
}
353,5 → 389,10
}
?>
</div>
<div id="corner">
<div id="adm" class="corn">
<a href="https://<?php echo $hostname; ?>/acc"><img src=<?php echo $img_rep.''.$img_adm; ?>></a>
</div>
</div>
</body>
</html>