Subversion Repositories ALCASAR

Rev

Rev 2216 | Rev 2250 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log

Rev 2216 Rev 2234
1
<?php
1
<?php
2
# $Id: index.php 2216 2017-05-09 20:31:16Z tom.houdayer $
2
# $Id: index.php 2234 2017-05-18 21:20:10Z richard $
3
#
3
#
4
# index.php for ALCASAR by Rexy
4
# index.php for ALCASAR by Rexy
5
# UI & css style by stephane ERARD
5
# UI & css style by stephane ERARD
6
# The contents of this file may be used under the terms of the GNU
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
7
# General Public License Version 2, provided that the above copyright
8
# notice and this permission notice is included in all copies or
8
# notice and this permission notice is included in all copies or
9
# substantial portions of the software.
9
# substantial portions of the software.
10
/****************************************************************
10
/****************************************************************
11
*			GLOBAL FILE PATHS			*
11
*			GLOBAL FILE PATHS			*
12
*****************************************************************/
12
*****************************************************************/
13
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
13
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
14
define ("DOMAIN_ALLOWED_LIST", "/usr/local/etc/alcasar-uamdomain");
14
define ("DOMAIN_ALLOWED_LIST", "/usr/local/etc/alcasar-uamdomain");
15
 
15
 
16
/****************************************************************
16
/****************************************************************
17
*			FILE reading test			*
17
*			FILE reading test			*
18
*****************************************************************/
18
*****************************************************************/
19
$conf_files = array(CONF_FILE);
19
$conf_files = array(CONF_FILE);
20
foreach ($conf_files as $file) {
20
foreach ($conf_files as $file) {
21
	if (!file_exists($file)) {
21
	if (!file_exists($file)) {
22
		exit("File ".$file." unknown");
22
		exit("File ".$file." unknown");
23
	}
23
	}
24
	if (!is_readable($file)) {
24
	if (!is_readable($file)) {
25
		exit("You don't have read rights on the file ".$file);
25
		exit("You don't have read rights on the file ".$file);
26
	}
26
	}
27
}
27
}
28
/****************************************************************
28
/****************************************************************
29
*			Read CONF_FILE				*
29
*			Read CONF_FILE				*
30
*****************************************************************/
30
*****************************************************************/
31
$file_conf = fopen(CONF_FILE, 'r');
31
$file_conf = fopen(CONF_FILE, 'r');
32
if (!$file_conf) {
32
if (!$file_conf) {
33
	exit('Error opening the file '.CONF_FILE);
33
	exit('Error opening the file '.CONF_FILE);
34
}
34
}
35
while (!feof($file_conf)) {
35
while (!feof($file_conf)) {
36
	$tampon = fgets($file_conf, 4096);
36
	$buffer = fgets($file_conf, 4096);
37
	if ((strpos($tampon, '=') !== false) && (substr($tampon, 0, 1) !== '#')) {
37
	if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) {
38
		$tmp = explode('=', $tampon);
38
		$tmp = explode('=', $buffer);
39
		$conf[$tmp[0]] = trim($tmp[1]);
39
		$conf[$tmp[0]] = trim($tmp[1]);
40
	}
40
	}
41
}
41
}
42
fclose($file_conf);
42
fclose($file_conf);
43
 
43
 
44
$organisme = trim($conf["ORGANISM"]);
44
$organisme = $conf["ORGANISM"];
45
$hostname = trim($conf["HOSTNAME"]).'.'.trim($conf["DOMAIN"]);
45
$hostname  = $conf["HOSTNAME"].'.'.$conf["DOMAIN"];
46
$network_pb = False; # "alcasar-watchdog.sh" changes this value if a network issue is detected
46
$network_pb = False; # "alcasar-watchdog.sh" changes this value if a network issue is detected
47
$diagnostic = "can't contact the default router"; # "alcasar-watchdog.sh" changes this value if a network issue is detected
47
$diagnostic = "can't contact the default router"; # "alcasar-watchdog.sh" changes this value if a network issue is detected
48
$cert_add = "http://$hostname/certs";
48
$cert_add = "http://$hostname/certs";
49
$direct_access = False;
49
$direct_access = False;
50
$display_menu=False;
-
 
51
$remote_ip = preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : "";
50
$remote_ip = preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : "";
52
$tab = array();$user = array();
51
$tab = array();$user = array();
53
$connection_history =  "";
52
$connection_history =  "";
54
$nb_connection_history = 3;
53
$nb_connection_history = 3;
55
$Language = 'en';
54
$Language = 'en';
56
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
55
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
57
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
56
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
58
	$Language = strtolower(substr(chop($Langue[0]),0,2));
57
	$Language = strtolower(substr(chop($Langue[0]),0,2));
59
}
58
}
60
$redirect_link = "www.euronews.com"; # Default redirection for HTTPS interception (beware, this website must run in HTTP)
59
$redirect_link = "www.euronews.com"; # Default redirection for HTTPS interception (beware, this website must run in HTTP)
61
 
60
 
62
# Retrieve the user info behind the remote ip
61
# Retrieve the user info behind the remote ip
63
exec ("sudo /usr/sbin/chilli_query list | grep -Ew $remote_ip" , $tab);
62
exec ("sudo /usr/sbin/chilli_query list | grep -Ew $remote_ip" , $tab);
64
$user = explode (" ", $tab[0]);
63
$user = explode (" ", $tab[0]);
65
 
64
 
66
# Test if it's a direct connexion to ALCASAR
65
# Test if it's a direct connexion to ALCASAR
67
if (isset($_SERVER['HTTP_HOST']) && (($_SERVER['HTTP_HOST'] === $_SERVER['SERVER_ADDR']) || ($_SERVER['HTTP_HOST'] === 'alcasar') || ($_SERVER['HTTP_HOST'] === $hostname) || ($_SERVER['HTTP_HOST'] === $organisme))) {
66
if (isset($_SERVER['HTTP_HOST']) && (($_SERVER['HTTP_HOST'] === $_SERVER['SERVER_ADDR']) || ($_SERVER['HTTP_HOST'] === 'alcasar') || ($_SERVER['HTTP_HOST'] === $hostname) || ($_SERVER['HTTP_HOST'] === $organisme))) {
68
	$direct_access = true;
67
	$direct_access = true;
69
	exec("sudo /usr/sbin/ipset del not_auth_yet $remote_ip"); # del user of the ipset "not_auth_yet" to not loop
-
 
70
}
68
}
71
 
69
 
72
# Function to adapt time connexion in seconds to H,M,S
70
# Function to adapt time connexion in seconds to H,M,S
73
function secondsToDuration($seconds = null){
71
function secondsToDuration($seconds = null){
74
	if ($seconds == null) return "";
72
	if ($seconds == null) return "";
75
	$temp = $seconds % 3600;
73
	$temp = $seconds % 3600;
76
	$time[0] = ( $seconds - $temp ) / 3600 ;	// hours
74
	$time[0] = ( $seconds - $temp ) / 3600 ;	// hours
77
	$time[2] = $temp % 60 ;				// seconds
75
	$time[2] = $temp % 60 ;				// seconds
78
	$time[1] = ( $temp - $time[2] ) / 60;		// minutes
76
	$time[1] = ( $temp - $time[2] ) / 60;		// minutes
79
	return $time[0]." h ".$time[1]." m ".$time[2]." s";
77
	return $time[0]." h ".$time[1]." m ".$time[2]." s";
80
}
78
}
81
 
79
 
82
# if user need to be warned
80
# if user need to be warned
83
if(isset($_GET['warn']) && isset($_GET['url']))
81
if (isset($_GET['warn']) && isset($_GET['url'])) {
84
{
-
 
85
	$direct_access = False;
82
	$direct_access = false;
86
}
83
}
87
 
84
 
