Subversion Repositories ALCASAR

Compare Revisions

Regard 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;
360,7 → 360,7
$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";
368,12 → 368,12
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
$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 = "Connections information";
395,7 → 395,7
$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_date="has read your connection logs at ";
$l_explain_warn_reason="For this reason : ";
$l_uam_domain = "Authorized websites : ";
}
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);
}
}