Subversion Repositories ALCASAR

Rev

Rev 364 | Rev 399 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
360 richard 1
<html>
2
<?
369 richard 3
$private_ip = "192.168.180.1";
360 richard 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;";
369 richard 20
  $l_access_welcome = "Bienvenu sur ALCASAR";
360 richard 21
  $l_access_unavailable = "ACC&Egrave;S INDISPONIBLE";
22
  $l_required_domain = "Site WEB demand&eacute;";
369 richard 23
  $l_explain_acc_access = "Ce centre permet d'administrer le 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";
369 richard 28
  $l_welcome = "Page principal de votre portail captif";
29
  $l_acc_access = "<a href=\"https://$private_ip/acc\">Acc&eacute;s au centre de gestion (ALCASAR Control Center)</A>";
30
  if ($user[4] == "0") {
31
	  $l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre syst&egrave;me";
32
	  $l_logout = "<a href=\"http://www.google.fr\">Ouvrir une session Internet</A>";}
33
  else {
34
	  $l_logout_explain = "Ferme la session de l'usager : <b>$user[5]</b>";
35
	  $l_logout = "<a href=\"http://$private_ip:3990/logoff\">D&eacute;connexion</A>";}
360 richard 36
  $l_password_change = "<a href=\"https://$private_ip/pass\">Changer votre mot de passe</A>";
369 richard 37
  $l_password_change_explain = "Vous devez poss&eacute;der un compte de consultation Internet.";
360 richard 38
  $l_back_page = "<a href=\"javascript:history.back()\">Page pr&eacute;c&eacute;dente</a>";
39
}
40
else {
41
  $l_access_denied = "ACCESS DENIED";
369 richard 42
  $l_access_welcome = "Welcome on ALCASAR";
360 richard 43
  $l_access_unavailable = "ACCESS UNAVAILABLE";
44
  $l_required_domain = "Required WEB site";
369 richard 45
  $l_explain_acc_access = "This center control the portal. You must have an administrative account.";
360 richard 46
  $l_explain_access_deny = "Your portal has just detected that the Internet access is down";
47
  $l_explain_net_pb = "Your portal has just detected that the Internet access is down";
48
  $l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
49
  $l_contact_net_pb = "Contact your network responsive or your Internet provider for more information";
369 richard 50
  $l_welcome = "Your captive portal main page";
51
  $l_acc_access = "<a href=\"https://$private_ip/acc\">Access to the ALCASAR Control Center</A>";
52
  if ($user[4] == "0") {
53
	  $l_logout_explain = "No Internet consultation session is actualy open on your system";
54
	  $l_logout = "<a href=\"http://www.google.fr\">Open an Internet session</A>";}
55
  else {
56
	  $l_logout_explain = "Close the session of the user : <b>$user[5]</b>";
57
	  $l_logout = "<a href=\"http://$private_ip:3990/logoff\">Logoff</A>";}
58
  $l_password_change = "<a href=\"https://$private_ip/pass\">Change your password</A>";
59
  $l_password_change_explain = "You should already have an Internet access account.";
360 richard 60
  $l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
61
}
369 richard 62
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied));
360 richard 63
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny));
64
 
65
echo "<head><title>ALCASAR - $l_title";
66
?>
67
	</title>
68
	<LINK rel=stylesheet type=text/css href="css/style_intercept.css">
69
</head>
70
 
71
	<BODY>
72
<?
73
if ($direct_access){
74
	echo "
75
		<DIV id=\"cadre_titre\" class=\"titre_controle\">
76
			<P id=\"acces_controle\" class=\"titre_controle\">$l_title</P>";
363 richard 77
if ($network_pb) {
78
	echo "	<SPAN>$l_explain_net_pb</SPAN>";
360 richard 79
	}
363 richard 80
	}
360 richard 81
else {
82
	echo"
83
		<DIV id=\"cadre_titre\" class=\"titre_refus\">
84
			<P id=\"acces_controle\" class=\"titre_refus\">$l_title</P>";
85
	}
86
?>
87
			<DIV id="boite_logo">
88
				<IMG src="images/organisme.png">
89
			</DIV>
90
		</DIV>
91
		<DIV id="contenu_acces">
92
			<DIV id="box_url">
93
				<? if (! $direct_access){echo "$l_required_domain : $_SERVER[HTTP_HOST]";}?>
94
			</DIV>
95
<? if ($direct_access){
369 richard 96
	echo "	<DIV id=\"box_bienvenue\">
360 richard 97
				$l_welcome
98
			</DIV>
99
			<DIV class=\"box_menu_courte\" id=\"box_1\">
100
				<IMG src=\"images/cle.png\">
101
				<SPAN>$l_password_change</SPAN>
102
				<P>$l_password_change_explain</P>
369 richard 103
			</DIV>";
104
		if ($user[4] == "0") {
105
			echo "
360 richard 106
			<DIV class=\"box_menu_courte\" id=\"box_2\">
369 richard 107
			<SPAN>";
108
			if (! $network_pb) { echo "$l_logout";}
109
			echo " </SPAN>
110
				<IMG src=\"images/globe_acces.png\">
111
				<P>$l_logout_explain</P> 
112
			</DIV>";}
113
			else {
114
			echo "
115
			<DIV class=\"box_menu_courte\" id=\"box_2\">
360 richard 116
				<SPAN>$l_logout</SPAN>
117
				<IMG src=\"images/globe.png\">
118
				<P>$l_logout_explain</P> 
369 richard 119
			</DIV>";}			
120
	echo "	<DIV class=\"box_menu_large\" id=\"box_3\">
360 richard 121
				<SPAN>$l_acc_access</SPAN>
122
				<IMG src=\"images/logo-alcasar.png\">
123
				<P>$l_explain</P>
124
			</DIV>";}
125
	else {echo "
126
			<DIV id=\"box_refuse\">
127
				<img src=\"images/interdit.png\">
128
				<P>$l_explain</P>
129
			</DIV>
130
			<DIV id=\"liens_redir\">
131
				<P>$l_back_page</P>
363 richard 132
			</DIV>";}
133
	if (($network_pb)&&(! $direct_access))
134
			{
135
	echo "		<SPAN>Diagnostic : $diagnostic</SPAN>";
136
}
137
?>
360 richard 138
		</DIV>
139
	</BODY>
140
</html>