88
if ((isset ($user[4])) && ($user[4] != "0")){ # the user is authenticated
85
if ((isset($user[4])) && ($user[4] != "0")) { # the user is authenticated
89
	if(isset($_GET['redirect'])) # if user has been warned, we redirect him to his website
86
	if (isset($_GET['redirect'])) { # if user has been warned, we redirect him to his website
90
	{
-
 
91
		header('Location: '.$_GET['url'], true, 307);
87
		header('Location: '.$_GET['url'], true, 307);
92
		exit; 
88
		exit();
93
	}
89
	}
-
 
90
 
94
	# we retrieve his three last connections
91
	# we retrieve his three last connections
95
	if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
92
	if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
96
		include_once("/etc/freeradius-web/config.php");
93
		include_once("/etc/freeradius-web/config.php");
97
		include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
94
		include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
98
		$sql = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' ORDER BY AcctStartTime DESC LIMIT 0 , $nb_connection_history";
95
		$sql = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' ORDER BY AcctStartTime DESC LIMIT 0 , $nb_connection_history";
99
		$link = @da_sql_pconnect($config);
96
		$link = @da_sql_pconnect($config);
100
		if ($link){
97
		if ($link){
101
			$res = @da_sql_query($link,$config,$sql);
98
			$res = @da_sql_query($link,$config,$sql);
102
			if ($res){
99
			if ($res){
103
				$connection_history.= "<ul>";
100
				$connection_history.= "<ul>";
104
				while(($row = @da_sql_fetch_array($res,$config))){
101
				while(($row = @da_sql_fetch_array($res,$config))){
105
					$connected = "";
102
					$connected = "";
106
					if ($row['acctstoptime'] == "") $connected = " (active)";
103
					if ($row['acctstoptime'] == "") $connected = " (active)";
107
					$connection_history.="<li title='$row[username] $row[acctstarttime] $row[acctstoptime] (".secondsToDuration($row['acctsessiontime']).")'>$row[acctstarttime] (".secondsToDuration($row['acctsessiontime']).") $connected</li>";
104
					$connection_history.="<li title='$row[username] $row[acctstarttime] $row[acctstoptime] (".secondsToDuration($row['acctsessiontime']).")'>$row[acctstarttime] (".secondsToDuration($row['acctsessiontime']).") $connected</li>";
108
				}
105
				}
109
				$connection_history.="</ul>";
106
				$connection_history.="</ul>";
110
			}
107
			}
111
		}
108
		}
112
	}
109
	}
