Subversion Repositories ALCASAR

Rev

Rev 912 | Rev 955 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 912 Rev 922
1
<?php
1
<?php
2
$hostname = "alcasar";
2
$hostname = "alcasar";
3
$network_pb = False;
3
$network_pb = False;
4
$cert_add = "http://alcasar/certs";
4
$cert_add = "http://alcasar/certs";
5
$direct_access = False;
5
$direct_access = False;
6
$diagnostic = "can't contact the default router";
6
$diagnostic = "can't contact the default router";
7
$remote_ip = ($_SERVER['REMOTE_ADDR']);
7
$remote_ip = ($_SERVER['REMOTE_ADDR']);
8
$tab = array();$user = array();
8
$tab = array();$user = array();
9
$connection_history =  "";
9
$connection_history =  "";
10
$nb_connection_history = 3;
10
$nb_connection_history = 3;
11
 
11
 
12
# on discrimine les accès directs sur Alcasar par rapport aux redirections (blacklist ou pannes rso)
12
# on discrimine les accès directs sur Alcasar par rapport aux redirections (blacklist ou pannes rso)
13
if (($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_ADDR']) || preg_match ("/^alcasar/", $_SERVER['HTTP_HOST']) || preg_match ("/^$hostname/", $_SERVER['HTTP_HOST']))
13
if (($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_ADDR']) || preg_match ("/^alcasar/", $_SERVER['HTTP_HOST']) || preg_match ("/^$hostname/", $_SERVER['HTTP_HOST']))
14
	{
14
	{
15
	$direct_access=True;
15
	$direct_access=True;
16
	exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
16
	exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
17
	$user = explode (" ", $tab[0]);
17
	$user = explode (" ", $tab[0]);
18
	}
18
	}
19
#### Affichage des 3 dernières connexions de $user[5]
19
#### Affichage des 3 dernières connexions de $user[5]
20
function secondsToDuration($seconds = null){
20
function secondsToDuration($seconds = null){
21
	if ($seconds == null) return "";
21
	if ($seconds == null) return "";
22
 
22
 
23
	$temp = $seconds % 3600;
23
	$temp = $seconds % 3600;
24
	$time[0] = ( $seconds - $temp ) / 3600 ;	// hours
24
	$time[0] = ( $seconds - $temp ) / 3600 ;	// hours
25
	$time[2] = $temp % 60 ;				// seconds
25
	$time[2] = $temp % 60 ;				// seconds
26
	$time[1] = ( $temp - $time[2] ) / 60;		// minutes
26
	$time[1] = ( $temp - $time[2] ) / 60;		// minutes
27
	
27
	
28
	return $time[0]." h ".$time[1]." m ".$time[2]." s";
28
	return $time[0]." h ".$time[1]." m ".$time[2]." s";
29
}
29
}
30
 
30
 
31
$l_connected = "connected"; // a traduire (choix de la langue ci-dessous mais nécessitant de $connection_history)
31
$l_connected = "connected"; // a traduire (choix de la langue ci-dessous mais nécessitant de $connection_history)
32
// si on a pas d'accès à la bdd, la page s'affiche quand même correctement
32
// si on a pas d'accès à la bdd, la page s'affiche quand même correctement
33
if ((isset ($user[4])) && ($user[4] != "0")){
33
if ((isset ($user[4])) && ($user[4] != "0")){
34
	if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
34
	if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
35
		include_once("/etc/freeradius-web/config.php");
35
		include_once("/etc/freeradius-web/config.php");
36
		include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
36
		include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
37
		
37
		
38
		$sql = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' ORDER BY AcctStartTime DESC LIMIT 0 , $nb_connection_history";
38
		$sql = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' ORDER BY AcctStartTime DESC LIMIT 0 , $nb_connection_history";
39
		$link = @da_sql_pconnect($config); // on affiche pas les erreurs
39
		$link = @da_sql_pconnect($config); // on affiche pas les erreurs
40
		
40
		
41
		if ($link){
41
		if ($link){
42
			$res = @da_sql_query($link,$config,$sql); // on affiche pas les erreurs
42
			$res = @da_sql_query($link,$config,$sql); // on affiche pas les erreurs
43
			
43
			
44
			if ($res){
44
			if ($res){
45
				$connection_history.= "<ul>";
45
				$connection_history.= "<ul>";
46
				while(($row = @da_sql_fetch_array($res,$config))){
46
				while(($row = @da_sql_fetch_array($res,$config))){
47
					$connected = "";
47
					$connected = "";
48
					if ($row[acctstoptime] == "") $connected = " ($l_connected)";
48
					if ($row[acctstoptime] == "") $connected = " ($l_connected)";
49
					$connection_history.="<li title='$row[username] $row[acctstarttime] $row[acctstoptime] (".secondsToDuration($row[acctsessiontime]).")'>$row[acctstarttime] (".secondsToDuration($row[acctsessiontime]).") $connected</li>";
49
					$connection_history.="<li title='$row[username] $row[acctstarttime] $row[acctstoptime] (".secondsToDuration($row[acctsessiontime]).")'>$row[acctstarttime] (".secondsToDuration($row[acctsessiontime]).") $connected</li>";
50
				}
50
				}
51
				$connection_history.="</ul>";
51
				$connection_history.="</ul>";
52
			}
52
			}
53
		}
53
		}
54
	}
54
	}
55
}
55
}
56
####
56
####
57
 
57
 
58
# Choice of language
58
# Choice of language
59
$Language = 'en';
59
$Language = 'en';
60
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
60
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
61
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
61
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
62
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
62
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
63
if($Language == 'fr'){
63
if($Language == 'fr'){
64
  $l_access_denied = "ACC&Egrave;S REFUS&Eacute;";
64
  $l_access_denied = "ACC&Egrave;S REFUS&Eacute;";
65
  $l_access_welcome = "Bienvenue sur ALCASAR";
65
  $l_access_welcome = "Bienvenue sur ALCASAR";
66
  $l_access_unavailable = "ACC&Egrave;S INDISPONIBLE";
66
  $l_access_unavailable = "ACC&Egrave;S INDISPONIBLE";
67
  $l_required_domain = "Site WEB demand&eacute;";
67
  $l_required_domain = "Site WEB demand&eacute;";
68
  $l_explain_acc_access = "Le centre de gestion permet d'administrer le portail. Vous devez poss&eacute;der un compte d'administration ou de gestion pour y acc&eacute;der.";
68
  $l_explain_acc_access = "Le centre de gestion permet d'administrer le portail. Vous devez poss&eacute;der un compte d'administration ou de gestion pour y acc&eacute;der.";
69
  $l_explain_access_deny = "Vous tentez d'acc&eacute;der &agrave; une ressource dont le contenu est r&eacute;put&eacute; contenir des informations inappropri&eacute;es.";
69
  $l_explain_access_deny = "Vous tentez d'acc&eacute;der &agrave; une ressource dont le contenu est r&eacute;put&eacute; contenir des informations inappropri&eacute;es.";
70
  $l_explain_net_pb = "Votre portail d&eacute;tecte que l'acc&egrave;s &agrave; Internet est indisponible.";
70
  $l_explain_net_pb = "Votre portail d&eacute;tecte que l'acc&egrave;s &agrave; Internet est indisponible.";
71
  $l_contact_access_deny = "Contactez le responsable de la s&eacute;curit&eacute; (OSSI/RSSI) si vous pensez que ce filtrage est abusif.";
71
  $l_contact_access_deny = "Contactez le responsable de la s&eacute;curit&eacute; (OSSI/RSSI) si vous pensez que ce filtrage est abusif.";
72
  $l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information.";
72
  $l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information.";
73
  $l_welcome = "Page principale de votre portail captif";
73
  $l_welcome = "Page principale de votre portail captif";
74
  $l_acc_access = "<a href=\"https://$hostname/acc\">Acc&egrave;s au centre de gestion</a>";
74
  $l_acc_access = "<a href=\"https://$hostname/acc\">Acc&egrave;s au centre de gestion</a>";
75
  $l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Installer le certificat racine</a>";
75
  $l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Installer le certificat racine</a>";
76
  $l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Installation du certificat de l'autorit&eacute; racine d'ALCASAR</a>";
76
  $l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Installation du certificat de l'autorit&eacute; racine d'ALCASAR</a>";
77
  $l_certif_explain = "Permet l'&eacute;change de donn&eacute;es s&eacute;curis&eacute;es entre votre station de consultation et le portail captif ALCASAR.<BR>Si ce certificat n'est pas enregistr&eacute; sur votre station de consultation, il est possible que des alertes de s&eacute;curit&eacute;s soient &eacute;mises par votre navigateur.<br><br>";
77
  $l_certif_explain = "Permet l'&eacute;change de donn&eacute;es s&eacute;curis&eacute;es entre votre station de consultation et le portail captif ALCASAR.<BR>Si ce certificat n'est pas enregistr&eacute; sur votre station de consultation, il est possible que des alertes de s&eacute;curit&eacute;s soient &eacute;mises par votre navigateur.<br><br>";
78
  $l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Aide complémentaire</a>";
78
  $l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Aide complémentaire</a>";
79
if ((isset ($user[4])) && ($user[4] == "0")) {
79
if ((isset ($user[4])) && ($user[4] == "0")) {
80
	  $l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre syst&egrave;me.";
80
	  $l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre syst&egrave;me.";
81
	  $l_logout = "<a href=\"http://www.google.fr\">Ouvrir une session Internet</a>";}
81
	  $l_logout = "<a href=\"http://www.google.fr\">Ouvrir une session Internet</a>";}
82
  else {
82
  else {
83
	  if ($user[5] != $user[0]) // authentication exception or not
83
	  if ($user[5] != $user[0]) // authentication exception or not
84
	  {
84
	  {
85
	  	$l_logout_explain = "Ferme la session de l'usager actuellement connect&eacute;. <br><br>Utilisateur connect&eacute; : <a href=\"http://$hostname:3990/logoff\" title=\"Deconnecter l'utilisateur $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history derni&egrave;res connexions :$connection_history";
85
	  	$l_logout_explain = "Ferme la session de l'usager actuellement connect&eacute;. <br><br>Utilisateur connect&eacute; : <a href=\"http://$hostname:3990/logoff\" title=\"Deconnecter l'utilisateur $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history derni&egrave;res connexions :$connection_history";
86
		$l_logout = "<a href=\"http://$hostname:3990/logoff\">Se d&eacute;connecter d'internet</a>";
86
		$l_logout = "<a href=\"http://$hostname:3990/logoff\">Se d&eacute;connecter d'internet</a>";
87
	  }
87
	  }
88
	  else
88
	  else
89
	  {
89
	  {
90
		  $l_logout_explain = "Votre système ($user[5]) est en exception d'authentication.<br><br>$nb_connection_history last connections :$connection_history";
90
		  $l_logout_explain = "Votre système ($user[5]) est en exception d'authentication.<br><br>$nb_connection_history last connections :$connection_history";
91
		  $l_logout = "Information des connexions";
91
		  $l_logout = "Information des connexions";
92
	  }
92
	  }
93
	}
93
	}
94
  $l_password_change = "<a href=\"https://$hostname/pass\">Changer votre mot de passe</a>";
94
  $l_password_change = "<a href=\"https://$hostname/pass\">Changer votre mot de passe</a>";
95
  $l_password_change_explain = "Vous redirige sur la page de changement du mot de passe de votre compte d'acc&egrave;s &agrave; internet.<br><br>Vous devez avoir un compte internet valide.";
95
  $l_password_change_explain = "Vous redirige sur la page de changement du mot de passe de votre compte d'acc&egrave;s &agrave; internet.<br><br>Vous devez avoir un compte internet valide.";
96
  $l_back_page = "<a href=\"javascript:history.back()\">Page pr&eacute;c&eacute;dente</a>";
96
  $l_back_page = "<a href=\"javascript:history.back()\">Page pr&eacute;c&eacute;dente</a>";
97
}
97
}
98
else if($Language == 'pt'){
98
else if($Language == 'pt'){
99
  $l_access_denied = "Acesso negado";
99
  $l_access_denied = "Acesso negado";
100
  $l_access_welcome = "Bem-vindo ao Alcasar";
100
  $l_access_welcome = "Bem-vindo ao Alcasar";
101
  $l_access_unavailable = "ACESSO INDISPONÍVEL";
101
  $l_access_unavailable = "ACESSO INDISPONÍVEL";
102
  $l_required_domain = "Site WEB Obrigatório";
102
  $l_required_domain = "Site WEB Obrigatório";
103
  $l_explain_acc_access = "Este é o centro de controle do portal para acessar você deve ter uma conta administrativa.";
103
  $l_explain_acc_access = "Este é o centro de controle do portal para acessar você deve ter uma conta administrativa.";
104
  $l_explain_access_deny = "Você tenta se conectar a um recurso cujo conteúdo é considerado inadequado no conteúdo de informações.";
104
  $l_explain_access_deny = "Você tenta se conectar a um recurso cujo conteúdo é considerado inadequado no conteúdo de informações.";
105
  $l_explain_net_pb = "O portal detectou que o acesso à Internet é de risco";
105
  $l_explain_net_pb = "O portal detectou que o acesso à Internet é de risco";
106
  $l_contact_access_deny = "Entre em contato com o administrador do sistema de segurança se acha que essa filtragem é abusiva.";
106
  $l_contact_access_deny = "Entre em contato com o administrador do sistema de segurança se acha que essa filtragem é abusiva.";
107
  $l_contact_net_pb = "Entre em contato com a empresa fornecedora de Internet para mais informações";
107
  $l_contact_net_pb = "Entre em contato com a empresa fornecedora de Internet para mais informações";
108
  $l_welcome = "Essa é a página do portal captive principal";
108
  $l_welcome = "Essa é a página do portal captive principal";
109
  $l_acc_access = "<a href=\"https://$hostname/acc\">ALCASAR Control Center</a>";
109
  $l_acc_access = "<a href=\"https://$hostname/acc\">ALCASAR Control Center</a>";
110
  $l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Instalar Certificado Alcasar AC</a>";
110
  $l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Instalar Certificado Alcasar AC</a>";
111
  $l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.cert\">Instalar Certificado Alcasar AC</a>";
111
  $l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.cert\">Instalar Certificado Alcasar AC</a>";
112
  $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>";
112
  $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>";
113
  $l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
113
  $l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
114
if ((isset ($user[4])) && ($user[4] == "0")) {
114
if ((isset ($user[4])) && ($user[4] == "0")) {
115
	  $l_logout_explain = "No Internet consultation session is actualy open on your system";
115
	  $l_logout_explain = "Nenhuma consulta de conexão à Internet pode abrir em seu computador";
116
	  $l_logout = "<a href=\"http://www.google.pt\">Open an Internet session</a>";}
116
	  $l_logout = "<a href=\"http://www.google.pt\">Abrir uma conexão de Internet</a>";}
117
  else {
117
  else {
118
	  if ($user[5] != $user[0]) // authentication exception or not
118
	  if ($user[5] != $user[0]) // authentication exception or not
119
	  {
119
	  {
120
		  $l_logout_explain = "Close the session of the user actualy connecterd.<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";
120
		  $l_logout_explain = "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";
121
		  $l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff from internet</a>";
121
		  $l_logout = "<a href=\"http://$hostname:3990/logoff\">Sair da Internet</a>";
122
	  }
122
	  }
123
	  else
123
	  else
124
	  {
124
	  {
125
		  $l_logout_explain = "Your system ($user[5]) is in exception of authentication.<br><br>$nb_connection_history last connections :$connection_history";
125
		  $l_logout_explain = "O sistema ($user[5]) está em exceção de autenticação.<br><br>$nb_connection_history logins últimos :$connection_history";
126
		  $l_logout = "Connections information";
126
		  $l_logout = "Informações de conexões";
127
	  }
127
	  }
128
  	}
128
  	}
129
  $l_password_change = "<a href=\"https://$hostname/pass\">Change your password</a>";
129
  $l_password_change = "<a href=\"https://$hostname/pass\">Mudar sua senha</a>";
130
  $l_password_change_explain = "Redirect you on password change page.<br><br> You should already have an Internet access account.";
130
  $l_password_change_explain = "Você será redirecionado à página de alteração de senha.<br><br> Você deverá ter uma conta de usuário valido para acessar à Internet.";
131
  $l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
131
  $l_back_page = "<a href=\"javascript:history.back()\">Página anterior</a>";
132
}
132
}
133
else {
133
else {
134
  $l_access_denied = "ACCESS DENIED";
134
  $l_access_denied = "ACCESS DENIED";
135
  $l_access_welcome = "Welcome on ALCASAR";
135
  $l_access_welcome = "Welcome on ALCASAR";
136
  $l_access_unavailable = "ACCESS UNAVAILABLE";
136
  $l_access_unavailable = "ACCESS UNAVAILABLE";
137
  $l_required_domain = "Required WEB site";
137
  $l_required_domain = "Required WEB site";
138
  $l_explain_acc_access = "This center control the portal. You must have an administrative account.";
138
  $l_explain_acc_access = "This center control the portal. You must have an administrative account.";
139
  $l_explain_access_deny = "You try to connect to a resource whose content is deemed to contain inappropriate information.";
139
  $l_explain_access_deny = "You try to connect to a resource whose content is deemed to contain inappropriate information.";
140
  $l_explain_net_pb = "Your portal has just detected that the Internet access is down";
140
  $l_explain_net_pb = "Your portal has just detected that the Internet access is down";
141
  $l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
141
  $l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
142
  $l_contact_net_pb = "Contact your network responsive or your Internet provider for more information";
142
  $l_contact_net_pb = "Contact your network responsive or your Internet provider for more information";
143
  $l_welcome = "Your captive portal main page";
143
  $l_welcome = "Your captive portal main page";
144
  $l_acc_access = "<a href=\"https://$hostname/acc\">ALCASAR Control Center</a>";
144
  $l_acc_access = "<a href=\"https://$hostname/acc\">ALCASAR Control Center</a>";
145
  $l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Install ALCASAR AC Certificate</a>";
145
  $l_install_certif = "<a href=\"$cert_add/certificat_alcasar_ca.crt\">Install ALCASAR AC Certificate</a>";
146
  $l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.cert\">Install ALCASAR AC Certificate</a>";
146
  $l_install_certif_more = "<a href=\"$cert_add/certificat_alcasar_ca.cert\">Install ALCASAR AC Certificate</a>";
147
  $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>";
147
  $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>";
148
  $l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
148
  $l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
149
if ((isset ($user[4])) && ($user[4] == "0")) {
149
if ((isset ($user[4])) && ($user[4] == "0")) {
150
	  $l_logout_explain = "No Internet consultation session is actualy open on your system";
150
	  $l_logout_explain = "No Internet consultation session is actualy open on your system";
151
	  $l_logout = "<a href=\"http://www.google.com\">Open an Internet session</a>";}
151
	  $l_logout = "<a href=\"http://www.google.com\">Open an Internet session</a>";}
152
  else {
152
  else {
153
	  if ($user[5] != $user[0]) // authentication exception or not
153
	  if ($user[5] != $user[0]) // authentication exception or not
154
	  {
154
	  {
155
		  $l_logout_explain = "Close the session of the user actualy connecterd.<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";
155
		  $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";
156
		  $l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff from internet</a>";
156
		  $l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff from internet</a>";
157
	  }
157
	  }
158
	  else
158
	  else
159
	  {
159
	  {
160
		  $l_logout_explain = "Your system ($user[5]) is in exception of authentication.<br><br>$nb_connection_history last connections :$connection_history";
160
		  $l_logout_explain = "Your system ($user[5]) is in exception of authentication.<br><br>$nb_connection_history Last logins :$connection_history";
161
		  $l_logout = "Connections information";
161
		  $l_logout = "Connections information";
162
	  }
162
	  }
163
  	}
163
  	}
164
  $l_password_change = "<a href=\"https://$hostname/pass\">Change your password</a>";
164
  $l_password_change = "<a href=\"https://$hostname/pass\">Change your password</a>";
165
  $l_password_change_explain = "Redirect you on password change page.<br><br> You should already have an Internet access account.";
165
  $l_password_change_explain = "Redirect you on password change page.<br><br> You should already have an Internet access account.";
166
  $l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
166
  $l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
167
}
167
}
168
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied));
168
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied));
169
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny));
169
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny));
170
 
