Subversion Repositories ALCASAR

Rev

Rev 1988 | Rev 1992 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

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