113
}
110
}
114
else # the user isn't authenticated
111
else { # the user isn't authenticated
115
{
-
 
116
	exec("sudo /usr/sbin/ipset list not_auth_yet | grep $remote_ip | wc -l 2>&1", $ipset_not_auth_yet);
-
 
117
	if(!$direct_access && $ipset_not_auth_yet[0] == '0'){ # it's the first stage of the interception
-
 
118
		$display_menu = True; # Display menu for user not_auth_yet
-
 
119
		if (!isset($_SERVER['HTTPS'])){ # In HTTP, the user is redirected on it's home page. In HTTPS, it's on the default page (see $redirect_link)
-
 
120
			$redirect_link = $_SERVER['HTTP_HOST'];
-
 
121
		}
-
 
122
	}
-
 
123
	if(isset($_GET['url'])){ # it's the second stage (when user has clicked on the button "open a connection")
112
	if (isset($_GET['url'])) { # it's the second stage (when user has clicked on the button "open a connection")
124
		exec("sudo /usr/sbin/ipset add not_auth_yet $remote_ip"); # Add user in the ipset "not_auth_yet" (DNS requests not intercepted)
-
 
125
		$redir = "http://".$_GET['url'];
113
		$redir = 'http://'.$_GET['url'];
126
		header("Location: $redir",TRUE,307);
114
		header("Location: $redir", true, 307);
127
		exit; 
115
		exit(); 
128
	}
-
 
129
	if ($ipset_not_auth_yet[0] == '1'){ # if user not_auth_yet still here (index.php), we force DNS resquest.
-
 
130
		 echo "<script>window.location.reload(true)</script>"; # force DNS request
-
 
131
	}
116
	}
132
}
117
}
133
# Choice of language
118
# Choice of language
134
if($Language == 'fr'){
119
if($Language == 'fr'){
135
	$l_access_denied = "Contrôle d'accès";
120
	$l_access_denied = "Contrôle d'accès";
136
	$l_access_welcome = "Bienvenue sur ALCASAR";
121
	$l_access_welcome = "Bienvenue sur ALCASAR";
137
	$l_access_unavailable = "ACCÈS INDISPONIBLE";
122
	$l_access_unavailable = "ACCÈS INDISPONIBLE";
138
	$l_required_domain = "Site WEB demandé";
123
	$l_required_domain = "Site WEB demandé";
139
	$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.";
124
	$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.";
140
	$l_explain_access_deny = "Vous tentez d'accéder à une ressource dont le contenu est réputé contenir des informations inappropriées.";
125
	$l_explain_access_deny = "Vous tentez d'accéder à une ressource dont le contenu est réputé contenir des informations inappropriées.";
141
	$l_explain_net_pb = "Votre portail détecte que l'accès à Internet est indisponible.";
126
	$l_explain_net_pb = "Votre portail détecte que l'accès à Internet est indisponible.";
142
	$l_contact_access_deny = "Contactez le responsable de la séurité (OSSI/RSSI) si vous pensez que ce filtrage est abusif.";
127
	$l_contact_access_deny = "Contactez le responsable de la séurité (OSSI/RSSI) si vous pensez que ce filtrage est abusif.";
143
	$l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information.";
128
	$l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information.";
144
	$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Enregistrement par SMS</a>";
129
	$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Enregistrement par SMS</a>";
145
	$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Installer le certificat racine</a>";
130
	$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Installer le certificat racine</a>";
146
	$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Installation du certificat de l'autorité; racine d'ALCASAR</a>";
131
	$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Installation du certificat de l'autorité; racine d'ALCASAR</a>";
147
	$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é soient émises par votre navigateur.<br><br>";
132
	$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é soient émises par votre navigateur.<br><br>";
148
	$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Aide complémentaire</a>";
133
	$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Aide complémentaire</a>";
149
	$l_category = "catégorie :";
134
	$l_category = "catégorie :";
150
	if ((isset ($user[4])) && ($user[4] == "0")){
135
	if ((isset ($user[4])) && ($user[4] == "0")){
151
		$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système.";
136
		$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système.";
152
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Ouvrir une session Internet</a>";
137
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Ouvrir une session Internet</a>";
153
	}
138
	}
154
	else{
139
	else{
155
		if ($user[5] != $user[0]){ # authentication exception or not
140
		if ($user[5] != $user[0]){ # authentication exception or not
156
			$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";
141
			$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";
157
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">Se déconnecter d'internet</a>";
142
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">Se déconnecter d'internet</a>";
158
		}
143
		}
159
		else{
144
		else{
160
			$l_logout_explain = "Votre système ($user[5]) est en exception d'authentication.<br><br>$nb_connection_history dernières connexions :$connection_history";
145
			$l_logout_explain = "Votre système ($user[5]) est en exception d'authentication.<br><br>$nb_connection_history dernières connexions :$connection_history";
161
			$l_logout = "Information des connexions";
146
			$l_logout = "Information des connexions";
162
		}
147
		}
163
	}
148
	}
164
	$l_password_change = "<a href=\"https://$hostname/pass\">Changer votre mot de passe</a>";
149
	$l_password_change = "<a href=\"https://$hostname/pass\">Changer votre mot de passe</a>";
165
	$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.";
150
	$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.";
166
	$l_sms_explain = "Vous redirige vers 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";
151
	$l_sms_explain = "Vous redirige vers 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";
167
	$l_back_page = "<a href=\"javascript:history.back()\">Page précédente</a>";
152
	$l_back_page = "<a href=\"javascript:history.back()\">Page précédente</a>";
168
	$l_service_sms = "Service SMS actif";
153
	$l_service_sms = "Service SMS actif";
169
	$l_service_sms_n = "Service SMS non actif";
154
	$l_service_sms_n = "Service SMS non actif";
170
	$l_acc_sms = "Auto enregistrement par SMS";
155
	$l_acc_sms = "Auto enregistrement par SMS";
171
	$l_explain_warn = "L'administrateur a créé une archive contenant vos journaux de connexion dans le cadre d'une affaire judiciaire.";
156
	$l_explain_warn = "L'administrateur a créé une archive contenant vos journaux de connexion dans le cadre d'une affaire judiciaire.";
172
	if(isset($_GET['url'])){
157
	if(isset($_GET['url'])){
173
		$l_continue_link = "<a href=\"index.php?redirect=1&url=".urlencode($_GET['url'])."\" class=\"button\">Je comprends et je souhaite continuer ma navigation.</a>";
158
		$l_continue_link = "<a href=\"index.php?redirect=1&url=".urlencode($_GET['url'])."\" class=\"button\">Je comprends et je souhaite continuer ma navigation.</a>";
174
	}
159
	}
175
	else{
160
	else{
176
		$l_continue_link = "<a href=\"index.php\" class=\"button\">Je comprends et je souhaite continuer ma navigation.</a>";
161
		$l_continue_link = "<a href=\"index.php\" class=\"button\">Je comprends et je souhaite continuer ma navigation.</a>";
177
	}
162
	}
178
	$l_title_warn="Cher utilisateur, ";
163
	$l_title_warn="Cher utilisateur, ";
179
	$l_explain_warn_name="Une personne sous le nom de ";
164
	$l_explain_warn_name="Une personne sous le nom de ";
180
	$l_explain_warn_ip="sous cette IP : ";
165
	$l_explain_warn_ip="sous cette IP : ";
181
	$l_explain_warn_date="a consulté vos journaux de connexion le ";
166
	$l_explain_warn_date="a consulté vos journaux de connexion le ";
182
	$l_explain_warn_reason="Raison invoquée : ";
167
	$l_explain_warn_reason="Raison invoquée : ";
183
	$l_uam_domain = "Sites autorisés : ";
168
	$l_uam_domain = "Sites autorisés : ";
184
}
169
}
185
else if($Language == 'pt'){
170
else if($Language == 'pt'){
186
	$l_access_denied = "Controle de acesso";
171
	$l_access_denied = "Controle de acesso";
187
	$l_access_welcome = "Bem-vindo ao Alcasar";
172
	$l_access_welcome = "Bem-vindo ao Alcasar";
188
	$l_access_unavailable = "ACESSO INDISPONÍVEL";
173
	$l_access_unavailable = "ACESSO INDISPONÍVEL";
189
	$l_required_domain = "Site WEB Obrigatório";
174
	$l_required_domain = "Site WEB Obrigatório";
190
	$l_explain_acc_access = "Este é o centro de controle do portal para acessar você deve ter uma conta administrativa valida.";
175
	$l_explain_acc_access = "Este é o centro de controle do portal para acessar você deve ter uma conta administrativa valida.";
191
	$l_explain_access_deny = "Você tenta se conectar a um recurso cujo conteúdo é considerado inadequado no conteúdo de informações.";
176
	$l_explain_access_deny = "Você tenta se conectar a um recurso cujo conteúdo é considerado inadequado no conteúdo de informações.";
192
	$l_explain_net_pb = "O sistema detectou que o acesso é de risco, não será permitido o acesso";
177
	$l_explain_net_pb = "O sistema detectou que o acesso é de risco, não será permitido o acesso";
193
	$l_contact_access_deny = "Entre em contato com o administrador do sistema de segurança se acha que essa filtragem é abusiva.";
178
	$l_contact_access_deny = "Entre em contato com o administrador do sistema de segurança se acha que essa filtragem é abusiva.";
194
	$l_contact_net_pb = "Entre em contato com a empresa fornecedora de Internet para mais informações";
179
	$l_contact_net_pb = "Entre em contato com a empresa fornecedora de Internet para mais informações";
195
	$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
180
	$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
196
	$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Instalar Certificado Alcasar AC</a>";
181
	$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Instalar Certificado Alcasar AC</a>";
197
	$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Instalar Certificado Alcasar AC</a>";
182
	$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Instalar Certificado Alcasar AC</a>";
198
	$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>";
183
	$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>";
199
	$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Essa foi uma ajuda complementar</a>";
184
	$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Essa foi uma ajuda complementar</a>";
200
	$l_category = "categoria :";
185
	$l_category = "categoria :";
201
	if ((isset ($user[4])) && ($user[4] == "0")){
186
	if ((isset ($user[4])) && ($user[4] == "0")){
202
		$l_logout_explain = "Não há conexão de Internet aberta em seu computador, deseja conectar?";
187
		$l_logout_explain = "Não há conexão de Internet aberta em seu computador, deseja conectar?";
203
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Abrir uma conexão de Internet</a>";
188
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Abrir uma conexão de Internet</a>";
204
	}
189
	}
205
	else{
190
	else{
206
		if ($user[5] != $user[0]){ # authentication exception or not
191
		if ($user[5] != $user[0]){ # authentication exception or not
207
			$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 logins últimos :$connection_history";
192
			$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 logins últimos :$connection_history";
208
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">Sair da Internet</a>";
193
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">Sair da Internet</a>";
209
		}
194
		}
210
		else{
195
		else{
211
			$l_logout_explain = "O sistema ($user[5]) detctou exesso de autenticação.<br><br>$nb_connection_history logins últimos :$connection_history";
196
			$l_logout_explain = "O sistema ($user[5]) detctou exesso de autenticação.<br><br>$nb_connection_history logins últimos :$connection_history";
212
			$l_logout = "Informações de conexões";
197
			$l_logout = "Informações de conexões";
213
		}
198
		}
214
	}
199
	}
215
	$l_password_change = "<a href=\"https://$hostname/pass\">Mudar sua senha</a>";
200
	$l_password_change = "<a href=\"https://$hostname/pass\">Mudar sua senha</a>";
216
	$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.";
201
	$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.";
217
	$l_sms_explain = "Redirect you on auto registration page.<br><br><strong>Login:</strong> your phone number<br><strong>Password:</strong> SMS content";
202
	$l_sms_explain = "Redirect you on auto registration page.<br><br><strong>Login:</strong> your phone number<br><strong>Password:</strong> SMS content";
218
	$l_back_page = "<a href=\"javascript:history.back()\">Página anterior</a>";
203
	$l_back_page = "<a href=\"javascript:history.back()\">Página anterior</a>";
219
	$l_service_sms = "SMS service enable";
204
	$l_service_sms = "SMS service enable";
220
	$l_service_sms_n = "SMS service disable";
205
	$l_service_sms_n = "SMS service disable";
221
	$l_acc_sms = "Auto registration by SMS";
206
	$l_acc_sms = "Auto registration by SMS";
222
	$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."; 
207
	$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."; 
223
	if(isset($_GET['url'])){
208
	if(isset($_GET['url'])){
224
		$l_continue_link = "<a href=\"index.php?redirect=1&url=".urlencode($_GET['url'])."\" class=\"button\">Lo comprendo y deseo continuar mi navegación.</a>";
209
		$l_continue_link = "<a href=\"index.php?redirect=1&url=".urlencode($_GET['url'])."\" class=\"button\">Lo comprendo y deseo continuar mi navegación.</a>";
225
	}
210
	}
226
	else{
211
	else{
227
		$l_continue_link = "<a href=\"index.php\" class=\"button\">Lo comprendo y deseo continuar mi navegación.</a>";
212
		$l_continue_link = "<a href=\"index.php\" class=\"button\">Lo comprendo y deseo continuar mi navegación.</a>";
228
	}
213
	}
229
	$l_title_warn="Estimado usuario,";
214
	$l_title_warn="Estimado usuario,";
230
	$l_explain_warn_name="El usario ";
215
	$l_explain_warn_name="El usario ";
231
	$l_explain_warn_ip="con este IP : ";
216
	$l_explain_warn_ip="con este IP : ";
232
	$l_explain_warn_date="consultó a sus registros de conexión el ";
217
	$l_explain_warn_date="consultó a sus registros de conexión el ";
233
	$l_explain_warn_reason="con la siguiente razón : ";
218
	$l_explain_warn_reason="con la siguiente razón : ";
234
	$l_uam_domain = "Sites autorizados : ";
219
	$l_uam_domain = "Sites autorizados : ";
235
}
220
}
236
else if($Language == 'zn'){
221
else if($Language == 'zn'){
237
	$l_access_denied = "访问控制";
222
	$l_access_denied = "访问控制";
238
	$l_access_welcome = "欢迎来到ALCASAR";
223
	$l_access_welcome = "欢迎来到ALCASAR";
239
	$l_access_unavailable = "不可访问";
224
	$l_access_unavailable = "不可访问";
240
	$l_required_domain = "访问的网站";
225
	$l_required_domain = "访问的网站";
241
	$l_explain_acc_access = "管理中心能管理门户,您必须通过超级用户或者管理用户来访问。";
226
	$l_explain_acc_access = "管理中心能管理门户,您必须通过超级用户或者管理用户来访问。";
242
	$l_explain_access_deny = "您试图访问一个含有不当信息的资源。";
227
	$l_explain_access_deny = "您试图访问一个含有不当信息的资源。";
243
	$l_explain_net_pb = "您的门户检测因特网不可用。";
228
	$l_explain_net_pb = "您的门户检测因特网不可用。";
244
	$l_contact_access_deny = "如果您认为该过滤不当,请联系安全负责人(OSSI/RSSI)。";
229
	$l_contact_access_deny = "如果您认为该过滤不当,请联系安全负责人(OSSI/RSSI)。";
245
	$l_contact_net_pb = "请联系IT负责人或网络服务商来了解更多信息。";
230
	$l_contact_net_pb = "请联系IT负责人或网络服务商来了解更多信息。";
246
	$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">短信自动登录 </a>";
231
	$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">短信自动登录 </a>";
247
	$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">安装根证书 </a>";
232
	$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">安装根证书 </a>";
248
	$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">安装根证书 </a>";
233
	$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">安装根证书 </a>";
249
	$l_certif_explain = "允许您的计算机与ALCASAR门户进行安全数据交换。<BR>如果该证书未包含在您的计算机中,您的浏览器将出现一些安全提醒。<br><br>";
234
	$l_certif_explain = "允许您的计算机与ALCASAR门户进行安全数据交换。<BR>如果该证书未包含在您的计算机中,您的浏览器将出现一些安全提醒。<br><br>";
250
	$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">额外帮助</a>";
235
	$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">额外帮助</a>";
251
	$l_category = "类别 :";
236
	$l_category = "类别 :";
252
	if ((isset ($user[4])) && ($user[4] == "0")){
237
	if ((isset ($user[4])) && ($user[4] == "0")){
253
		$l_logout_explain = "您的系统目前没有打开任何网络咨询进程。";
238
		$l_logout_explain = "您的系统目前没有打开任何网络咨询进程。";
254
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">打开一个网络进程</a>";
239
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">打开一个网络进程</a>";
255
	}
240
	}
256
	else{
241
	else{
257
		if ($user[5] != $user[0]){ # authentication exception or not
242
		if ($user[5] != $user[0]){ # authentication exception or not
258
			$l_logout_explain = "关闭当前连接进程。<br> 已连接用户:<a href=\"http://$hostname:3990/logoff\" title=\" $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history 最后连接 :$connection_history";
243
			$l_logout_explain = "关闭当前连接进程。<br> 已连接用户:<a href=\"http://$hostname:3990/logoff\" title=\" $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history 最后连接 :$connection_history";
259
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">断开网络</a>";
244
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">断开网络</a>";
260
		}
245
		}
261
		else{
246
		else{
262
			$l_logout_explain = "您的系统($user[5])验证例外<br><br>$nb_connection_history 最后连接: $connection_history";
247
			$l_logout_explain = "您的系统($user[5])验证例外<br><br>$nb_connection_history 最后连接: $connection_history";
263
			$l_logout = "连接信息";
248
			$l_logout = "连接信息";
264
		}
249
		}
265
	}
250
	}
266
	$l_password_change = "<a href=\"https://$hostname/pass\">更改您的密码</a>";
251
	$l_password_change = "<a href=\"https://$hostname/pass\">更改您的密码</a>";
267
	$l_password_change_explain = "重新指向密码修改页面。<br><br> 您需要一个可用的网络账户。";
252
	$l_password_change_explain = "重新指向密码修改页面。<br><br> 您需要一个可用的网络账户。";
268
	$l_sms_explain = "重新指向短信登录页面。<br><br><strong>用户名:</strong>您的电话号码<br><strong>密码:</strong>您的信息";
253
	$l_sms_explain = "重新指向短信登录页面。<br><br><strong>用户名:</strong>您的电话号码<br><strong>密码:</strong>您的信息";
269
	$l_back_page = "<a href=\"javascript:history.back()\">上一页</a>";
254
	$l_back_page = "<a href=\"javascript:history.back()\">上一页</a>";
270
	$l_service_sms = "短信服务可用";
255
	$l_service_sms = "短信服务可用";
271
	$l_service_sms_n = "短信服务禁用";
256
	$l_service_sms_n = "短信服务禁用";
272
	$l_acc_sms = "短信自动注册";
257
	$l_acc_sms = "短信自动注册";
273
	$l_explain_warn = "管理员创建了一份可用于司法调查的连接日志文档。";
258
	$l_explain_warn = "管理员创建了一份可用于司法调查的连接日志文档。";
274
	if(isset($_GET['url'])){
259
	if(isset($_GET['url'])){
275
		$l_continue_link = "<a href=\"index.php?redirect=1&url=".urlencode($_GET['url'])."\" class=\"button\">我明白并希望继续浏览。</a>";
260
		$l_continue_link = "<a href=\"index.php?redirect=1&url=".urlencode($_GET['url'])."\" class=\"button\">我明白并希望继续浏览。</a>";
276
	}
261
	}
277
	else{
262
	else{
278
		$l_continue_link = "<a href=\"index.php\" class=\"button\">我明白并希望继续浏览。</a>";
263
		$l_continue_link = "<a href=\"index.php\" class=\"button\">我明白并希望继续浏览。</a>";
279
	}
264
	}
280
	$l_title_warn="亲爱的用户,";
265
	$l_title_warn="亲爱的用户,";
281
	$l_explain_warn_name="一人名为";
266
	$l_explain_warn_name="一人名为";
282
	$l_explain_warn_ip="在此IP:";
267
	$l_explain_warn_ip="在此IP:";
283
	$l_explain_warn_date="查看您的连接日志于";
268
	$l_explain_warn_date="查看您的连接日志于";
284
	$l_explain_warn_reason=" 如下原因:";
269
	$l_explain_warn_reason=" 如下原因:";
285
	$l_uam_domain = "授权网站 : ";
270
	$l_uam_domain = "授权网站 : ";
286
}
271
}
287
else if ($Language == 'ar'){
272
else if ($Language == 'ar'){
288
	$l_access_denied = "مراقبة الدخول";
273
	$l_access_denied = "مراقبة الدخول";
289
	$l_access_welcome = "ALCASAR مرحبا بك في";
274
	$l_access_welcome = "ALCASAR مرحبا بك في";
290
	$l_access_unavailable = "الدخول غير متوفر";
275
	$l_access_unavailable = "الدخول غير متوفر";
291
	$l_required_domain = "موقع إنترنيت مطلوب";
276
	$l_required_domain = "موقع إنترنيت مطلوب";
292
	$l_explain_acc_access = "مركز التحكم يمكنك من إدارة البوابة. يلزمك التوفر على حساب الادارة للدخول.";
277
	$l_explain_acc_access = "مركز التحكم يمكنك من إدارة البوابة. يلزمك التوفر على حساب الادارة للدخول.";
293
	$l_explain_access_deny = "محاولة لدخول موارد تحتوي على معلومات غير ملائمة المحتوى";
278
	$l_explain_access_deny = "محاولة لدخول موارد تحتوي على معلومات غير ملائمة المحتوى";
294
	$l_explain_net_pb = "بوابتك تكتشف ان الدخول على الانترنت غير متوفر";
279
	$l_explain_net_pb = "بوابتك تكتشف ان الدخول على الانترنت غير متوفر";
295
	$l_contact_access_deny = "المرجو الاتصال بضابط أمن (OSS / RSS) إذا اعتقدت ان هذه التصفية غير قانونية";
280
	$l_contact_access_deny = "المرجو الاتصال بضابط أمن (OSS / RSS) إذا اعتقدت ان هذه التصفية غير قانونية";
296
	$l_contact_net_pb = "المرجو الاتصال بمدير المعلومات أو مورد الأنترنت للمزيد من المعلومات";
281
	$l_contact_net_pb = "المرجو الاتصال بمدير المعلومات أو مورد الأنترنت للمزيد من المعلومات";
297
	$auto_save_sms_text = "تسجيل ذاتي على";
282
	$auto_save_sms_text = "تسجيل ذاتي على";
298
	$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">SMS $auto_save_sms_text</a>";
283
	$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">SMS $auto_save_sms_text</a>";
299
	$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">ركب جذر الشهادة</a>";
284
	$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">ركب جذر الشهادة</a>";
300
	$install_cert_text = "تركيب شهادة السلطة؛ جذر الكزار";
285
	$install_cert_text = "تركيب شهادة السلطة؛ جذر الكزار";
301
	$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">ALCASAR $install_cert_text</a>";
286
	$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">ALCASAR $install_cert_text</a>";
302
	$exchange_data_text = "يمَكن من تبادل البيانات المؤمّنة بين محطة الاستفسار و بوابة الكزار الأسيرة";
287
	$exchange_data_text = "يمَكن من تبادل البيانات المؤمّنة بين محطة الاستفسار و بوابة الكزار الأسيرة";
303
	$cert_not_saved_text = "إذا لم يتم تسجيل هذه الشهادة على محطة الاستفسار الخاصة بك، فمن الممكن ان يتم إصدار تنبيهات أمنية من متصحفك";
288
	$cert_not_saved_text = "إذا لم يتم تسجيل هذه الشهادة على محطة الاستفسار الخاصة بك، فمن الممكن ان يتم إصدار تنبيهات أمنية من متصحفك";
304
	$l_certif_explain = "<br><br>.$cert_not_saved_text<br> .$exchange_data_text";
289
	$l_certif_explain = "<br><br>.$cert_not_saved_text<br> .$exchange_data_text";
305
	$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">مساعدة إضافية </a>";
290
	$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">مساعدة إضافية </a>";
306
	$l_category = "فئة :";
291
	$l_category = "فئة :";
307
	if ((isset ($user[4])) && ($user[4] == "0")){
292
	if ((isset ($user[4])) && ($user[4] == "0")){
308
		$l_logout_explain = "و لا جلسة استفسار للإنترنت مفتوحة حاليا على نظامك";
293
		$l_logout_explain = "و لا جلسة استفسار للإنترنت مفتوحة حاليا على نظامك";
309
		$close_session_text = "فتح جلسة الإنترنت";
294
		$close_session_text = "فتح جلسة الإنترنت";
310
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">$close_session_text</a>";
295
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">$close_session_text</a>";
311
	}
296
	}
312
	else{
297
	else{
313
		if ($user[5] != $user[0]){ # authentication exception or not
298
		if ($user[5] != $user[0]){ # authentication exception or not
314
			$close_session_text = "إقفال جلسة المستخدم المتصل حاليا";
299
			$close_session_text = "إقفال جلسة المستخدم المتصل حاليا";
315
			$user_logged_text = "المستخدم متصل";
300
			$user_logged_text = "المستخدم متصل";
316
			$disconnect_user_text = "قطع الاتصال على المستخدم";
301
			$disconnect_user_text = "قطع الاتصال على المستخدم";
317
			$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";
302
			$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";
318
			$logout_internet_text = "قطع الاتصال على الإنترنت";
303
			$logout_internet_text = "قطع الاتصال على الإنترنت";
319
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">$logout_internet_text</a>";
304
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">$logout_internet_text</a>";
320
		}
305
		}
321
		else{
306
		else{
322
			$your_system_text = "نظامك";
307
			$your_system_text = "نظامك";
323
			$auth_except_text = "على توثيق استثنائي";
308
			$auth_except_text = "على توثيق استثنائي";
324
			$last_conn_text = "اتصالات مشاركة";
309
			$last_conn_text = "اتصالات مشاركة";
325
			$l_logout_explain = "$connection_history :$last_conn_text $nb_connection_history<br><br>$auth_except_text ($user[5]) $your_system_text";
310
			$l_logout_explain = "$connection_history :$last_conn_text $nb_connection_history<br><br>$auth_except_text ($user[5]) $your_system_text";
326
			$l_logout = "معلومات على الاتصالات ";
311
			$l_logout = "معلومات على الاتصالات ";
327
		}
312
		}
328
	}
313
	}
329
	$change_pass_text = "غير كلمتك السرية";
314
	$change_pass_text = "غير كلمتك السرية";
330
	$l_password_change = "<a href=\"https://$hostname/pass\">$change_pass_text</a>";
315
	$l_password_change = "<a href=\"https://$hostname/pass\">$change_pass_text</a>";
331
	$redirect_pass_text = "يوجهك على صفحة تغيير الكلمة السرية لحساب الإنترنت الخاص بك";
316
	$redirect_pass_text = "يوجهك على صفحة تغيير الكلمة السرية لحساب الإنترنت الخاص بك";
332
	$valid_account_text = "يجب ان يكون حساب الإنترنت الخاص بك صالحاً";
317
	$valid_account_text = "يجب ان يكون حساب الإنترنت الخاص بك صالحاً";
333
	$l_password_change_explain = "$valid_account_text<br><br>.$redirect_text";
318
	$l_password_change_explain = "$valid_account_text<br><br>.$redirect_text";
334
	$redirect_sms_text = "يوجهك على الصفحة التفسيرية للتسجيل الذاتي بطريقة";
319
	$redirect_sms_text = "يوجهك على الصفحة التفسيرية للتسجيل الذاتي بطريقة";
335
	$login_text = "تسجيل الدخول";
320
	$login_text = "تسجيل الدخول";
336
	$your_phone_text = "رقم الهاتف الخاص بك";
321
	$your_phone_text = "رقم الهاتف الخاص بك";
337
	$pass_text = "كلمة السر";
322
	$pass_text = "كلمة السر";
338
	$your_message_text = "رسالتك";
323
	$your_message_text = "رسالتك";
339
	$l_sms_explain = "$your_message_text <strong>$pass_text</strong><br>$your_phone_text <strong>$login_text</strong><br><br>$redirect_sms_text";
324
	$l_sms_explain = "$your_message_text <strong>$pass_text</strong><br>$your_phone_text <strong>$login_text</strong><br><br>$redirect_sms_text";
340
	$previous_text = "الصفحة السابقة";
325
	$previous_text = "الصفحة السابقة";
341
	$l_back_page = "<a href=\"javascript:history.back()\">$previous_text</a>";
326
	$l_back_page = "<a href=\"javascript:history.back()\">$previous_text</a>";
342
	$l_service_sms = "نشطة SMS خدمة";
327
	$l_service_sms = "نشطة SMS خدمة";
343
	$l_service_sms_n = "غير نشطة SMS خدمة";
328
	$l_service_sms_n = "غير نشطة SMS خدمة";
344
	$l_acc_sms = "تسجيل ذاتي عن طريق SMS";
329
	$l_acc_sms = "تسجيل ذاتي عن طريق SMS";
345
	$l_explain_warn = "المسؤول أنشأ أرشيفاً تحتوي على سجلات الاتصال في إطار تحقيق قضائي";
330
	$l_explain_warn = "المسؤول أنشأ أرشيفاً تحتوي على سجلات الاتصال في إطار تحقيق قضائي";
346
	$understand_text = "أنا متفهم و أريد ان أواصل التصفح";
331
	$understand_text = "أنا متفهم و أريد ان أواصل التصفح";
347
	if(isset($_GET['url'])){
332
	if(isset($_GET['url'])){
348
		$l_continue_link = "<a href=\"index.php?redirect=1&url=".urlencode($_GET['url'])."\" class=\"button\">$understand_text</a>";
333
		$l_continue_link = "<a href=\"index.php?redirect=1&url=".urlencode($_GET['url'])."\" class=\"button\">$understand_text</a>";
349
	}
334
	}
350
	else{
335
	else{
351
		$l_continue_link = "<a href=\"index.php\" class=\"button\">$understand_text</a>";
336
		$l_continue_link = "<a href=\"index.php\" class=\"button\">$understand_text</a>";
352
	}
337
	}
353
	$l_title_warn = "عزيزي المستعمل, ";
338
	$l_title_warn = "عزيزي المستعمل, ";
354
	$l_explain_warn_name = "شخص مسمىٰ ";
339
	$l_explain_warn_name = "شخص مسمىٰ ";
355
	$l_explain_warn_ip = "تحت هذا IP: ";
340
	$l_explain_warn_ip = "تحت هذا IP: ";
356
	$l_explain_warn_date = "إطّلع على سجلات الاتصال الخاصة بك في";
341
	$l_explain_warn_date = "إطّلع على سجلات الاتصال الخاصة بك في";
357
	$l_explain_warn_reason = "السبب المسرّح به: ";
342
	$l_explain_warn_reason = "السبب المسرّح به: ";
358
	$l_uam_domain = ":المواقع المسموحة ";
343
	$l_uam_domain = ":المواقع المسموحة ";
359
}
344
}
360
else{
345
else{
361
	$l_access_denied = "Access control";
346
	$l_access_denied = "Access control";
362
	$l_access_welcome = "Welcome on ALCASAR";
347
	$l_access_welcome = "Welcome on ALCASAR";
363
	$l_access_unavailable = "ACCESS UNAVAILABLE";
348
	$l_access_unavailable = "ACCESS UNAVAILABLE";
364
	$l_required_domain = "Required WEB site";
349
	$l_required_domain = "Required WEB site";
365
	$l_explain_acc_access = "This center control the portal. You must have an administrative account.";
350
	$l_explain_acc_access = "This center control the portal. You must have an administrative account.";
366
	$l_explain_access_deny = "You try to connect to a resource whose content is deemed to contain inappropriate information.";
351
	$l_explain_access_deny = "You try to connect to a resource whose content is deemed to contain inappropriate information.";
367
	$l_explain_net_pb = "Your portal has just detected that the Internet access is down";
352
	$l_explain_net_pb = "Your portal has just detected that the Internet access is down";
368
	$l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
353
	$l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
369
	$l_contact_net_pb = "Contact your network responsive or your Internet provider for more information";
354
	$l_contact_net_pb = "Contact your network responsive or your Internet provider for more information";
370
	$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
355
	$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
371
	$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Install ALCASAR AC Certificate</a>";
356
	$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Install ALCASAR AC Certificate</a>";
372
	$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Install ALCASAR AC Certificate</a>";
357
	$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.der\">Install ALCASAR AC Certificate</a>";
373
	$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>";
358
	$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>";
374
	$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
359
	$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
375
	$l_category = "category :";
360
	$l_category = "category :";
376
	if ((isset ($user[4])) && ($user[4] == "0")){
361
	if ((isset ($user[4])) && ($user[4] == "0")){
377
		$l_logout_explain = "No Internet consultation session is actualy open on your system";
362
		$l_logout_explain = "No Internet consultation session is actualy open on your system";
378
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Open an Internet session</a>";
363
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Open an Internet session</a>";
379
	}
364
	}
380
	else{
365
	else{
381
		if ($user[5] != $user[0]){ # authentication exception or not
366
		if ($user[5] != $user[0]){ # authentication exception or not
382
			$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";
367
			$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";
383
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff from internet</a>";
368
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff from internet</a>";
384
		}
369
		}
385
		else{
370
		else{
386
			$l_logout_explain = "Your system ($user[5]) is in exception of authentication.<br><br>$nb_connection_history Last logins :$connection_history";
371
			$l_logout_explain = "Your system ($user[5]) is in exception of authentication.<br><br>$nb_connection_history Last logins :$connection_history";
387
			$l_logout = "Connections information";
372
			$l_logout = "Connections information";
388
		}
373
		}
389
	}
374
	}
390
	$l_password_change = "<a href=\"https://$hostname/pass\">Change your password</a>";
375
	$l_password_change = "<a href=\"https://$hostname/pass\">Change your password</a>";
391
	$l_password_change_explain = "Redirect you on password change page.<br><br> You should already have an Internet access account.";
376
	$l_password_change_explain = "Redirect you on password change page.<br><br> You should already have an Internet access account.";
392
	$l_sms_explain = "Redirect you on auto registration page.<br><br><strong>Login:</strong> your phone number<br><strong>Password:</strong> SMS content";
377
	$l_sms_explain = "Redirect you on auto registration page.<br><br><strong>Login:</strong> your phone number<br><strong>Password:</strong> SMS content";
393
	$l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
378
	$l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
394
	$l_service_sms = "SMS service enable";
379
	$l_service_sms = "SMS service enable";
395
	$l_service_sms_n = "SMS service disable";
380
	$l_service_sms_n = "SMS service disable";
396
	$l_acc_sms = "Auto registration by SMS";
381
	$l_acc_sms = "Auto registration by SMS";
397
	$l_explain_warn = "The administrator created an archive which contains your imputabilities logs for a judicial investigation.";
382
	$l_explain_warn = "The administrator created an archive which contains your imputabilities logs for a judicial investigation.";
398
	if(isset($_GET['url'])){
383
	if(isset($_GET['url'])){
399
		$l_continue_link = "<a href=\"index.php?redirect=1&url=".urlencode($_GET['url'])."\" class=\"button\">I understand and I wish to continue.</a>";
384
		$l_continue_link = "<a href=\"index.php?redirect=1&url=".urlencode($_GET['url'])."\" class=\"button\">I understand and I wish to continue.</a>";
400
	}
385
	}
401
	else{
386
	else{
402
		$l_continue_link = "<a href=\"index.php\" class=\"button\">I understand and I wish to continue.</a>";
387
		$l_continue_link = "<a href=\"index.php\" class=\"button\">I understand and I wish to continue.</a>";
403
	}
388
	}
404
	$l_title_warn="Dear user,";
389
	$l_title_warn="Dear user,";
405
	$l_explain_warn_name="Someone called ";
390
	$l_explain_warn_name="Someone called ";
406
	$l_explain_warn_ip="with this IP : ";
391
	$l_explain_warn_ip="with this IP : ";
407
	$l_explain_warn_date="has read your connexion logs at ";
392
	$l_explain_warn_date="has read your connexion logs at ";
408
	$l_explain_warn_reason="For this reason : ";
393
	$l_explain_warn_reason="For this reason : ";
409
	$l_uam_domain = "Authorized websites : ";
394
	$l_uam_domain = "Authorized websites : ";
410
}
395
}
411
 