170
 
171
# Attribution des icones / images
171
# Attribution des icones / images
172
$img_rep = "images/";
172
$img_rep = "images/";
173
$img_organisme = "organisme.png";
173
$img_organisme = "organisme.png";
174
$img_access = "globe_acces_70.png";
174
$img_access = "globe_acces_70.png";
175
$img_connect = "globe_70.png";
175
$img_connect = "globe_70.png";
176
$img_warning = "globe_warning_70.png";
176
$img_warning = "globe_warning_70.png";
177
$img_pwd = "cle_ombre.png";
177
$img_pwd = "cle_ombre.png";
178
$img_certificate = "certificat.png";
178
$img_certificate = "certificat.png";
179
$img_acc = "logo-alcasar_70.png";
179
$img_acc = "logo-alcasar_70.png";
180
$img_false = "interdit.png";
180
$img_false = "interdit.png";
181
$img_internet = $img_connect;
181
$img_internet = $img_connect;
182
 
182
 
183
if ((isset ($user[4])) && ($user[4] == "0")) {
183
if ((isset ($user[4])) && ($user[4] == "0")) {
184
	if (! $network_pb) {
184
	if (! $network_pb) {
185
		$img_internet = $img_access;
185
		$img_internet = $img_access;
186
		}
186
		}
187
		else {
187
		else {
188
		$img_internet = $img_warning;
188
		$img_internet = $img_warning;
189
	}
189
	}
190
}
190
}
191
else {
191
else {
192
	$img_internet = $img_connect;
192
	$img_internet = $img_connect;
193
}
193
}
194
 
