Subversion Repositories ALCASAR

Rev

Rev 363 | Rev 369 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
360 richard 1
<html>
2
<?
3
$private_ip = "192.168.182.1";
4
$network_pb = False;
5
$direct_access = False;
363 richard 6
$diagnostic = "eth0 link down";
7
$remote_ip = ($_SERVER['REMOTE_ADDR']);
8
$tab = array();$user = array();
9
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
10
$user = explode (" ", $tab[0]);
360 richard 11
# on discrimine les accès directs sur Alcasar par rapport aux redirections
12
if (($_SERVER['HTTP_HOST'] == $private_ip) || ($_SERVER['HTTP_HOST'] == "alcasar")){$direct_access=True;}
13
# Choice of language
14
$Language = 'en';
15
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
16
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
17
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
18
if($Language == 'fr'){
19
  $l_access_denied = "ACC&Egrave;S REFUS&Eacute;";
20
  $l_access_controled = "ACC&Egrave;S CONTROL&Eacute;";
21
  $l_access_unavailable = "ACC&Egrave;S INDISPONIBLE";
22
  $l_required_domain = "Site WEB demand&eacute;";
364 franck 23
  $l_explain_acc_access = "Acc&egrave;s aux param&egrave;tres d'administration du portail. Vous devez poss&eacute;der un compte d'administration.";
360 richard 24
  $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.";
25
  $l_explain_net_pb = "Votre portail d&eacute;tecte que l'acc&egrave;s &agrave; Internet est indisponible.";
26
  $l_contact_access_deny = "Contactez le responsable de la s&eacute;curit&eacute; (OSSI/RSSI) si vous pensez que ce filtrage est abusif.";
27
  $l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information";
28
  $l_welcome = "Bienvenue sur la page d'accueil du portail ALCASAR";
29
  $l_acc_access = "<a href=\"https://$private_ip/acc\">Acc&eacute;der au centre de gestion (ALCASAR Control Center)</A>";
30
  $l_logout = "<a href=\"http://$private_ip:3990/logoff\">D&eacute;connexion</A>";
363 richard 31
  if ($user[4] == "0") {$l_logout_explain = "Aucun usager n'est connect&eacute; sur cet &eacute;quipement";} else {$l_logout_explain = "Ferme la session de l'usager : <b>$user[5]</b>";}
360 richard 32
  $l_password_change = "<a href=\"https://$private_ip/pass\">Changer votre mot de passe</A>";
33
  $l_password_change_explain = "Vous redirige sur la pages de changement du mot de passe de votre compte d'acc&egrave;s &agrave; internet.";
34
  $l_back_page = "<a href=\"javascript:history.back()\">Page pr&eacute;c&eacute;dente</a>";
35
}
36
else {
37
  $l_access_denied = "ACCESS DENIED";
38
  $l_access_controled = "ACESS CONTROLED";
39
  $l_access_unavailable = "ACCESS UNAVAILABLE";
40
  $l_required_domain = "Required WEB site";
41
  $l_explain_acc_access = "Access to the ALCASAR Control Center. You must have an administrative login and password";
42
  $l_explain_access_deny = "Your portal has just detected that the Internet access is down";
43
  $l_explain_net_pb = "Your portal has just detected that the Internet access is down";
44
  $l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
45
  $l_contact_net_pb = "Contact your network responsive or your Internet provider for more information";
46
  $l_welcome = "Welcome on the captive portal ALCASAR";
47
  $l_acc_access = "<a href=\"https://$private_ip/acc\">go to the ALCASAR Control Center (ACC)</A>";
48
  $l_logout = "<a href=\"http://$private_ip:3990/logoff\">Loging off</A>";
49
  $l_logout_explain = "Logoff if your session is open.";
50
  $l_paasword_change = "<a href=\"https://$private_ip/pass\">Change your password</A>";
51
  $l_password_change_explain = "Redirects you to the password change's page of your internet access account.";
52
  $l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
53
}
54
$l_title = ($direct_access ? $l_access_controled : ($network_pb ? $l_access_unavailable : $l_access_denied));
55
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny));
56
 
57
echo "<head><title>ALCASAR - $l_title";
58
?>
59
	</title>
60
	<LINK rel=stylesheet type=text/css href="css/style_intercept.css">
61
</head>
62
 
63
	<BODY>
64
<?
65
if ($direct_access){
66
	echo "
67
		<DIV id=\"cadre_titre\" class=\"titre_controle\">
68
			<P id=\"acces_controle\" class=\"titre_controle\">$l_title</P>";
363 richard 69
if ($network_pb) {
70
	echo "	<SPAN>$l_explain_net_pb</SPAN>";
360 richard 71
	}
363 richard 72
	}
360 richard 73
else {
74
	echo"
75
		<DIV id=\"cadre_titre\" class=\"titre_refus\">
76
			<P id=\"acces_controle\" class=\"titre_refus\">$l_title</P>";
77
	}
78
?>
79
			<DIV id="boite_logo">
80
				<IMG src="images/organisme.png">
81
			</DIV>
82
		</DIV>
83
		<DIV id="contenu_acces">
84
			<DIV id="box_url">
85
				<? if (! $direct_access){echo "$l_required_domain : $_SERVER[HTTP_HOST]";}?>
86
			</DIV>
87
<? if ($direct_access){
363 richard 88
	echo "		<DIV id=\"box_bienvenue\">
360 richard 89
				$l_welcome
90
			</DIV>
91
			<DIV class=\"box_menu_courte\" id=\"box_1\">
92
				<IMG src=\"images/cle.png\">
93
				<SPAN>$l_password_change</SPAN>
94
				<P>$l_password_change_explain</P>
95
			</DIV>
96
			<DIV class=\"box_menu_courte\" id=\"box_2\">
97
				<SPAN>$l_logout</SPAN>
98
				<IMG src=\"images/globe.png\">
99
				<P>$l_logout_explain</P> 
363 richard 100
				</DIV>
360 richard 101
			<DIV class=\"box_menu_large\" id=\"box_3\">
102
				<SPAN>$l_acc_access</SPAN>
103
				<IMG src=\"images/logo-alcasar.png\">
104
				<P>$l_explain</P>
105
			</DIV>";}
106
	else {echo "
107
			<DIV id=\"box_refuse\">
108
				<img src=\"images/interdit.png\">
109
				<P>$l_explain</P>
110
			</DIV>
111
			<DIV id=\"liens_redir\">
112
				<P>$l_back_page</P>
363 richard 113
			</DIV>";}
114
	if (($network_pb)&&(! $direct_access))
115
			{
116
	echo "		<SPAN>Diagnostic : $diagnostic</SPAN>";
117
}
118
?>
360 richard 119
		</DIV>
120
	</BODY>
121
</html>