396
 
412
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied));
397
$l_title   = ($direct_access ? $l_access_welcome     : ($network_pb ? $l_access_unavailable : $l_access_denied));
413
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny));
398
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb     : $l_explain_access_deny));
414
 
399
 
415
# set the icons
400
# set the icons
416
$img_rep = "/images/";
401
$img_rep = "/images/";
417
$img_organisme = "organisme.png";
402
$img_organisme = "organisme.png";
418
$img_access = "globe_acces_70.png";
403
$img_access = "globe_acces_70.png";
419
$img_connect = "globe_70.png";
404
$img_connect = "globe_70.png";
420
$img_warning = "globe_warning_70.png";
405
$img_warning = "globe_warning_70.png";
421
$img_pwd = "cle_ombre.png";
406
$img_pwd = "cle_ombre.png";
422
$img_certificate = "certificat.png";
407
$img_certificate = "certificat.png";
423
$img_acc = "logo-alcasar_70.png";
408
$img_acc = "logo-alcasar_70.png";
424
$img_sms = "sms.png";
409
$img_sms = "sms.png";
425
$img_false = "interdit.png";
410
$img_false = "interdit.png";
426
$img_adm = "adm.png";
411
$img_adm = "adm.png";
427
$img_internet = $img_connect;
412
$img_internet = $img_connect;
428
 