194
 
195
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
195
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
196
?>
196
?>
197
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
197
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
198
	<html>
198
	<html>
199
	<head>
199
	<head>
200
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
200
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
201
	<title>ALCASAR - <?php echo $l_title; ?></title>
201
	<title>ALCASAR - <?php echo $l_title; ?></title>
202
	<meta http-equiv="Cache-control" content="no-cache">
202
	<meta http-equiv="Cache-control" content="no-cache">
203
	<meta http-equiv="Pragma" content="no-cache">
203
	<meta http-equiv="Pragma" content="no-cache">
204
	<link rel="stylesheet" type="text/css" href="css/style_intercept.css">
204
	<link rel="stylesheet" type="text/css" href="css/style_intercept.css">
205
	<script type="text/javascript">
205
	<script type="text/javascript">
206
		function valoriserDiv5(param){
206
		function valoriserDiv5(param){
207
			document.getElementById("box_info").innerHTML = param.innerHTML;
207
			document.getElementById("box_info").innerHTML = param.innerHTML;
208
		}
208
		}
209
	</script>
209
	</script>
210
</head>
210
</head>
211
<body onload="valoriserDiv5(text_conn);">
211
<body onload="valoriserDiv5(text_conn);">
212
<?php
212
<?php
213
if ($direct_access){
213
if ($direct_access){
214
	echo "
214
	echo "
215
		<div id=\"cadre_titre\" class=\"titre_controle\">
215
		<div id=\"cadre_titre\" class=\"titre_controle\">
216
			<p id=\"acces_controle\" class=\"titre_controle\">$l_title</p>";
216
			<p id=\"acces_controle\" class=\"titre_controle\">$l_title</p>";
217
	if ($network_pb) {
217
	if ($network_pb) {
218
		echo "	<span>$l_explain_net_pb</span>";
218
		echo "	<span>$l_explain_net_pb</span>";
219
		}
219
		}
220
	}
220
	}
