Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2687 → Rev 2688

/web/index.php
80,12 → 80,12
];
}
 
// Test if it's a direct connexion to ALCASAR
// Test if it's a direct connection to ALCASAR
if (isset($_SERVER['HTTP_HOST']) && (($_SERVER['HTTP_HOST'] === $_SERVER['SERVER_ADDR']) || ($_SERVER['HTTP_HOST'] === 'alcasar') || ($_SERVER['HTTP_HOST'] === $hostname) || ($_SERVER['HTTP_HOST'] === $organisme))) {
$direct_access = true;
}
 
// Function to adapt time connexion in seconds to H,M,S
// Function to adapt time connection in seconds to H,M,S
function secondsToDuration($seconds = null){
if ($seconds == null) return "";
$temp = $seconds % 3600;
132,7 → 132,7
if (isset($_GET['url'])) { // it's the second stage (when user has clicked on the button "open a connection")
$redir = 'http://'.$_GET['url'];
header("Location: $redir", true, 307);
exit();
exit();
}
}
 
224,7 → 224,7
$l_service_sms = "SMS service enable";
$l_service_sms_n = "SMS service disable";
$l_acc_sms = "Auto registration by SMS";
$l_explain_warn = "El administrador ha creado un archivo que contiene los periódicos de inicio de sesión como parte de un proceso judicial.";
$l_explain_warn = "El administrador ha creado un archivo que contiene los periódicos de inicio de sesión como parte de un proceso judicial.";
if (isset($_GET['url'])) {
$l_continue_link = "<a href=\"index.php?redirect=1&url=".urlencode($_GET['url'])."\" class=\"button\">Lo comprendo y deseo continuar mi navegación.</a>";
} else {
360,22 → 360,22
$l_explain_access_deny = "You try to connect to a resource whose content is deemed to contain inappropriate information.";
$l_explain_net_pb = "Your portal has just detected that the Internet access is down";
$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_contact_net_pb = "Contact your network responsive or your Internet provider for further information.";
$l_sms_access = "<a href=\"//$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
$l_install_certif = "Install ALCASAR AC Certificate";
$l_install_certif_more = "Install ALCASAR AC Certificate";
$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>";
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
$l_category = "category :";
$l_category = "category:";
if (!$user->connected) {
$l_logout_explain = "No Internet consultation session is actualy open on your system";
$l_logout_explain = "No Internet consultation session is currently open on your system";
$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">Open an Internet session</a>";
} else {
if ($user->username != $user->mac) { // authentication exception or not
$l_logout_explain = "Close the session of the user currently connected.<br> User logged-on : <a href=\"$logout_link\" title=\"Disconnect user $user->username\"><b>$user->username</b></a><br><br>$nb_connection_history last connections :$connection_history";
$l_logout = "<a href=\"$logout_link\">Logoff from internet</a>";
$l_logout_explain = "Close the session of the currently logged-in user.<br> User logged-on: <a href=\"$logout_link\" title=\"Disconnect user $user->username\"><b>$user->username</b></a><br><br>$nb_connection_history last connections:$connection_history";
$l_logout = "<a href=\"$logout_link\">Logoff from the internet</a>";
} else {
$l_logout_explain = "Your system ($user->username) is in exception of authentication.<br><br>$nb_connection_history Last logins :$connection_history";
$l_logout_explain = "Your system ($user->username) is in exception of authentication.<br><br>$nb_connection_history Last logins:$connection_history";
$l_logout = "Connections information";
}
}
394,10 → 394,10
}
$l_title_warn="Dear user,";
$l_explain_warn_name="Someone called ";
$l_explain_warn_ip="with this IP : ";
$l_explain_warn_date="has read your connexion logs at ";
$l_explain_warn_reason="For this reason : ";
$l_uam_domain = "Authorized websites : ";
$l_explain_warn_ip="with this IP: ";
$l_explain_warn_date="has read your connection logs at ";
$l_explain_warn_reason="For this reason: ";
$l_uam_domain = "Authorized websites: ";
}
 
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied));
461,16 → 461,12
// Search blacklist categories
if ((!$direct_access) && (!$network_pb) && (!isset($_GET['warn']))) {
$pattern = str_replace('www.', '', $_SERVER['HTTP_HOST']);
$output = [];
exec('grep -Re ' . escapeshellarg('^'.$pattern.'$') . " /etc/e2guardian/lists/blacklists/*/domains | cut -d'/' -f6", $output);
$lists = [];
foreach ($output as $line) {
$lists[] = $line;
}
$categories = [];
exec('grep -Re ' . escapeshellarg('^'.$pattern.'$') . " /etc/e2guardian/lists/blacklists/*/domains | cut -d'/' -f6", $categories);
 
$filteredUrlHtml = $l_required_domain.' : '.htmlspecialchars($_SERVER['HTTP_HOST']);
if (!empty($lists)) {
$filteredUrlHtml .= "<br>$l_category ".implode(', ', $lists);
if (!empty($categories)) {
$filteredUrlHtml .= "<br>$l_category ".implode(', ', $categories);
}
}
 
564,7 → 560,7
<div class="div-cache" id="text_certif">
<h2><a href="<?= $certCa_link ?>"><?= $l_install_certif_more ?></a></h2>
<p><?= "$l_certif_explain $l_certif_explain_help" ?></p>
<img src="<?= $img_rep.$img_certificate ?>">
<img src="<?= $img_rep.$img_certificate ?>">
</div>
 
<div class="div-cache" id="text_mdp">