413
 
429
if ((isset ($user[4])) && ($user[4] == "0")){
414
if ((isset ($user[4])) && ($user[4] == "0")){
430
	if (! $network_pb){
415
	if (! $network_pb){
431
		$img_internet = $img_access;
416
		$img_internet = $img_access;
432
	}
417
	}
433
	else{
418
	else{
434
		$img_internet = $img_warning;
419
		$img_internet = $img_warning;
435
	}
420
	}
436
}
421
}
437
else{
422
else{
438
	$img_internet = $img_connect;
423
	$img_internet = $img_connect;
439
}
424
}
440
 
425
 
441
# cleaning the cache
426
# cleaning the cache
442
header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");
427
header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");
443
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
428
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
444
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
429
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
445
header("Cache-Control: post-check=0, pre-check=0", false);
430
header("Cache-Control: post-check=0, pre-check=0", false);
446
header("Pragma: no-cache");
431
header("Pragma: no-cache");
447
 
432
 
448
exec("sudo /usr/sbin/ipset list not_filtered | grep $remote_ip | wc -l 2>&1", $ipset_not_filtered);
-
 
449
# if user is in "ipset_not_filtered" then he must refresh its dns cache (we are in the interception process)
-
 
450
if (!$direct_access && !$display_menu && ($ipset_not_filtered[0] == '1') && (!$network_pb) && (!isset($_GET['warn']))) {
-
 
451
	echo '<!doctype html><html><head><script>window.location.reload(true)</script></head><body></body></html>'; # force DNS request
-
 
452
}
-
 