221
	else {
221
	else {
222
		echo"
222
		echo"
223
			<div id=\"cadre_titre\" class=\"titre_refus\">
223
			<div id=\"cadre_titre\" class=\"titre_refus\">
224
				<p id=\"acces_controle\" class=\"titre_refus\">$l_title</p>";
224
				<p id=\"acces_controle\" class=\"titre_refus\">$l_title</p>";
225
	}
225
	}
226
?>
226
?>
227
			<div id="boite_logo">
227
			<div id="boite_logo">
228
				<img src="images/organisme.png">
228
				<img src="images/organisme.png">
229
			</div>
229
			</div>
230
		</div>
230
		</div>
231
		<div id="contenu_acces">
231
		<div id="contenu_acces">
232
			<div id="box_url">
232
			<div id="box_url">
233
				<?php if (! $direct_access){echo "$l_required_domain : $_SERVER[HTTP_HOST]";}?>
233
				<?php if (! $direct_access){echo "$l_required_domain : $_SERVER[HTTP_HOST]";}?>
234
			</div>
234
			</div>
235
<?php
235
<?php
236
if ($direct_access){
236
if ($direct_access){
237
	echo "	<div id=\"box_bienvenue\">
237
	echo "	<div id=\"box_bienvenue\">
238
				$l_welcome
238
				$l_welcome
239
			</div>
239
			</div>
240
			<div class=\"box_menu\" id=\"box_conn\" onmouseover=\"valoriserDiv5(text_conn);\">
240
			<div class=\"box_menu\" id=\"box_conn\" onmouseover=\"valoriserDiv5(text_conn);\">
241
				<span>$l_logout</span>
241
				<span>$l_logout</span>
242
				<img src=\"$img_rep$img_internet\">
242
				<img src=\"$img_rep$img_internet\">
243
			</div>
243
			</div>
244
			<div class=\"box_menu\" id=\"box_certif\" onmouseover=\"valoriserDiv5(text_certif);\">
244
			<div class=\"box_menu\" id=\"box_certif\" onmouseover=\"valoriserDiv5(text_certif);\">
245
				<span>$l_install_certif</span>
245
				<span>$l_install_certif</span>
246
				<img src=\"$img_rep$img_certificate\">
246
				<img src=\"$img_rep$img_certificate\">
247
			</div>
247
			</div>
248
			<div class=\"box_menu\" id=\"box_mdp\" onmouseover=\"valoriserDiv5(text_mdp);\">
248
			<div class=\"box_menu\" id=\"box_mdp\" onmouseover=\"valoriserDiv5(text_mdp);\">
249
				<img src=\"$img_rep$img_pwd\">
249
				<img src=\"$img_rep$img_pwd\">
250
				<span>$l_password_change</span>
250
				<span>$l_password_change</span>
251
			</div>		
251
			</div>		
252
			<div class=\"box_menu\" id=\"box_acc\" onmouseover=\"valoriserDiv5(text_acc);\">
252
			<div class=\"box_menu\" id=\"box_acc\" onmouseover=\"valoriserDiv5(text_acc);\">
253
				<span>$l_acc_access</span>
253
				<span>$l_acc_access</span>
254
				<img src=\"$img_rep$img_acc\">
254
				<img src=\"$img_rep$img_acc\">
255
			</div>
255
			</div>
256
			<div class=\"div-cache\" id=\"text_conn\">
256
			<div class=\"div-cache\" id=\"text_conn\">
257
				<h2>$l_logout</h2>
257
				<h2>$l_logout</h2>
258
				<p>$l_logout_explain</p>
258
				<p>$l_logout_explain</p>
259
				<img src=\"$img_rep$img_internet\">
259
				<img src=\"$img_rep$img_internet\">
260
			</div>
260
			</div>
261
			<div class=\"div-cache\" id=\"text_certif\">
261
			<div class=\"div-cache\" id=\"text_certif\">
262
				<h2>$l_install_certif_more</h2>
262
				<h2>$l_install_certif_more</h2>
263
				<p>$l_certif_explain $l_certif_explain_help</p>
263
				<p>$l_certif_explain $l_certif_explain_help</p>
264
				<img src=\"$img_rep$img_certificate\">				
264
				<img src=\"$img_rep$img_certificate\">				
265
			</div>
265
			</div>
266
			<div class=\"div-cache\" id=\"text_mdp\">
266
			<div class=\"div-cache\" id=\"text_mdp\">
267
				<h2>$l_password_change</h2>
267
				<h2>$l_password_change</h2>
268
				<p>$l_password_change_explain</p>
268
				<p>$l_password_change_explain</p>
269
				<img src=\"$img_rep$img_pwd\">
269
				<img src=\"$img_rep$img_pwd\">
270
			</div>
270
			</div>
271
			<div class=\"div-cache\" id=\"text_acc\">
271
			<div class=\"div-cache\" id=\"text_acc\">
272
				<h2>$l_acc_access</h2>
272
				<h2>$l_acc_access</h2>
273
				<p>$l_explain</p>
273
				<p>$l_explain</p>
274
				<img src=\"$img_rep$img_acc\">
274
				<img src=\"$img_rep$img_acc\">
275
			</div>
275
			</div>
276
			<div id=\"box_info\">
276
			<div id=\"box_info\">
277
			</div>";
277
			</div>";
278
	}
278
	}
279
	else {
279
	else {
280
		echo "
280
		echo "
281
			<div id=\"box_refuse\">
281
			<div id=\"box_refuse\">
282
				<img src=\"$img_rep$img_false\">
282
				<img src=\"$img_rep$img_false\">
283
				<p>$l_explain</p>
283
				<p>$l_explain</p>
284
			</div>
284
			</div>
285
			<div id=\"liens_redir\">
285
			<div id=\"liens_redir\">
286
				<p>$l_back_page</p>
286
				<p>$l_back_page</p>
287
			</div>";
287
			</div>";
288
		}
288
		}
289
	if (($network_pb)&&(! $direct_access)) {
289
	if (($network_pb)&&(! $direct_access)) {
290
	echo "	<span>Diagnostic : $diagnostic</span>";
290
	echo "	<span>Diagnostic : $diagnostic</span>";
291
	}
291
	}
292
?>
292
?>
293
		</div>
293
		</div>
294
	</body>
294
	</body>
295
</html>
295
</html>
296
 
296