1 |
<?php
|
1 |
<?php
|
2 |
# $Id: index.php 1508 2014-11-30 18:19:16Z richard $
|
2 |
# $Id: index.php 1521 2014-12-17 22:57:44Z richard $
|
3 |
#
|
3 |
#
|
4 |
# index.php for ALCASAR captive portal
|
4 |
# index.php for ALCASAR captive portal
|
5 |
# by REXY
|
5 |
# by REXY
|
6 |
# UI & css style by stephane ERARD
|
6 |
# UI & css style by stephane ERARD
|
7 |
# The contents of this file may be used under the terms of the GNU
|
7 |
# The contents of this file may be used under the terms of the GNU
|
8 |
# General Public License Version 2, provided that the above copyright
|
8 |
# General Public License Version 2, provided that the above copyright
|
9 |
# notice and this permission notice is included in all copies or
|
9 |
# notice and this permission notice is included in all copies or
|
10 |
# substantial portions of the software.
|
10 |
# substantial portions of the software.
|
11 |
/****************************************************************
|
11 |
/****************************************************************
|
12 |
* GLOBAL FILE PATHS *
|
12 |
* GLOBAL FILE PATHS *
|
13 |
*****************************************************************/
|
13 |
*****************************************************************/
|
14 |
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
|
14 |
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
|
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 |
$ouvre=fopen(CONF_FILE,"r");
|
31 |
$ouvre=fopen(CONF_FILE,"r");
|
32 |
if ($ouvre){
|
32 |
if ($ouvre){
|
33 |
while (!feof ($ouvre))
|
33 |
while (!feof ($ouvre))
|
34 |
{
|
34 |
{
|
35 |
$tampon = fgets($ouvre, 4096);
|
35 |
$tampon = fgets($ouvre, 4096);
|
36 |
if (strpos($tampon,"=")!==false){
|
36 |
if (strpos($tampon,"=")!==false){
|
37 |
$tmp = explode("=",$tampon);
|
37 |
$tmp = explode("=",$tampon);
|
38 |
$conf[$tmp[0]] = $tmp[1];
|
38 |
$conf[$tmp[0]] = $tmp[1];
|
39 |
}
|
39 |
}
|
40 |
}
|
40 |
}
|
41 |
}else{
|
41 |
}else{
|
42 |
exit("Error opening the file ".CONF_FILE);
|
42 |
exit("Error opening the file ".CONF_FILE);
|
43 |
}
|
43 |
}
|
44 |
fclose($ouvre);
|
44 |
fclose($ouvre);
|
45 |
$organisme = trim($conf["ORGANISM"]);
|
45 |
$organisme = trim($conf["ORGANISM"]);
|
46 |
$domainname = trim($conf["DOMAIN"]);
|
46 |
$domainname = trim($conf["DOMAIN"]);
|
47 |
$hostname = "alcasar.".$domainname;
|
47 |
$hostname = "alcasar.".$domainname;
|
48 |
$network_pb = False;
|
48 |
$network_pb = False;
|
49 |
$cert_add = "http://$hostname/certs";
|
49 |
$cert_add = "http://$hostname/certs";
|
50 |
$direct_access = False;
|
50 |
$direct_access = False;
|
51 |
$diagnostic = "can't contact the default router";
|
51 |
$diagnostic = "can't contact the default router";
|
52 |
$remote_ip = preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : "";
|
52 |
$remote_ip = preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : "";
|
53 |
$tab = array();$user = array();
|
53 |
$tab = array();$user = array();
|
54 |
$connection_history = "";
|
54 |
$connection_history = "";
|
55 |
$nb_connection_history = 3;
|
55 |
$nb_connection_history = 3;
|
56 |
|
56 |
|
57 |
# on discrimine les accès directs sur Alcasar par rapport aux redirections (blacklist ou pannes rso)
|
57 |
# on discrimine les accès directs sur Alcasar par rapport aux redirections (blacklist ou pannes rso)
|
58 |
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']))
|
58 |
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']))
|
59 |
{
|
59 |
{
|
60 |
$direct_access=True;
|
60 |
$direct_access=True;
|
61 |
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
|
61 |
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
|
62 |
$user = explode (" ", $tab[0]);
|
62 |
$user = explode (" ", $tab[0]);
|
63 |
}
|
63 |
}
|
64 |
#### Affichage des 3 dernières connexions de $user[5]
|
64 |
#### Affichage des 3 dernières connexions de $user[5]
|
65 |
function secondsToDuration($seconds = null){
|
65 |
function secondsToDuration($seconds = null){
|
66 |
if ($seconds == null) return "";
|
66 |
if ($seconds == null) return "";
|
67 |
|
67 |
|
68 |
$temp = $seconds % 3600;
|
68 |
$temp = $seconds % 3600;
|
69 |
$time[0] = ( $seconds - $temp ) / 3600 ; // hours
|
69 |
$time[0] = ( $seconds - $temp ) / 3600 ; // hours
|
70 |
$time[2] = $temp % 60 ; // seconds
|
70 |
$time[2] = $temp % 60 ; // seconds
|
71 |
$time[1] = ( $temp - $time[2] ) / 60; // minutes
|
71 |
$time[1] = ( $temp - $time[2] ) / 60; // minutes
|
72 |
|
72 |
|
73 |
return $time[0]." h ".$time[1]." m ".$time[2]." s";
|
73 |
return $time[0]." h ".$time[1]." m ".$time[2]." s";
|
74 |
}
|
74 |
}
|
75 |
|
75 |
|
76 |
$l_connected = "connected"; // a traduire (choix de la langue ci-dessous mais nécessitant de $connection_history)
|
76 |
$l_connected = "connected"; // a traduire (choix de la langue ci-dessous mais nécessitant de $connection_history)
|
77 |
// si on a pas d'accès à la bdd, la page s'affiche quand même correctement
|
77 |
// si on a pas d'accès à la bdd, la page s'affiche quand même correctement
|
78 |
if ((isset ($user[4])) && ($user[4] != "0")){
|
78 |
if ((isset ($user[4])) && ($user[4] != "0")){
|
79 |
if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
|
79 |
if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
|
80 |
include_once("/etc/freeradius-web/config.php");
|
80 |
include_once("/etc/freeradius-web/config.php");
|
81 |
include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
|
81 |
include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
|
82 |
|
82 |
|
83 |
$sql = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' ORDER BY AcctStartTime DESC LIMIT 0 , $nb_connection_history";
|
83 |
$sql = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' ORDER BY AcctStartTime DESC LIMIT 0 , $nb_connection_history";
|
84 |
$link = @da_sql_pconnect($config); // on affiche pas les erreurs
|
84 |
$link = @da_sql_pconnect($config); // on affiche pas les erreurs
|
85 |
|
85 |
|
86 |
if ($link){
|
86 |
if ($link){
|
87 |
$res = @da_sql_query($link,$config,$sql); // on affiche pas les erreurs
|
87 |
$res = @da_sql_query($link,$config,$sql); // on affiche pas les erreurs
|
88 |
|
88 |
|
89 |
if ($res){
|
89 |
if ($res){
|
90 |
$connection_history.= "<ul>";
|
90 |
$connection_history.= "<ul>";
|
91 |
while(($row = @da_sql_fetch_array($res,$config))){
|
91 |
while(($row = @da_sql_fetch_array($res,$config))){
|
92 |
$connected = "";
|
92 |
$connected = "";
|
93 |
if ($row[acctstoptime] == "") $connected = " ($l_connected)";
|
93 |
if ($row['acctstoptime'] == "") $connected = " ($l_connected)";
|
94 |
$connection_history.="<li title='$row[username] $row[acctstarttime] $row[acctstoptime] (".secondsToDuration($row[acctsessiontime]).")'>$row[acctstarttime] (".secondsToDuration($row[acctsessiontime]).") $connected</li>";
|
94 |
$connection_history.="<li title='$row[username] $row[acctstarttime] $row[acctstoptime] (".secondsToDuration($row['acctsessiontime']).")'>$row[acctstarttime] (".secondsToDuration($row[acctsessiontime]).") $connected</li>";
|
95 |
}
|
95 |
}
|
96 |
$connection_history.="</ul>";
|
96 |
$connection_history.="</ul>";
|
97 |
}
|
97 |
}
|
98 |
}
|
98 |
}
|
99 |
}
|
99 |
}
|
100 |
}
|
100 |
}
|
101 |
####
|
101 |
####
|
102 |
|
102 |
|
103 |
# Choice of language
|
103 |
# Choice of language
|
104 |
$Language = 'en';
|
104 |
$Language = 'en';
|
105 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
105 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
106 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
106 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
107 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
107 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
108 |
if($Language == 'fr'){
|
108 |
if($Language == 'fr'){
|
109 |
$l_access_denied = "ACCÈS REFUSÉ";
|
109 |
$l_access_denied = "ACCÈS REFUSÉ";
|
110 |
$l_access_welcome = "Bienvenue sur ALCASAR";
|
110 |
$l_access_welcome = "Bienvenue sur ALCASAR";
|
111 |
$l_access_unavailable = "ACCÈS INDISPONIBLE";
|
111 |
$l_access_unavailable = "ACCÈS INDISPONIBLE";
|
112 |
$l_required_domain = "Site WEB demandé";
|
112 |
$l_required_domain = "Site WEB demandé";
|
113 |
$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.";
|
113 |
$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.";
|
114 |
$l_explain_access_deny = "Vous tentez d'accéder à une ressource dont le contenu est réputé contenir des informations inappropriées.";
|
114 |
$l_explain_access_deny = "Vous tentez d'accéder à une ressource dont le contenu est réputé contenir des informations inappropriées.";
|
115 |
$l_explain_net_pb = "Votre portail détecte que l'accès à Internet est indisponible.";
|
115 |
$l_explain_net_pb = "Votre portail détecte que l'accès à Internet est indisponible.";
|
116 |
$l_contact_access_deny = "Contactez le responsable de la sécurité (OSSI/RSSI) si vous pensez que ce filtrage est abusif.";
|
116 |
$l_contact_access_deny = "Contactez le responsable de la sécurité (OSSI/RSSI) si vous pensez que ce filtrage est abusif.";
|
117 |
$l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information.";
|
117 |
$l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information.";
|
118 |
$l_welcome = "Page principale de votre portail captif";
|
118 |
$l_welcome = "Page principale de votre portail captif";
|
119 |
$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Enregistrement par SMS</a>";
|
119 |
$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Enregistrement par SMS</a>";
|
120 |
$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Installer le certificat racine</a>";
|
120 |
$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Installer le certificat racine</a>";
|
121 |
$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Installation du certificat de l'autorité racine d'ALCASAR</a>";
|
121 |
$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Installation du certificat de l'autorité racine d'ALCASAR</a>";
|
122 |
$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>";
|
122 |
$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>";
|
123 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Aide complémentaire</a>";
|
123 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Aide complémentaire</a>";
|
124 |
$l_category = "catégorie :";
|
124 |
$l_category = "catégorie :";
|
125 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
125 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
126 |
$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système.";
|
126 |
$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système.";
|
127 |
$l_logout = "<a href=\"http://www.qwant.com\">Ouvrir une session Internet</a>";}
|
127 |
$l_logout = "<a href=\"http://www.qwant.com\">Ouvrir une session Internet</a>";}
|
128 |
else {
|
128 |
else {
|
129 |
if ($user[5] != $user[0]) // authentication exception or not
|
129 |
if ($user[5] != $user[0]) // authentication exception or not
|
130 |
{
|
130 |
{
|
131 |
$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";
|
131 |
$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";
|
132 |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Se déconnecter d'internet</a>";
|
132 |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Se déconnecter d'internet</a>";
|
133 |
}
|
133 |
}
|
134 |
else
|
134 |
else
|
135 |
{
|
135 |
{
|
136 |
$l_logout_explain = "Votre système ($user[5]) est en exception d'authentication.<br><br>$nb_connection_history last connections :$connection_history";
|
136 |
$l_logout_explain = "Votre système ($user[5]) est en exception d'authentication.<br><br>$nb_connection_history last connections :$connection_history";
|
137 |
$l_logout = "Information des connexions";
|
137 |
$l_logout = "Information des connexions";
|
138 |
}
|
138 |
}
|
139 |
}
|
139 |
}
|
140 |
$l_password_change = "<a href=\"https://$hostname/pass\">Changer votre mot de passe</a>";
|
140 |
$l_password_change = "<a href=\"https://$hostname/pass\">Changer votre mot de passe</a>";
|
141 |
$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.";
|
141 |
$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.";
|
142 |
$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";
|
142 |
$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";
|
143 |
$l_back_page = "<a href=\"javascript:history.back()\">Page précédente</a>";
|
143 |
$l_back_page = "<a href=\"javascript:history.back()\">Page précédente</a>";
|
144 |
$l_service_sms = "Service SMS actif";
|
144 |
$l_service_sms = "Service SMS actif";
|
145 |
$l_service_sms_n = "Service SMS non actif";
|
145 |
$l_service_sms_n = "Service SMS non actif";
|
146 |
$l_acc_sms = "Auto enregistrement par SMS";
|
146 |
$l_acc_sms = "Auto enregistrement par SMS";
|
147 |
}
|
147 |
}
|
148 |
else if($Language == 'pt'){
|
148 |
else if($Language == 'pt'){
|
149 |
$l_access_denied = "Acesso negado";
|
149 |
$l_access_denied = "Acesso negado";
|
150 |
$l_access_welcome = "Bem-vindo ao Alcasar";
|
150 |
$l_access_welcome = "Bem-vindo ao Alcasar";
|
151 |
$l_access_unavailable = "ACESSO INDISPONÍVEL";
|
151 |
$l_access_unavailable = "ACESSO INDISPONÍVEL";
|
152 |
$l_required_domain = "Site WEB Obrigatório";
|
152 |
$l_required_domain = "Site WEB Obrigatório";
|
153 |
$l_explain_acc_access = "Este é o centro de controle do portal para acessar você deve ter uma conta administrativa valida.";
|
153 |
$l_explain_acc_access = "Este é o centro de controle do portal para acessar você deve ter uma conta administrativa valida.";
|
154 |
$l_explain_access_deny = "Você tenta se conectar a um recurso cujo conteúdo é considerado inadequado no conteúdo de informações.";
|
154 |
$l_explain_access_deny = "Você tenta se conectar a um recurso cujo conteúdo é considerado inadequado no conteúdo de informações.";
|
155 |
$l_explain_net_pb = "O sistema detectou que o acesso é de risco, não será permitido o acesso";
|
155 |
$l_explain_net_pb = "O sistema detectou que o acesso é de risco, não será permitido o acesso";
|
156 |
$l_contact_access_deny = "Entre em contato com o administrador do sistema de segurança se acha que essa filtragem é abusiva.";
|
156 |
$l_contact_access_deny = "Entre em contato com o administrador do sistema de segurança se acha que essa filtragem é abusiva.";
|
157 |
$l_contact_net_pb = "Entre em contato com a empresa fornecedora de Internet para mais informações";
|
157 |
$l_contact_net_pb = "Entre em contato com a empresa fornecedora de Internet para mais informações";
|
158 |
$l_welcome = "Página do portal";
|
158 |
$l_welcome = "Página do portal";
|
159 |
$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
|
159 |
$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
|
160 |
$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Instalar Certificado Alcasar AC</a>";
|
160 |
$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Instalar Certificado Alcasar AC</a>";
|
161 |
$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.cert\">Instalar Certificado Alcasar AC</a>";
|
161 |
$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.cert\">Instalar Certificado Alcasar AC</a>";
|
162 |
$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>";
|
162 |
$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>";
|
163 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Essa foi uma ajuda complementar</a>";
|
163 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Essa foi uma ajuda complementar</a>";
|
164 |
$l_category = "categoria :";
|
164 |
$l_category = "categoria :";
|
165 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
165 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
166 |
$l_logout_explain = "Não há conexão de Internet aberta em seu computador, deseja conectar?";
|
166 |
$l_logout_explain = "Não há conexão de Internet aberta em seu computador, deseja conectar?";
|
167 |
$l_logout = "<a href=\"http://www.qwant.com\">Abrir uma conexão de Internet</a>";}
|
167 |
$l_logout = "<a href=\"http://www.qwant.com\">Abrir uma conexão de Internet</a>";}
|
168 |
else {
|
168 |
else {
|
169 |
if ($user[5] != $user[0]) // authentication exception or not
|
169 |
if ($user[5] != $user[0]) // authentication exception or not
|
170 |
{
|
170 |
{
|
171 |
$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";
|
171 |
$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";
|
172 |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Sair da Internet</a>";
|
172 |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Sair da Internet</a>";
|
173 |
}
|
173 |
}
|
174 |
else
|
174 |
else
|
175 |
{
|
175 |
{
|
176 |
$l_logout_explain = "O sistema ($user[5]) detctou exesso de autenticação.<br><br>$nb_connection_history logins últimos :$connection_history";
|
176 |
$l_logout_explain = "O sistema ($user[5]) detctou exesso de autenticação.<br><br>$nb_connection_history logins últimos :$connection_history";
|
177 |
$l_logout = "Informações de conexões";
|
177 |
$l_logout = "Informações de conexões";
|
178 |
}
|
178 |
}
|
179 |
}
|
179 |
}
|
180 |
$l_password_change = "<a href=\"https://$hostname/pass\">Mudar sua senha</a>";
|
180 |
$l_password_change = "<a href=\"https://$hostname/pass\">Mudar sua senha</a>";
|
181 |
$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.";
|
181 |
$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.";
|
182 |
$l_sms_explain = "Redirect you on auto registration page.<br><br><strong>Login:</strong> your phone number<br><strong>Password:</strong> SMS content";
|
182 |
$l_sms_explain = "Redirect you on auto registration page.<br><br><strong>Login:</strong> your phone number<br><strong>Password:</strong> SMS content";
|
183 |
$l_back_page = "<a href=\"javascript:history.back()\">Página anterior</a>";
|
183 |
$l_back_page = "<a href=\"javascript:history.back()\">Página anterior</a>";
|
184 |
$l_service_sms = "SMS service enable";
|
184 |
$l_service_sms = "SMS service enable";
|
185 |
$l_service_sms_n = "SMS service disable";
|
185 |
$l_service_sms_n = "SMS service disable";
|
186 |
$l_acc_sms = "Auto registration by SMS";
|
186 |
$l_acc_sms = "Auto registration by SMS";
|
187 |
}
|
187 |
}
|
188 |
else {
|
188 |
else {
|
189 |
$l_access_denied = "ACCESS DENIED";
|
189 |
$l_access_denied = "ACCESS DENIED";
|
190 |
$l_access_welcome = "Welcome on ALCASAR";
|
190 |
$l_access_welcome = "Welcome on ALCASAR";
|
191 |
$l_access_unavailable = "ACCESS UNAVAILABLE";
|
191 |
$l_access_unavailable = "ACCESS UNAVAILABLE";
|
192 |
$l_required_domain = "Required WEB site";
|
192 |
$l_required_domain = "Required WEB site";
|
193 |
$l_explain_acc_access = "This center control the portal. You must have an administrative account.";
|
193 |
$l_explain_acc_access = "This center control the portal. You must have an administrative account.";
|
194 |
$l_explain_access_deny = "You try to connect to a resource whose content is deemed to contain inappropriate information.";
|
194 |
$l_explain_access_deny = "You try to connect to a resource whose content is deemed to contain inappropriate information.";
|
195 |
$l_explain_net_pb = "Your portal has just detected that the Internet access is down";
|
195 |
$l_explain_net_pb = "Your portal has just detected that the Internet access is down";
|
196 |
$l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
|
196 |
$l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
|
197 |
$l_contact_net_pb = "Contact your network responsive or your Internet provider for more information";
|
197 |
$l_contact_net_pb = "Contact your network responsive or your Internet provider for more information";
|
198 |
$l_welcome = "Your captive portal main page";
|
198 |
$l_welcome = "Your captive portal main page";
|
199 |
$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
|
199 |
$l_sms_access = "<a href=\"https://$hostname/autoregistrationinfo.php\">Auto Registration by SMS</a>";
|
200 |
$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Install ALCASAR AC Certificate</a>";
|
200 |
$l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Install ALCASAR AC Certificate</a>";
|
201 |
$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.cert\">Install ALCASAR AC Certificate</a>";
|
201 |
$l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.cert\">Install ALCASAR AC Certificate</a>";
|
202 |
$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>";
|
202 |
$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>";
|
203 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
|
203 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
|
204 |
$l_category = "category :";
|
204 |
$l_category = "category :";
|
205 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
205 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
206 |
$l_logout_explain = "No Internet consultation session is actualy open on your system";
|
206 |
$l_logout_explain = "No Internet consultation session is actualy open on your system";
|
207 |
$l_logout = "<a href=\"http://www.qwant.com\">Open an Internet session</a>";}
|
207 |
$l_logout = "<a href=\"http://www.qwant.com\">Open an Internet session</a>";}
|
208 |
else {
|
208 |
else {
|
209 |
if ($user[5] != $user[0]) // authentication exception or not
|
209 |
if ($user[5] != $user[0]) // authentication exception or not
|
210 |
{
|
210 |
{
|
211 |
$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";
|
211 |
$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";
|
212 |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff from internet</a>";
|
212 |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff from internet</a>";
|
213 |
}
|
213 |
}
|
214 |
else
|
214 |
else
|
215 |
{
|
215 |
{
|
216 |
$l_logout_explain = "Your system ($user[5]) is in exception of authentication.<br><br>$nb_connection_history Last logins :$connection_history";
|
216 |
$l_logout_explain = "Your system ($user[5]) is in exception of authentication.<br><br>$nb_connection_history Last logins :$connection_history";
|
217 |
$l_logout = "Connections information";
|
217 |
$l_logout = "Connections information";
|
218 |
}
|
218 |
}
|
219 |
}
|
219 |
}
|
220 |
$l_password_change = "<a href=\"https://$hostname/pass\">Change your password</a>";
|
220 |
$l_password_change = "<a href=\"https://$hostname/pass\">Change your password</a>";
|
221 |
$l_password_change_explain = "Redirect you on password change page.<br><br> You should already have an Internet access account.";
|
221 |
$l_password_change_explain = "Redirect you on password change page.<br><br> You should already have an Internet access account.";
|
222 |
$l_sms_explain = "Redirect you on auto registration page.<br><br><strong>Login:</strong> your phone number<br><strong>Password:</strong> SMS content";
|
222 |
$l_sms_explain = "Redirect you on auto registration page.<br><br><strong>Login:</strong> your phone number<br><strong>Password:</strong> SMS content";
|
223 |
$l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
|
223 |
$l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
|
224 |
$l_service_sms = "SMS service enable";
|
224 |
$l_service_sms = "SMS service enable";
|
225 |
$l_service_sms_n = "SMS service disable";
|
225 |
$l_service_sms_n = "SMS service disable";
|
226 |
$l_acc_sms = "Auto registration by SMS";
|
226 |
$l_acc_sms = "Auto registration by SMS";
|
227 |
}
|
227 |
}
|
228 |
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied));
|
228 |
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied));
|
229 |
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny));
|
229 |
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny));
|
230 |
|
230 |
|
231 |
# Attribution des icones / images
|
231 |
# Attribution des icones / images
|
232 |
$img_rep = "images/";
|
232 |
$img_rep = "images/";
|
233 |
$img_organisme = "organisme.png";
|
233 |
$img_organisme = "organisme.png";
|
234 |
$img_access = "globe_acces_70.png";
|
234 |
$img_access = "globe_acces_70.png";
|
235 |
$img_connect = "globe_70.png";
|
235 |
$img_connect = "globe_70.png";
|
236 |
$img_warning = "globe_warning_70.png";
|
236 |
$img_warning = "globe_warning_70.png";
|
237 |
$img_pwd = "cle_ombre.png";
|
237 |
$img_pwd = "cle_ombre.png";
|
238 |
$img_certificate = "certificat.png";
|
238 |
$img_certificate = "certificat.png";
|
239 |
$img_acc = "logo-alcasar_70.png";
|
239 |
$img_acc = "logo-alcasar_70.png";
|
240 |
$img_sms = "sms.png";
|
240 |
$img_sms = "sms.png";
|
241 |
$img_false = "interdit.png";
|
241 |
$img_false = "interdit.png";
|
242 |
$img_adm = "adm.png";
|
242 |
$img_adm = "adm.png";
|
243 |
$img_internet = $img_connect;
|
243 |
$img_internet = $img_connect;
|
244 |
|
244 |
|
245 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
245 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
246 |
if (! $network_pb) {
|
246 |
if (! $network_pb) {
|
247 |
$img_internet = $img_access;
|
247 |
$img_internet = $img_access;
|
248 |
}
|
248 |
}
|
249 |
else {
|
249 |
else {
|
250 |
$img_internet = $img_warning;
|
250 |
$img_internet = $img_warning;
|
251 |
}
|
251 |
}
|
252 |
}
|
252 |
}
|
253 |
else {
|
253 |
else {
|
254 |
$img_internet = $img_connect;
|
254 |
$img_internet = $img_connect;
|
255 |
}
|
255 |
}
|
256 |
|
256 |
|
257 |
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
257 |
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
258 |
?>
|
258 |
?>
|
259 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
259 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
260 |
<html>
|
260 |
<html>
|
261 |
<head>
|
261 |
<head>
|
262 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
262 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
263 |
<title>ALCASAR - <?php echo $l_title; ?></title>
|
263 |
<title>ALCASAR - <?php echo $l_title; ?></title>
|
264 |
<meta http-equiv="Cache-control" content="no-cache">
|
264 |
<meta http-equiv="Cache-control" content="no-cache">
|
265 |
<meta http-equiv="Pragma" content="no-cache">
|
265 |
<meta http-equiv="Pragma" content="no-cache">
|
266 |
<link rel="stylesheet" type="text/css" href="css/style_intercept.css">
|
266 |
<link rel="stylesheet" type="text/css" href="css/style_intercept.css">
|
267 |
<script type="text/javascript">
|
267 |
<script type="text/javascript">
|
268 |
function valoriserDiv5(param){
|
268 |
function valoriserDiv5(param){
|
269 |
document.getElementById("box_info").innerHTML = param.innerHTML;
|
269 |
document.getElementById("box_info").innerHTML = param.innerHTML;
|
270 |
}
|
270 |
}
|
271 |
</script>
|
271 |
</script>
|
272 |
</head>
|
272 |
</head>
|
273 |
<body onload="valoriserDiv5(text_conn);">
|
273 |
<body onload="valoriserDiv5(text_conn);">
|
274 |
<?php
|
274 |
<?php
|
275 |
if ($direct_access){
|
275 |
if ($direct_access){
|
276 |
echo "
|
276 |
echo "
|
277 |
<div id=\"cadre_titre\" class=\"titre_controle\">
|
277 |
<div id=\"cadre_titre\" class=\"titre_controle\">
|
278 |
<p id=\"acces_controle\" class=\"titre_controle\">$l_title</p>";
|
278 |
<p id=\"acces_controle\" class=\"titre_controle\">$l_title</p>";
|
279 |
if ($network_pb) {
|
279 |
if ($network_pb) {
|
280 |
echo " <span>$l_explain_net_pb</span>";
|
280 |
echo " <span>$l_explain_net_pb</span>";
|
281 |
}
|
281 |
}
|
282 |
}
|
282 |
}
|
283 |
else {
|
283 |
else {
|
284 |
echo"
|
284 |
echo"
|
285 |
<div id=\"cadre_titre\" class=\"titre_refus\">
|
285 |
<div id=\"cadre_titre\" class=\"titre_refus\">
|
286 |
<p id=\"acces_controle\" class=\"titre_refus\">$l_title</p>";
|
286 |
<p id=\"acces_controle\" class=\"titre_refus\">$l_title</p>";
|
287 |
}
|
287 |
}
|
288 |
?>
|
288 |
?>
|
289 |
<div id="boite_logo">
|
289 |
<div id="boite_logo">
|
290 |
<img src="images/organisme.png">
|
290 |
<img src="images/organisme.png">
|
291 |
</div>
|
291 |
</div>
|
292 |
</div>
|
292 |
</div>
|
293 |
<div id="contenu_acces">
|
293 |
<div id="contenu_acces">
|
294 |
<div id="box_url">
|
294 |
<div id="box_url">
|
295 |
<?php
|
295 |
<?php
|
296 |
//search here in the blacklist categories (if ((! $direct_access) && (! $network_pb)){}
|
296 |
//search here in the blacklist categories (if ((! $direct_access) && (! $network_pb)){}
|
297 |
?>
|
297 |
?>
|
298 |
</div>
|
298 |
</div>
|
299 |
<?php
|
299 |
<?php
|
300 |
# CHECK IF the SMS service is enable
|
300 |
# CHECK IF the SMS service is enable
|
301 |
$service_SMS_status="false";
|
301 |
$service_SMS_status="false";
|
302 |
if ($service_SMS_status == "true") {
|
302 |
if ($service_SMS_status == "true") {
|
303 |
$sms_div='
|
303 |
$sms_div='
|
304 |
<div class="box_menu" id="box_acc" onmouseover="valoriserDiv5(text_acc);">
|
304 |
<div class="box_menu" id="box_acc" onmouseover="valoriserDiv5(text_acc);">
|
305 |
<span>'.$l_sms_access.'</span>
|
305 |
<span>'.$l_sms_access.'</span>
|
306 |
<img src="'.$img_rep.''.$img_sms.'">
|
306 |
<img src="'.$img_rep.''.$img_sms.'">
|
307 |
</div>
|
307 |
</div>
|
308 |
';
|
308 |
';
|
309 |
|
309 |
|
310 |
$sms_div_over='
|
310 |
$sms_div_over='
|
311 |
<div class="div-cache" id="text_acc">
|
311 |
<div class="div-cache" id="text_acc">
|
312 |
<h2>'.$l_sms_access.'</h2>
|
312 |
<h2>'.$l_sms_access.'</h2>
|
313 |
<p>'.$l_sms_explain.'</p>
|
313 |
<p>'.$l_sms_explain.'</p>
|
314 |
<p><font color="green"><center>'.$l_service_sms.'</center></font></p>
|
314 |
<p><font color="green"><center>'.$l_service_sms.'</center></font></p>
|
315 |
<img src="'.$img_rep.''.$img_sms.'">
|
315 |
<img src="'.$img_rep.''.$img_sms.'">
|
316 |
</div>
|
316 |
</div>
|
317 |
';
|
317 |
';
|
318 |
}
|
318 |
}
|
319 |
else {
|
319 |
else {
|
320 |
$sms_div='';
|
320 |
$sms_div='';
|
321 |
$sms_div_over='';
|
321 |
$sms_div_over='';
|
322 |
}
|
322 |
}
|
323 |
?>
|
323 |
?>
|
324 |
<?php
|
324 |
<?php
|
325 |
if ($direct_access){
|
325 |
if ($direct_access){
|
326 |
echo " <div id=\"box_bienvenue\">
|
326 |
echo " <div id=\"box_bienvenue\">
|
327 |
$l_welcome
|
327 |
$l_welcome
|
328 |
</div>
|
328 |
</div>
|
329 |
<div class=\"box_menu\" id=\"box_conn\" onmouseover=\"valoriserDiv5(text_conn);\">
|
329 |
<div class=\"box_menu\" id=\"box_conn\" onmouseover=\"valoriserDiv5(text_conn);\">
|
330 |
<span>$l_logout</span>
|
330 |
<span>$l_logout</span>
|
331 |
<img src=\"$img_rep$img_internet\">
|
331 |
<img src=\"$img_rep$img_internet\">
|
332 |
</div>
|
332 |
</div>
|
333 |
<div class=\"box_menu\" id=\"box_certif\" onmouseover=\"valoriserDiv5(text_certif);\">
|
333 |
<div class=\"box_menu\" id=\"box_certif\" onmouseover=\"valoriserDiv5(text_certif);\">
|
334 |
<span>$l_install_certif</span>
|
334 |
<span>$l_install_certif</span>
|
335 |
<img src=\"$img_rep$img_certificate\">
|
335 |
<img src=\"$img_rep$img_certificate\">
|
336 |
</div>
|
336 |
</div>
|
337 |
<div class=\"box_menu\" id=\"box_mdp\" onmouseover=\"valoriserDiv5(text_mdp);\">
|
337 |
<div class=\"box_menu\" id=\"box_mdp\" onmouseover=\"valoriserDiv5(text_mdp);\">
|
338 |
<img src=\"$img_rep$img_pwd\">
|
338 |
<img src=\"$img_rep$img_pwd\">
|
339 |
<span>$l_password_change</span>
|
339 |
<span>$l_password_change</span>
|
340 |
</div>
|
340 |
</div>
|
341 |
$sms_div
|
341 |
$sms_div
|
342 |
<div class=\"div-cache\" id=\"text_conn\">
|
342 |
<div class=\"div-cache\" id=\"text_conn\">
|
343 |
<h2>$l_logout</h2>
|
343 |
<h2>$l_logout</h2>
|
344 |
<p>$l_logout_explain</p>
|
344 |
<p>$l_logout_explain</p>
|
345 |
<img src=\"$img_rep$img_internet\">
|
345 |
<img src=\"$img_rep$img_internet\">
|
346 |
</div>
|
346 |
</div>
|
347 |
<div class=\"div-cache\" id=\"text_certif\">
|
347 |
<div class=\"div-cache\" id=\"text_certif\">
|
348 |
<h2>$l_install_certif_more</h2>
|
348 |
<h2>$l_install_certif_more</h2>
|
349 |
<p>$l_certif_explain $l_certif_explain_help</p>
|
349 |
<p>$l_certif_explain $l_certif_explain_help</p>
|
350 |
<img src=\"$img_rep$img_certificate\">
|
350 |
<img src=\"$img_rep$img_certificate\">
|
351 |
</div>
|
351 |
</div>
|
352 |
<div class=\"div-cache\" id=\"text_mdp\">
|
352 |
<div class=\"div-cache\" id=\"text_mdp\">
|
353 |
<h2>$l_password_change</h2>
|
353 |
<h2>$l_password_change</h2>
|
354 |
<p>$l_password_change_explain</p>
|
354 |
<p>$l_password_change_explain</p>
|
355 |
<img src=\"$img_rep$img_pwd\">
|
355 |
<img src=\"$img_rep$img_pwd\">
|
356 |
</div>
|
356 |
</div>
|
357 |
$sms_div_over
|
357 |
$sms_div_over
|
358 |
<div id=\"box_info\">
|
358 |
<div id=\"box_info\">
|
359 |
</div>";
|
359 |
</div>";
|
360 |
}
|
360 |
}
|
361 |
else {
|
361 |
else {
|
362 |
echo "
|
362 |
echo "
|
363 |
<div id=\"box_refuse\">
|
363 |
<div id=\"box_refuse\">
|
364 |
<img src=\"$img_rep$img_false\">
|
364 |
<img src=\"$img_rep$img_false\">
|
365 |
<p>$l_explain</p>
|
365 |
<p>$l_explain</p>
|
366 |
</div>
|
366 |
</div>
|
367 |
<div id=\"liens_redir\">
|
367 |
<div id=\"liens_redir\">
|
368 |
<p>$l_back_page</p>
|
368 |
<p>$l_back_page</p>
|
369 |
</div>";
|
369 |
</div>";
|
370 |
}
|
370 |
}
|
371 |
if (($network_pb)&&(! $direct_access)) {
|
371 |
if (($network_pb)&&(! $direct_access)) {
|
372 |
echo " <span>Diagnostic : $diagnostic</span>";
|
372 |
echo " <span>Diagnostic : $diagnostic</span>";
|
373 |
}
|
373 |
}
|
374 |
?>
|
374 |
?>
|
375 |
</div>
|
375 |
</div>
|
376 |
<div id="corner">
|
376 |
<div id="corner">
|
377 |
<div id="adm" class="corn">
|
377 |
<div id="adm" class="corn">
|
378 |
<a href="https://<?php echo $hostname; ?>/acc"><img src=<?php echo $img_rep.''.$img_adm; ?>></a>
|
378 |
<a href="https://<?php echo $hostname; ?>/acc"><img src=<?php echo $img_rep.''.$img_adm; ?>></a>
|
379 |
</div>
|
379 |
</div>
|
380 |
</div>
|
380 |
</div>
|
381 |
</body>
|
381 |
</body>
|
382 |
</html>
|
382 |
</html>
|
383 |
|
383 |
|