453
 
-
 
454
?>
433
?>
455
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
434
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
456
<html>
435
<html>
457
<head>
436
<head>
458
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
437
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
459
	<title>ALCASAR - <?php echo $l_title; ?></title>
438
	<title>ALCASAR - <?php echo $l_title; ?></title>
460
	<meta http-equiv="Cache-control" content="no-cache">
439
	<meta http-equiv="Cache-control" content="no-cache">
461
	<meta http-equiv="Pragma" content="no-cache">
440
	<meta http-equiv="Pragma" content="no-cache">
462
	<link rel="stylesheet" href="/css/style_intercept.css" type="text/css">
441
	<link rel="stylesheet" href="/css/style_intercept.css" type="text/css">
463
	<script type="text/javascript">
442
	<script type="text/javascript">
464
	function valoriserDiv5(param){
443
	function valoriserDiv5(param){
465
		document.getElementById("box_info").innerHTML = param.innerHTML;
444
		document.getElementById("box_info").innerHTML = param.innerHTML;
466
	}
445
	}
467
	</script>
446
	</script>
468
</head>
447
</head>
469
<body onload="valoriserDiv5(text_conn);">
448
<body onload="valoriserDiv5(text_conn);">
470
<?php
449
<?php
471
if ($direct_access || $display_menu){
450
if ($direct_access){
472
	echo "
451
	echo "
473
	<div id=\"cadre_titre\" class=\"titre_controle\">
452
	<div id=\"cadre_titre\" class=\"titre_controle\">
474
		<p id=\"acces_controle\" class=\"titre_controle\">$l_title</p>";
453
		<p id=\"acces_controle\" class=\"titre_controle\">$l_title</p>";
475
	if ($network_pb) {
454
	if ($network_pb) {
476
		echo "	<span>$l_explain_net_pb</span>";
455
		echo "	<span>$l_explain_net_pb</span>";
477
	}
456
	}
478
}
457
}
479
else{ # the user is intercepted
458
else{ # the user is intercepted
480
	# if user need to be warned that someone reads his logs
459
	# if user need to be warned that someone reads his logs
481
	if (isset($_GET['warn']) && isset($_GET['url']) && $_GET['warn'] == '1') {
460
	if (isset($_GET['warn']) && isset($_GET['url']) && $_GET['warn'] == '1') {
482
		echo "
461
		echo "
483
		<div id=\"cadre_titre\" class=\"titre_refus\">
462
		<div id=\"cadre_titre\" class=\"titre_refus\">
484
		<p id=\"acces_controle\" class=\"titre_refus\">$l_title_warn</p>";
463
		<p id=\"acces_controle\" class=\"titre_refus\">$l_title_warn</p>";
485
	}
464
	}
486
	else{ # the user is blacklisted (or whitelisted)
465
	else{ # the user is blacklisted (or whitelisted)
487
		echo "
466
		echo "
488
		<div id=\"cadre_titre\" class=\"titre_refus\">
467
		<div id=\"cadre_titre\" class=\"titre_refus\">
489
		<p id=\"acces_controle\" class=\"titre_refus\">$l_title</p>";
468
		<p id=\"acces_controle\" class=\"titre_refus\">$l_title</p>";
490
	}
469
	}
491
}
470
}
492
?>
471
?>
493
 
