452 |
richard |
1 |
<?php
|
958 |
franck |
2 |
# $Id: index.php 2010 2016-07-26 14:08:50Z raphael.pion $
|
1249 |
richard |
3 |
#
|
1992 |
richard |
4 |
# index.php for ALCASAR bu Rexy
|
1249 |
richard |
5 |
# UI & css style by stephane ERARD
|
|
|
6 |
# The contents of this file may be used under the terms of the GNU
|
|
|
7 |
# General Public License Version 2, provided that the above copyright
|
|
|
8 |
# notice and this permission notice is included in all copies or
|
|
|
9 |
# substantial portions of the software.
|
|
|
10 |
/****************************************************************
|
|
|
11 |
* GLOBAL FILE PATHS *
|
|
|
12 |
*****************************************************************/
|
|
|
13 |
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
|
|
|
14 |
|
|
|
15 |
/****************************************************************
|
|
|
16 |
* FILE reading test *
|
|
|
17 |
*****************************************************************/
|
|
|
18 |
$conf_files=array(CONF_FILE);
|
|
|
19 |
foreach ($conf_files as $file){
|
|
|
20 |
if (!file_exists($file)){
|
|
|
21 |
exit("File ".$file." unknown");
|
|
|
22 |
}
|
|
|
23 |
if (!is_readable($file)){
|
|
|
24 |
exit("You don't have read rights on the file ".$file);
|
|
|
25 |
}
|
|
|
26 |
}
|
|
|
27 |
/****************************************************************
|
|
|
28 |
* Read CONF_FILE *
|
|
|
29 |
*****************************************************************/
|
|
|
30 |
$ouvre=fopen(CONF_FILE,"r");
|
|
|
31 |
if ($ouvre){
|
|
|
32 |
while (!feof ($ouvre))
|
|
|
33 |
{
|
|
|
34 |
$tampon = fgets($ouvre, 4096);
|
|
|
35 |
if (strpos($tampon,"=")!==false){
|
|
|
36 |
$tmp = explode("=",$tampon);
|
|
|
37 |
$conf[$tmp[0]] = $tmp[1];
|
|
|
38 |
}
|
|
|
39 |
}
|
|
|
40 |
}else{
|
|
|
41 |
exit("Error opening the file ".CONF_FILE);
|
|
|
42 |
}
|
|
|
43 |
fclose($ouvre);
|
1345 |
richard |
44 |
$organisme = trim($conf["ORGANISM"]);
|
|
|
45 |
$domainname = trim($conf["DOMAIN"]);
|
|
|
46 |
$hostname = "alcasar.".$domainname;
|
784 |
richard |
47 |
$network_pb = False;
|
1249 |
richard |
48 |
$cert_add = "http://$hostname/certs";
|
360 |
richard |
49 |
$direct_access = False;
|
1992 |
richard |
50 |
$display_menu=False;
|
832 |
richard |
51 |
$diagnostic = "can't contact the default router";
|
1452 |
richard |
52 |
$remote_ip = preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : "";
|
363 |
richard |
53 |
$tab = array();$user = array();
|
566 |
stephane |
54 |
$connection_history = "";
|
|
|
55 |
$nb_connection_history = 3;
|
1992 |
richard |
56 |
$Language = 'en';
|
|
|
57 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
|
|
58 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
|
|
59 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
1999 |
richard |
60 |
$redirect_link = "www.euronews.com"; # Default redirection for HTTPS interception (beware, this website must run in HTTP)
|
566 |
stephane |
61 |
|
1987 |
richard |
62 |
# Retrieve the user info behind the remote ip
|
1818 |
raphael.pi |
63 |
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
|
|
|
64 |
$user = explode (" ", $tab[0]);
|
1820 |
raphael.pi |
65 |
|
1978 |
raphael.pi |
66 |
|
1992 |
richard |
67 |
# Test if it's a direct connexion to ALCASAR
|
1993 |
richard |
68 |
if (isset($_SERVER['HTTP_HOST']))
|
1992 |
richard |
69 |
{
|
1993 |
richard |
70 |
if (($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_ADDR']) || (preg_match ("/^alcasar$/", $_SERVER['HTTP_HOST'])) || (preg_match ("/^$hostname$/", $_SERVER['HTTP_HOST'])) || (preg_match ("/^$organisme$/", $_SERVER['HTTP_HOST'])))
|
|
|
71 |
{
|
522 |
richard |
72 |
$direct_access=True;
|
1992 |
richard |
73 |
exec("sudo /usr/sbin/ipset del not_auth_yet $remote_ip"); # del user of the ipset "not_auth_yet" to not loop
|
1993 |
richard |
74 |
}
|
1992 |
richard |
75 |
}
|
1987 |
richard |
76 |
# Function to adapt time connexion in seconds to H,M,S
|
566 |
stephane |
77 |
function secondsToDuration($seconds = null){
|
|
|
78 |
if ($seconds == null) return "";
|
|
|
79 |
$temp = $seconds % 3600;
|
|
|
80 |
$time[0] = ( $seconds - $temp ) / 3600 ; // hours
|
732 |
richard |
81 |
$time[2] = $temp % 60 ; // seconds
|
566 |
stephane |
82 |
$time[1] = ( $temp - $time[2] ) / 60; // minutes
|
732 |
richard |
83 |
return $time[0]." h ".$time[1]." m ".$time[2]." s";
|
566 |
stephane |
84 |
}
|
509 |
richard |
85 |
|
2010 |
raphael.pi |
86 |
//if user need to be warn
|
|
|
87 |
if(isset($_GET['warn']) && isset($_GET['url']))
|
|
|
88 |
{
|
|
|
89 |
$direct_access = False;
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
|
1987 |
richard |
93 |
# If the user is connected : retrieve the 3 last connexions
|
783 |
richard |
94 |
if ((isset ($user[4])) && ($user[4] != "0")){
|
2010 |
raphael.pi |
95 |
|
|
|
96 |
if(isset($_GET['redirect'])) # if user has been warned, we redirect him to his website
|
|
|
97 |
{
|
|
|
98 |
$redir = "http://".$_GET['url'];
|
|
|
99 |
header("Location: $_GET[url]",TRUE,307);
|
|
|
100 |
exit;
|
|
|
101 |
}
|
|
|
102 |
|
|
|
103 |
|
566 |
stephane |
104 |
if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
|
|
|
105 |
include_once("/etc/freeradius-web/config.php");
|
|
|
106 |
include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
|
2010 |
raphael.pi |
107 |
|
566 |
stephane |
108 |
$sql = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' ORDER BY AcctStartTime DESC LIMIT 0 , $nb_connection_history";
|
|
|
109 |
$link = @da_sql_pconnect($config); // on affiche pas les erreurs
|
|
|
110 |
if ($link){
|
|
|
111 |
$res = @da_sql_query($link,$config,$sql); // on affiche pas les erreurs
|
|
|
112 |
|
|
|
113 |
if ($res){
|
|
|
114 |
$connection_history.= "<ul>";
|
|
|
115 |
while(($row = @da_sql_fetch_array($res,$config))){
|
|
|
116 |
$connected = "";
|
1987 |
richard |
117 |
if ($row['acctstoptime'] == "") $connected = " (active)";
|
1678 |
richard |
118 |
$connection_history.="<li title='$row[username] $row[acctstarttime] $row[acctstoptime] (".secondsToDuration($row['acctsessiontime']).")'>$row[acctstarttime] (".secondsToDuration($row['acctsessiontime']).") $connected</li>";
|
566 |
stephane |
119 |
}
|
|
|
120 |
$connection_history.="</ul>";
|
|
|
121 |
}
|
|
|
122 |
}
|
|
|
123 |
}
|
|
|
124 |
}
|
1992 |
richard |
125 |
else # user not connected
|
1818 |
raphael.pi |
126 |
{
|
1978 |
raphael.pi |
127 |
exec("sudo /usr/sbin/ipset list not_auth_yet | grep $remote_ip | wc -l 2>&1", $ipset_not_auth_yet);
|
1999 |
richard |
128 |
if(!$direct_access && $ipset_not_auth_yet[0] == '0') # it's the first stage of the interception
|
1818 |
raphael.pi |
129 |
{
|
1992 |
richard |
130 |
$display_menu = True; # Display menu for user not_auth_yet
|
1999 |
richard |
131 |
if (!isset($_SERVER['HTTPS'])) # In HTTP, the user is redirected on it's home page. In HTTPS, it's on the default page
|
|
|
132 |
{
|
|
|
133 |
$redirect_link = $_SERVER['HTTP_HOST']; # to keep the user URL
|
|
|
134 |
}
|
|
|
135 |
|
1989 |
raphael.pi |
136 |
}
|
1993 |
richard |
137 |
if(isset($_GET['url'])) # it's the second stage (when user has clicked to open a connection ...)
|
1989 |
raphael.pi |
138 |
{
|
1992 |
richard |
139 |
exec("sudo /usr/sbin/ipset add not_auth_yet $remote_ip"); # Add user in the ipset "not_auth_yet" (DNS requests not intercepted)
|
1999 |
richard |
140 |
$redir = "http://".$_GET['url'];
|
|
|
141 |
header("Location: $redir",TRUE,307);
|
1989 |
raphael.pi |
142 |
exit;
|
|
|
143 |
}
|
1992 |
richard |
144 |
if ($ipset_not_auth_yet[0] == '1'){ #if user not_auth_yet still here (index.php), we force DNS resquest.
|
|
|
145 |
echo "<script>window.location.reload(true)</script>"; # force DNS request
|
|
|
146 |
}
|
2010 |
raphael.pi |
147 |
|
|
|
148 |
|
1818 |
raphael.pi |
149 |
}
|
360 |
richard |
150 |
# Choice of language
|
|
|
151 |
if($Language == 'fr'){
|
1992 |
richard |
152 |
$l_access_denied = "Contrôle d'accès";
|
399 |
franck |
153 |
$l_access_welcome = "Bienvenue sur ALCASAR";
|
360 |
richard |
154 |
$l_access_unavailable = "ACCÈS INDISPONIBLE";
|
|
|
155 |
$l_required_domain = "Site WEB demandé";
|
1504 |
richard |
156 |
$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.";
|
360 |
richard |
157 |
$l_explain_access_deny = "Vous tentez d'accéder à une ressource dont le contenu est réputé contenir des informations inappropriées.";
|
|
|
158 |
$l_explain_net_pb = "Votre portail détecte que l'accès à Internet est indisponible.";
|
|
|
159 |
$l_contact_access_deny = "Contactez le responsable de la sécurité (OSSI/RSSI) si vous pensez que ce filtrage est abusif.";
|
509 |
richard |
160 |
$l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information.";
|
399 |
franck |
161 |
$l_welcome = "Page principale de votre portail captif";
|
1452 |
richard |
162 |
$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Enregistrement par SMS</a>";
|
1830 |
raphael.pi |
163 |
$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Installer le certificat racine</a>";
|
|
|
164 |
$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Installation du certificat de l'autorité racine d'ALCASAR</a>";
|
536 |
franck |
165 |
$l_certif_explain = "Permet l'échange de données sécurisées entre votre 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>";
|
688 |
richard |
166 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Aide complémentaire</a>";
|
1124 |
crox53 |
167 |
$l_category = "catégorie :";
|
832 |
richard |
168 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
509 |
richard |
169 |
$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système.";
|
1992 |
richard |
170 |
$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Ouvrir une session Internet</a>";
|
1820 |
raphael.pi |
171 |
}
|
369 |
richard |
172 |
else {
|
832 |
richard |
173 |
if ($user[5] != $user[0]) // authentication exception or not
|
|
|
174 |
{
|
|
|
175 |
$l_logout_explain = "Ferme la session de l'usager actuellement connecté. <br><br>Utilisateur connecté : <a href=\"http://$hostname:3990/logoff\" title=\"Deconnecter l'utilisateur $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history dernières connexions :$connection_history";
|
|
|
176 |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Se déconnecter d'internet</a>";
|
|
|
177 |
}
|
|
|
178 |
else
|
|
|
179 |
{
|
|
|
180 |
$l_logout_explain = "Votre système ($user[5]) est en exception d'authentication.<br><br>$nb_connection_history last connections :$connection_history";
|
|
|
181 |
$l_logout = "Information des connexions";
|
|
|
182 |
}
|
|
|
183 |
}
|
566 |
stephane |
184 |
$l_password_change = "<a href=\"https://$hostname/pass\">Changer votre mot de passe</a>";
|
536 |
franck |
185 |
$l_password_change_explain = "Vous redirige sur la page de changement du mot de passe de votre compte d'accès à internet.<br><br>Vous devez avoir un compte internet valide.";
|
1452 |
richard |
186 |
$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";
|
360 |
richard |
187 |
$l_back_page = "<a href=\"javascript:history.back()\">Page précédente</a>";
|
1452 |
richard |
188 |
$l_service_sms = "Service SMS actif";
|
|
|
189 |
$l_service_sms_n = "Service SMS non actif";
|
|
|
190 |
$l_acc_sms = "Auto enregistrement par SMS";
|
2010 |
raphael.pi |
191 |
$l_explain_warn = "L'administrateur a créé une archive contenant vos journaux de connexion dans le cadre d'une affaire judiciaire.";
|
|
|
192 |
$l_continue_link = "<a href='index.php?redirect=1&url=$_GET[url]' class='button'>Je comprends et je souhaite continuer ma navigation.</a>";
|
|
|
193 |
$l_title_warn="Cher utilisateur, ";
|
|
|
194 |
$l_explain_warn_name="Une personne sous le nom de ";
|
|
|
195 |
$l_explain_warn_ip="sous cette IP : ";
|
|
|
196 |
$l_explain_warn_date="a consulté vos journaux de connexion le ";
|
|
|
197 |
$l_explain_warn_reason="en émettant la raison suivante : ";
|
360 |
richard |
198 |
}
|
912 |
richard |
199 |
else if($Language == 'pt'){
|
1992 |
richard |
200 |
$l_access_denied = "Controle de acesso";
|
912 |
richard |
201 |
$l_access_welcome = "Bem-vindo ao Alcasar";
|
|
|
202 |
$l_access_unavailable = "ACESSO INDISPONÍVEL";
|
|
|
203 |
$l_required_domain = "Site WEB Obrigatório";
|
955 |
richard |
204 |
$l_explain_acc_access = "Este é o centro de controle do portal para acessar você deve ter uma conta administrativa valida.";
|
912 |
richard |
205 |
$l_explain_access_deny = "Você tenta se conectar a um recurso cujo conteúdo é considerado inadequado no conteúdo de informações.";
|
955 |
richard |
206 |
$l_explain_net_pb = "O sistema detectou que o acesso é de risco, não será permitido o acesso";
|
912 |
richard |
207 |
$l_contact_access_deny = "Entre em contato com o administrador do sistema de segurança se acha que essa filtragem é abusiva.";
|
|
|
208 |
$l_contact_net_pb = "Entre em contato com a empresa fornecedora de Internet para mais informações";
|
955 |
richard |
209 |
$l_welcome = "Página do portal";
|
1452 |
richard |
210 |
$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
|
1830 |
raphael.pi |
211 |
$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Instalar Certificado Alcasar AC</a>";
|
|
|
212 |
$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Instalar Certificado Alcasar AC</a>";
|
912 |
richard |
213 |
$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>";
|
955 |
richard |
214 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Essa foi uma ajuda complementar</a>";
|
1124 |
crox53 |
215 |
$l_category = "categoria :";
|
912 |
richard |
216 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
1992 |
richard |
217 |
$l_logout_explain = "Não há conexão de Internet aberta em seu computador, deseja conectar?";
|
|
|
218 |
$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Abrir uma conexão de Internet</a>";
|
1820 |
raphael.pi |
219 |
}
|
912 |
richard |
220 |
else {
|
|
|
221 |
if ($user[5] != $user[0]) // authentication exception or not
|
|
|
222 |
{
|
955 |
richard |
223 |
$l_logout_explain = "Se desejar, feche a conexão do usuário atual conectado.<br> Usuário conectado : <a href=\"http://$hostname:3990/logoff\" title=\"Disconnect user $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history last connections :$connection_history";
|
922 |
richard |
224 |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Sair da Internet</a>";
|
912 |
richard |
225 |
}
|
|
|
226 |
else
|
|
|
227 |
{
|
955 |
richard |
228 |
$l_logout_explain = "O sistema ($user[5]) detctou exesso de autenticação.<br><br>$nb_connection_history logins últimos :$connection_history";
|
922 |
richard |
229 |
$l_logout = "Informações de conexões";
|
912 |
richard |
230 |
}
|
|
|
231 |
}
|
922 |
richard |
232 |
$l_password_change = "<a href=\"https://$hostname/pass\">Mudar sua senha</a>";
|
955 |
richard |
233 |
$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.";
|
1452 |
richard |
234 |
$l_sms_explain = "Redirect you on auto registration page.<br><br><strong>Login:</strong> your phone number<br><strong>Password:</strong> SMS content";
|
922 |
richard |
235 |
$l_back_page = "<a href=\"javascript:history.back()\">Página anterior</a>";
|
1452 |
richard |
236 |
$l_service_sms = "SMS service enable";
|
|
|
237 |
$l_service_sms_n = "SMS service disable";
|
|
|
238 |
$l_acc_sms = "Auto registration by SMS";
|
2010 |
raphael.pi |
239 |
$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.";
|
|
|
240 |
$l_continue_link = "<a href='index.php?redirect=1&url=$_GET[url]' class='button'>Lo comprendo y deseo continuar mi navegación.</a>";
|
|
|
241 |
$l_title_warn="Estimado usuario,";
|
|
|
242 |
$l_explain_warn_name="El usario ";
|
|
|
243 |
$l_explain_warn_ip="con este IP : ";
|
|
|
244 |
$l_explain_warn_date="consultó a sus registros de conexión el ";
|
|
|
245 |
$l_explain_warn_reason="con la siguiente razón : ";
|
912 |
richard |
246 |
}
|
360 |
richard |
247 |
else {
|
1992 |
richard |
248 |
$l_access_denied = "Access control";
|
369 |
richard |
249 |
$l_access_welcome = "Welcome on ALCASAR";
|
360 |
richard |
250 |
$l_access_unavailable = "ACCESS UNAVAILABLE";
|
|
|
251 |
$l_required_domain = "Required WEB site";
|
369 |
richard |
252 |
$l_explain_acc_access = "This center control the portal. You must have an administrative account.";
|
801 |
richard |
253 |
$l_explain_access_deny = "You try to connect to a resource whose content is deemed to contain inappropriate information.";
|
360 |
richard |
254 |
$l_explain_net_pb = "Your portal has just detected that the Internet access is down";
|
|
|
255 |
$l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
|
|
|
256 |
$l_contact_net_pb = "Contact your network responsive or your Internet provider for more information";
|
369 |
richard |
257 |
$l_welcome = "Your captive portal main page";
|
1452 |
richard |
258 |
$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
|
1830 |
raphael.pi |
259 |
$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Install ALCASAR AC Certificate</a>";
|
|
|
260 |
$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Install ALCASAR AC Certificate</a>";
|
688 |
richard |
261 |
$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>";
|
|
|
262 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
|
1124 |
crox53 |
263 |
$l_category = "category :";
|
783 |
richard |
264 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
1992 |
richard |
265 |
$l_logout_explain = "No Internet consultation session is actualy open on your system";
|
|
|
266 |
$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Open an Internet session</a>";
|
1820 |
raphael.pi |
267 |
}
|
369 |
richard |
268 |
else {
|
832 |
richard |
269 |
if ($user[5] != $user[0]) // authentication exception or not
|
|
|
270 |
{
|
922 |
richard |
271 |
$l_logout_explain = "Close the session of the user currently connected.<br> User logged-on : <a href=\"http://$hostname:3990/logoff\" title=\"Disconnect user $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history last connections :$connection_history";
|
783 |
richard |
272 |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff from internet</a>";
|
832 |
richard |
273 |
}
|
|
|
274 |
else
|
|
|
275 |
{
|
922 |
richard |
276 |
$l_logout_explain = "Your system ($user[5]) is in exception of authentication.<br><br>$nb_connection_history Last logins :$connection_history";
|
832 |
richard |
277 |
$l_logout = "Connections information";
|
|
|
278 |
}
|
783 |
richard |
279 |
}
|
566 |
stephane |
280 |
$l_password_change = "<a href=\"https://$hostname/pass\">Change your password</a>";
|
799 |
richard |
281 |
$l_password_change_explain = "Redirect you on password change page.<br><br> You should already have an Internet access account.";
|
1452 |
richard |
282 |
$l_sms_explain = "Redirect you on auto registration page.<br><br><strong>Login:</strong> your phone number<br><strong>Password:</strong> SMS content";
|
360 |
richard |
283 |
$l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
|
1452 |
richard |
284 |
$l_service_sms = "SMS service enable";
|
|
|
285 |
$l_service_sms_n = "SMS service disable";
|
|
|
286 |
$l_acc_sms = "Auto registration by SMS";
|
2010 |
raphael.pi |
287 |
$l_explain_warn = "The administrator created an archive which contains your imputabilities logs for a judicial investigation.";
|
|
|
288 |
$l_continue_link = "<a href='index.php?redirect=1&url=$_GET[url]' class='button'>I understand and I wish to continue.</a>";
|
|
|
289 |
$l_title_warn="Dear user,";
|
|
|
290 |
$l_explain_warn_name="Someone called ";
|
|
|
291 |
$l_explain_warn_ip="with this IP : ";
|
|
|
292 |
$l_explain_warn_date="has read your connexion logs at ";
|
|
|
293 |
$l_explain_warn_reason="because : ";
|
360 |
richard |
294 |
}
|
1987 |
richard |
295 |
|
369 |
richard |
296 |
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied));
|
360 |
richard |
297 |
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny));
|
509 |
richard |
298 |
|
1987 |
richard |
299 |
# set the icons
|
1999 |
richard |
300 |
$img_rep = "/images/";
|
509 |
richard |
301 |
$img_organisme = "organisme.png";
|
|
|
302 |
$img_access = "globe_acces_70.png";
|
|
|
303 |
$img_connect = "globe_70.png";
|
|
|
304 |
$img_warning = "globe_warning_70.png";
|
|
|
305 |
$img_pwd = "cle_ombre.png";
|
|
|
306 |
$img_certificate = "certificat.png";
|
|
|
307 |
$img_acc = "logo-alcasar_70.png";
|
1452 |
richard |
308 |
$img_sms = "sms.png";
|
509 |
richard |
309 |
$img_false = "interdit.png";
|
1452 |
richard |
310 |
$img_adm = "adm.png";
|
509 |
richard |
311 |
$img_internet = $img_connect;
|
|
|
312 |
|
783 |
richard |
313 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
509 |
richard |
314 |
if (! $network_pb) {
|
|
|
315 |
$img_internet = $img_access;
|
|
|
316 |
}
|
|
|
317 |
else {
|
|
|
318 |
$img_internet = $img_warning;
|
|
|
319 |
}
|
|
|
320 |
}
|
|
|
321 |
else {
|
|
|
322 |
$img_internet = $img_connect;
|
|
|
323 |
}
|
|
|
324 |
|
1992 |
richard |
325 |
# cleaning the cache
|
|
|
326 |
header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");
|
|
|
327 |
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
|
|
328 |
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
|
|
|
329 |
header("Cache-Control: post-check=0, pre-check=0", false);
|
|
|
330 |
header("Pragma: no-cache");
|
360 |
richard |
331 |
?>
|
566 |
stephane |
332 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
|
333 |
<html>
|
|
|
334 |
<head>
|
|
|
335 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
336 |
<title>ALCASAR - <?php echo $l_title; ?></title>
|
|
|
337 |
<meta http-equiv="Cache-control" content="no-cache">
|
|
|
338 |
<meta http-equiv="Pragma" content="no-cache">
|
1989 |
raphael.pi |
339 |
<?php
|
1992 |
richard |
340 |
echo "<style>";
|
|
|
341 |
include("css/style_intercept.css");
|
|
|
342 |
echo "</style>";
|
|
|
343 |
?>
|
|
|
344 |
<script type="text/javascript">
|
|
|
345 |
function valoriserDiv5(param){
|
|
|
346 |
document.getElementById("box_info").innerHTML = param.innerHTML;
|
1989 |
raphael.pi |
347 |
}
|
1992 |
richard |
348 |
</script>
|
360 |
richard |
349 |
</head>
|
566 |
stephane |
350 |
<body onload="valoriserDiv5(text_conn);">
|
509 |
richard |
351 |
<?php
|
1992 |
richard |
352 |
if ($direct_access || $display_menu){
|
360 |
richard |
353 |
echo "
|
566 |
stephane |
354 |
<div id=\"cadre_titre\" class=\"titre_controle\">
|
|
|
355 |
<p id=\"acces_controle\" class=\"titre_controle\">$l_title</p>";
|
509 |
richard |
356 |
if ($network_pb) {
|
566 |
stephane |
357 |
echo " <span>$l_explain_net_pb</span>";
|
509 |
richard |
358 |
}
|
360 |
richard |
359 |
}
|
509 |
richard |
360 |
else {
|
2010 |
raphael.pi |
361 |
#if user need to be warn about that someone who read his logs
|
|
|
362 |
if(isset($_GET['warn']) && isset($_GET['url']) && $_GET['warn'] == '1')
|
|
|
363 |
{
|
509 |
richard |
364 |
echo"
|
566 |
stephane |
365 |
<div id=\"cadre_titre\" class=\"titre_refus\">
|
2010 |
raphael.pi |
366 |
<p id=\"acces_controle\" class=\"titre_refus\">$l_title_warn</p>";
|
|
|
367 |
}
|
|
|
368 |
else
|
|
|
369 |
{
|
|
|
370 |
echo"
|
|
|
371 |
<div id=\"cadre_titre\" class=\"titre_refus\">
|
|
|
372 |
<p id=\"acces_controle\" class=\"titre_refus\">$l_title</p>";
|
|
|
373 |
}
|
363 |
richard |
374 |
}
|
360 |
richard |
375 |
?>
|
566 |
stephane |
376 |
<div id="boite_logo">
|
1989 |
raphael.pi |
377 |
<img src="<?php echo "$img_rep$img_organisme"; ?>">
|
566 |
stephane |
378 |
</div>
|
|
|
379 |
</div>
|
|
|
380 |
<div id="contenu_acces">
|
|
|
381 |
<div id="box_url">
|
1124 |
crox53 |
382 |
<?php
|
1987 |
richard |
383 |
# search here in the blacklist categories if we want to display it (if ((! $direct_access) && (! $network_pb)){}
|
1124 |
crox53 |
384 |
?>
|
566 |
stephane |
385 |
</div>
|
1452 |
richard |
386 |
<?php
|
1987 |
richard |
387 |
# Check if the SMS service is enable
|
1506 |
franck |
388 |
$service_SMS_status="false";
|
|
|
389 |
if ($service_SMS_status == "true") {
|
1452 |
richard |
390 |
$sms_div='
|
|
|
391 |
<div class="box_menu" id="box_acc" onmouseover="valoriserDiv5(text_acc);">
|
|
|
392 |
<span>'.$l_sms_access.'</span>
|
|
|
393 |
<img src="'.$img_rep.''.$img_sms.'">
|
|
|
394 |
</div>
|
|
|
395 |
';
|
|
|
396 |
|
|
|
397 |
$sms_div_over='
|
|
|
398 |
<div class="div-cache" id="text_acc">
|
|
|
399 |
<h2>'.$l_sms_access.'</h2>
|
|
|
400 |
<p>'.$l_sms_explain.'</p>
|
|
|
401 |
<p><font color="green"><center>'.$l_service_sms.'</center></font></p>
|
|
|
402 |
<img src="'.$img_rep.''.$img_sms.'">
|
|
|
403 |
</div>
|
|
|
404 |
';
|
|
|
405 |
}
|
1508 |
richard |
406 |
else {
|
|
|
407 |
$sms_div='';
|
|
|
408 |
$sms_div_over='';
|
|
|
409 |
}
|
1452 |
richard |
410 |
?>
|
509 |
richard |
411 |
<?php
|
1992 |
richard |
412 |
if ($direct_access || $display_menu){
|
566 |
stephane |
413 |
echo " <div id=\"box_bienvenue\">
|
360 |
richard |
414 |
$l_welcome
|
566 |
stephane |
415 |
</div>
|
|
|
416 |
<div class=\"box_menu\" id=\"box_conn\" onmouseover=\"valoriserDiv5(text_conn);\">
|
|
|
417 |
<span>$l_logout</span>
|
|
|
418 |
<img src=\"$img_rep$img_internet\">
|
|
|
419 |
</div>
|
|
|
420 |
<div class=\"box_menu\" id=\"box_certif\" onmouseover=\"valoriserDiv5(text_certif);\">
|
|
|
421 |
<span>$l_install_certif</span>
|
|
|
422 |
<img src=\"$img_rep$img_certificate\">
|
|
|
423 |
</div>
|
|
|
424 |
<div class=\"box_menu\" id=\"box_mdp\" onmouseover=\"valoriserDiv5(text_mdp);\">
|
|
|
425 |
<img src=\"$img_rep$img_pwd\">
|
|
|
426 |
<span>$l_password_change</span>
|
|
|
427 |
</div>
|
1452 |
richard |
428 |
$sms_div
|
566 |
stephane |
429 |
<div class=\"div-cache\" id=\"text_conn\">
|
|
|
430 |
<h2>$l_logout</h2>
|
|
|
431 |
<p>$l_logout_explain</p>
|
|
|
432 |
<img src=\"$img_rep$img_internet\">
|
|
|
433 |
</div>
|
|
|
434 |
<div class=\"div-cache\" id=\"text_certif\">
|
|
|
435 |
<h2>$l_install_certif_more</h2>
|
|
|
436 |
<p>$l_certif_explain $l_certif_explain_help</p>
|
|
|
437 |
<img src=\"$img_rep$img_certificate\">
|
|
|
438 |
</div>
|
|
|
439 |
<div class=\"div-cache\" id=\"text_mdp\">
|
|
|
440 |
<h2>$l_password_change</h2>
|
|
|
441 |
<p>$l_password_change_explain</p>
|
|
|
442 |
<img src=\"$img_rep$img_pwd\">
|
|
|
443 |
</div>
|
1452 |
richard |
444 |
$sms_div_over
|
566 |
stephane |
445 |
<div id=\"box_info\">
|
|
|
446 |
</div>";
|
509 |
richard |
447 |
}
|
1989 |
raphael.pi |
448 |
else {
|
2010 |
raphael.pi |
449 |
#if user need to be warn about that someone who read his logs
|
|
|
450 |
if(isset($_GET['warn']) && isset($_GET['url']) && $_GET['warn'] == '1')
|
|
|
451 |
{
|
|
|
452 |
|
|
|
453 |
|
|
|
454 |
$filename="/var/www/html/acc/backup/log_info.txt";
|
|
|
455 |
$l_explain_warn="";
|
|
|
456 |
if(file_exists($filename)){
|
|
|
457 |
$fichier = fopen($filename, "r");
|
|
|
458 |
$content = file($filename);
|
|
|
459 |
foreach($content as $line){
|
|
|
460 |
$infos=explode("|||", $line);
|
|
|
461 |
$log_date=$infos[0];
|
|
|
462 |
$log_user=$infos[1];
|
|
|
463 |
$log_reason=$infos[2];
|
|
|
464 |
$log_ip=$infos[3];
|
|
|
465 |
}
|
|
|
466 |
|
|
|
467 |
$l_explain_warn="$l_explain_warn_name$log_user ( $l_explain_warn_ip$log_ip ) $l_explain_warn_date$log_date $l_explain_warn_reason$log_reason";
|
|
|
468 |
}
|
|
|
469 |
else
|
|
|
470 |
{
|
|
|
471 |
echo "Log error!";
|
|
|
472 |
}
|
|
|
473 |
|
|
|
474 |
|
|
|
475 |
echo "
|
|
|
476 |
<div id=\"box_refuse\">
|
|
|
477 |
<img src=\"$img_rep$img_warning\">
|
|
|
478 |
<p>$l_explain_warn</p>
|
|
|
479 |
|
|
|
480 |
</div>
|
|
|
481 |
<div id=\"liens_redir\">
|
|
|
482 |
<p>$l_continue_link</p>
|
|
|
483 |
</div>";
|
|
|
484 |
|
|
|
485 |
}
|
|
|
486 |
else
|
|
|
487 |
{
|
509 |
richard |
488 |
echo "
|
566 |
stephane |
489 |
<div id=\"box_refuse\">
|
509 |
richard |
490 |
<img src=\"$img_rep$img_false\">
|
566 |
stephane |
491 |
<p>$l_explain</p>
|
|
|
492 |
</div>
|
|
|
493 |
<div id=\"liens_redir\">
|
|
|
494 |
<p>$l_back_page</p>
|
|
|
495 |
</div>";
|
2010 |
raphael.pi |
496 |
}
|
|
|
497 |
}
|
509 |
richard |
498 |
if (($network_pb)&&(! $direct_access)) {
|
566 |
stephane |
499 |
echo " <span>Diagnostic : $diagnostic</span>";
|
509 |
richard |
500 |
}
|
363 |
richard |
501 |
?>
|
566 |
stephane |
502 |
</div>
|
1452 |
richard |
503 |
<div id="corner">
|
|
|
504 |
<div id="adm" class="corn">
|
1729 |
richard |
505 |
<a href="https://<?php echo $hostname; ?>/acc/"><img src=<?php echo $img_rep.''.$img_adm; ?>></a>
|
1452 |
richard |
506 |
</div>
|
|
|
507 |
</div>
|
566 |
stephane |
508 |
</body>
|
1822 |
raphael.pi |
509 |
</html>
|
1989 |
raphael.pi |
510 |
|
|
|
511 |
|