472
 
494
		<div id="boite_logo">
473
		<div id="boite_logo">
495
			<img src="<?php echo "$img_rep$img_organisme"; ?>">
474
			<img src="<?php echo "$img_rep$img_organisme"; ?>">
496
		</div>
475
		</div>
497
	</div>
476
	</div>
498
		<div id="contenu_acces">
477
		<div id="contenu_acces">
499
			<div id="box_url">
478
			<div id="box_url">
500
				<?php 
479
				<?php 
501
				// Search blacklist categories
480
				// Search blacklist categories
502
				if ((!$direct_access) && (!$display_menu) && (!$network_pb) && (!isset($_GET['warn']))) {
481
				if ((!$direct_access) && (!$network_pb) && (!isset($_GET['warn']))) {
503
					$pattern = str_replace('www.', '', $_SERVER['HTTP_HOST']);
482
					$pattern = str_replace('www.', '', $_SERVER['HTTP_HOST']);
504
					exec('grep -Re ' . escapeshellarg('^'.$pattern.'$') . " /etc/dansguardian/lists/blacklists/*/domains | cut -d'/' -f6", $output);
483
					exec('grep -Re ' . escapeshellarg('^'.$pattern.'$') . " /etc/dansguardian/lists/blacklists/*/domains | cut -d'/' -f6", $output);
505
					$lists = [];
484
					$lists = [];
506
					foreach ($output as $line) {
485
					foreach ($output as $line) {
507
						$lists[] = $line;
486
						$lists[] = $line;
508
					}
487
					}
509
 
488
 
510
					echo $l_required_domain.' : '.htmlspecialchars($_SERVER['HTTP_HOST']);
489
					echo $l_required_domain.' : '.htmlspecialchars($_SERVER['HTTP_HOST']);
511
					if (!empty($lists)) {
490
					if (!empty($lists)) {
512
						echo "<br>$l_category ".implode(', ', $lists);
491
						echo "<br>$l_category ".implode(', ', $lists);
513
					}
492
					}
514
				}
493
				}
515
				?>
494
				?>
516
			</div>
495
			</div>
517
<?php
496
<?php
518
# Check if the SMS service is enable
497
# Check if the SMS service is enable
519
$service_SMS_status="false";
498
$service_SMS_status="false";
520
if ($service_SMS_status == "true"){
499
if ($service_SMS_status == "true"){
521
	$sms_div='
500
	$sms_div='
522
		<div class="box_menu" id="box_acc" onmouseover="valoriserDiv5(text_acc);">
501
		<div class="box_menu" id="box_acc" onmouseover="valoriserDiv5(text_acc);">
523
			<span>'.$l_sms_access.'</span>
502
			<span>'.$l_sms_access.'</span>
524
			<img src="'.$img_rep.''.$img_sms.'">
503
			<img src="'.$img_rep.''.$img_sms.'">
525
		</div>
504
		</div>
526
';
505
';
527
 
506
 
528
$sms_div_over='
507
$sms_div_over='
529
		<div class="div-cache" id="text_acc">
508
		<div class="div-cache" id="text_acc">
530
			<h2>'.$l_sms_access.'</h2>
509
			<h2>'.$l_sms_access.'</h2>
531
			<p>'.$l_sms_explain.'</p>
510
			<p>'.$l_sms_explain.'</p>
532
			<p><font color="green"><center>'.$l_service_sms.'</center></font></p>
511
			<p><font color="green"><center>'.$l_service_sms.'</center></font></p>
533
			<img src="'.$img_rep.''.$img_sms.'">
512
			<img src="'.$img_rep.''.$img_sms.'">
534
		</div>
513
		</div>
535
';
514
';
536
}
515
}
537
else {
516
else {
538
	$sms_div='';
517
	$sms_div='';
539
	$sms_div_over='';
518
	$sms_div_over='';
540
}
519
}
541
if ($direct_access || $display_menu){
520
if ($direct_access) {
542
	if (!$network_pb){
521
	if (!$network_pb) {
543
	       	echo "
522
		echo "
544
		<div class=\"box_menu\" id=\"box_conn\" onmouseover=\"valoriserDiv5(text_conn);\">
523
		<div class=\"box_menu\" id=\"box_conn\" onmouseover=\"valoriserDiv5(text_conn);\">
545
			<span>$l_logout</span>
524
			<span>$l_logout</span>
546
			<img src=\"$img_rep$img_internet\">
525
			<img src=\"$img_rep$img_internet\">
547
		</div>";
526
		</div>";
548
	}
527
	}
549
 
528
 
550
	// Read the "Domain allowed" file
529
	// Read the "Domain allowed" file
551
	$domainAllowedHtml = '';
530
	$domainAllowedHtml = '';
552
	$tab = file(DOMAIN_ALLOWED_LIST);
531
	$tab = file(DOMAIN_ALLOWED_LIST);
553
	if ($tab) { // the file isn't empty
532
	if ($tab) { // the file isn't empty
554
		$domainAllowedHtml .= '<p>'.$l_uam_domain.'<br><ul>';
533
		$domainAllowedHtml .= '<p>'.$l_uam_domain.'<br><ul>';
555
		foreach ($tab as $line) {
534
		foreach ($tab as $line) {
556
			if (trim($line) !== '') { // the line isn't empty
535
			if (trim($line) !== '') { // the line isn't empty
557
				$domain_allowed = explode("#", $line);
536
				$domain_allowed = explode('#', $line);
558
				if (trim($domain_allowed[1]) !== '') {
537
				if (trim($domain_allowed[1]) !== '') {
559
					$domain = explode('"', $domain_allowed[0]);
538
					$domain = explode('"', $domain_allowed[0]);
560
					// remove every '.' from the beginning of domain
539
					// remove every '.' from the beginning of domain
561
					$domain[1] = ltrim($domain[1], '.');
540
					$domain[1] = ltrim($domain[1], '.');
562
					$domainAllowedHtml .= '<li><a href="http://'.trim($domain[1]).'">'.trim($domain_allowed[1]).'</a></li>';
541
					$domainAllowedHtml .= '<li><a href="http://'.trim($domain[1]).'">'.trim($domain_allowed[1]).'</a></li>';
563
				}
542
				}
564
			}
543
			}
565
		}
544
		}
566
		$domainAllowedHtml .= '</ul></p>';
545
		$domainAllowedHtml .= '</ul></p>';
567
	}
546
	}
568
 
547
 
569
	echo "
548
	echo "
570
		<div class=\"box_menu\" id=\"box_certif\" onmouseover=\"valoriserDiv5(text_certif);\">
549
		<div class=\"box_menu\" id=\"box_certif\" onmouseover=\"valoriserDiv5(text_certif);\">
571
			<span>$l_install_certif</span>
550
			<span>$l_install_certif</span>
572
			<img src=\"$img_rep$img_certificate\">
551
			<img src=\"$img_rep$img_certificate\">
573
		</div>
552
		</div>
574
		<div class=\"box_menu\" id=\"box_mdp\" onmouseover=\"valoriserDiv5(text_mdp);\">
553
		<div class=\"box_menu\" id=\"box_mdp\" onmouseover=\"valoriserDiv5(text_mdp);\">
575
			<img src=\"$img_rep$img_pwd\">
554
			<img src=\"$img_rep$img_pwd\">
576
			<span>$l_password_change</span>
555
			<span>$l_password_change</span>
577
		</div>		
556
		</div>		
578
		$sms_div
557
		$sms_div
579
		<div class=\"div-cache\" id=\"text_conn\">
558
		<div class=\"div-cache\" id=\"text_conn\">
580
			<h2>$l_logout</h2>
559
			<h2>$l_logout</h2>
581
			<p>$l_logout_explain</p>
560
			<p>$l_logout_explain</p>
582
			$domainAllowedHtml
561
			$domainAllowedHtml
583
			<img src=\"$img_rep$img_internet\">
562
			<img src=\"$img_rep$img_internet\">
584
		</div>
563
		</div>
585
		<div class=\"div-cache\" id=\"text_certif\">
564
		<div class=\"div-cache\" id=\"text_certif\">
586
			<h2>$l_install_certif_more</h2>
565
			<h2>$l_install_certif_more</h2>
587
			<p>$l_certif_explain $l_certif_explain_help</p>
566
			<p>$l_certif_explain $l_certif_explain_help</p>
588
			<img src=\"$img_rep$img_certificate\">				
567
			<img src=\"$img_rep$img_certificate\">				
589
		</div>
568
		</div>
590
		<div class=\"div-cache\" id=\"text_mdp\">
569
		<div class=\"div-cache\" id=\"text_mdp\">
591
			<h2>$l_password_change</h2>
570
			<h2>$l_password_change</h2>
592
			<p>$l_password_change_explain</p>
571
			<p>$l_password_change_explain</p>
593
			<img src=\"$img_rep$img_pwd\">
572
			<img src=\"$img_rep$img_pwd\">
594
		</div>
573
		</div>
595
		$sms_div_over
574
		$sms_div_over
596
		<div id=\"box_info\">
575
		<div id=\"box_info\">
597
		</div>";
576
		</div>";
598
}
577
}
599
else {
578
else {
600
	# user need to be warned that someone reads his logs
579
	# user need to be warned that someone reads his logs
601
	if(isset($_GET['warn']) && isset($_GET['url']) && $_GET['warn'] === '1'){
580
	if(isset($_GET['warn']) && isset($_GET['url']) && $_GET['warn'] === '1'){
602
		$filename = '/var/www/html/acc/backup/log_info.txt';
581
		$filename = '/var/www/html/acc/backup/log_info.txt';
603
		$l_explain_warn = '';
582
		$l_explain_warn = '';
604
		if (file_exists($filename)) {
583
		if (file_exists($filename)) {
605
			$fichier = fopen($filename, 'r');
584
			$fichier = fopen($filename, 'r');
606
			$content = file($filename);
585
			$content = file($filename);
607
			foreach ($content as $line) {
586
			foreach ($content as $line) {
608
				$infos = explode('|||', $line);
587
				$infos = explode('|||', $line);
609
				$log_date   = $infos[0];	
588
				$log_date   = $infos[0];	
610
				$log_user   = $infos[1];	
589
				$log_user   = $infos[1];	
611
				$log_reason = $infos[2];	
590
				$log_reason = $infos[2];	
612
				$log_ip     = $infos[3];	
591
				$log_ip     = $infos[3];	
613
			}
592
			}
614
			$l_explain_warn = "$l_explain_warn_name$log_user ($l_explain_warn_ip$log_ip) $l_explain_warn_date$log_date.<br>$l_explain_warn_reason<br>$log_reason";
593
			$l_explain_warn = "$l_explain_warn_name$log_user ($l_explain_warn_ip$log_ip) $l_explain_warn_date$log_date.<br>$l_explain_warn_reason<br>$log_reason";
615
		}
594
		}
616
		else{
595
		else{
617
			echo "Log error!";
596
			echo "Log error!";
618
		}
597
		}
619
		echo "
598
		echo "
620
			<div id=\"box_refuse\">
599
			<div id=\"box_refuse\">
621
				<img src=\"$img_rep$img_warning\">
600
				<img src=\"$img_rep$img_warning\">
622
				<p>$l_explain_warn</p>
601
				<p>$l_explain_warn</p>
623
			</div>
602
			</div>
624
			<div id=\"liens_redir\">
603
			<div id=\"liens_redir\">
625
				<p>$l_continue_link</p>
604
				<p>$l_continue_link</p>
626
			</div>";
605
			</div>";
627
	}
606
	}
628
	else{
607
	else{
629
		echo "
608
		echo "
630
			<div id=\"box_refuse\">
609
			<div id=\"box_refuse\">
631
				<img src=\"$img_rep$img_false\">
610
				<img src=\"$img_rep$img_false\">
632
				<p>$l_explain</p>
611
				<p>$l_explain</p>
633
			</div>
612
			</div>
634
			<div id=\"liens_redir\">
613
			<div id=\"liens_redir\">
635
				<p>$l_back_page</p>
614
				<p>$l_back_page</p>
636
			</div>";
615
			</div>";
637
	}
616
	}
638
}
617
}
639
	if (($network_pb)&&(! $direct_access)) {
618
	if (($network_pb)&&(! $direct_access)) {
640
		echo "	<span>Diagnostic : $diagnostic</span>";
619
		echo "	<span>Diagnostic : $diagnostic</span>";
641
	}
620
	}
642
	echo "</div>";
621
	echo "</div>";
643
	if($direct_access){ # display the admin logo (wheel) at the bottom right
622
	if($direct_access){ # display the admin logo (wheel) at the bottom right
644
		echo "<div id=\"corner\">";
623
		echo "<div id=\"corner\">";
645
		echo "<div id=\"adm\" class=\"corn\">";
624
		echo "<div id=\"adm\" class=\"corn\">";
646
		echo "<a href=\"https://$hostname/acc/\"><img src=\"$img_rep$img_adm\"></a>";
625
		echo "<a href=\"https://$hostname/acc/\"><img src=\"$img_rep$img_adm\"></a>";
647
		echo "</div>";
626
		echo "</div>";
648
		echo "</div>";
627
		echo "</div>";
649
	}
628
	}
650
?>
629
?>
651
	</body>
630
	</body>
652
</html>
631
</html>
653
 
632