Subversion Repositories ALCASAR

Rev

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

Rev 404 Rev 452
1
<html>
-
 
2
<?
1
<?php
3
$private_ip = "192.168.180.1";
2
$private_ip = "192.168.182.1";
4
$network_pb = False;
3
$network_pb = False;
5
$direct_access = False;
4
$direct_access = False;
6
$diagnostic = "eth0 link down";
5
$diagnostic = "eth0 link down";
7
$remote_ip = ($_SERVER['REMOTE_ADDR']);
6
$remote_ip = ($_SERVER['REMOTE_ADDR']);
8
$tab = array();$user = array();
7
$tab = array();$user = array();
9
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
8
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
10
$user = explode (" ", $tab[0]);
9
$user = explode (" ", $tab[0]);
11
# on discrimine les accès directs sur Alcasar par rapport aux redirections
10
# 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;}
11
if (($_SERVER['HTTP_HOST'] == $private_ip) || ($_SERVER['HTTP_HOST'] == "alcasar")){$direct_access=True;}
13
# Choice of language
12
# Choice of language
14
$Language = 'en';
13
$Language = 'en';
15
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
14
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
16
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
15
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
17
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
16
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
18
if($Language == 'fr'){
17
if($Language == 'fr'){
19
  $l_access_denied = "ACC&Egrave;S REFUS&Eacute;";
18
  $l_access_denied = "ACC&Egrave;S REFUS&Eacute;";
20
  $l_access_welcome = "Bienvenue sur ALCASAR";
19
  $l_access_welcome = "Bienvenue sur ALCASAR";
21
  $l_access_unavailable = "ACC&Egrave;S INDISPONIBLE";
20
  $l_access_unavailable = "ACC&Egrave;S INDISPONIBLE";
22
  $l_required_domain = "Site WEB demand&eacute;";
21
  $l_required_domain = "Site WEB demand&eacute;";
23
  $l_explain_acc_access = "Ce centre permet d'administrer le portail. Vous devez poss&eacute;der un compte d'administration.";
22
  $l_explain_acc_access = "Ce centre permet d'administrer le portail. Vous devez poss&eacute;der un compte d'administration.";
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.";
23
  $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.";
24
  $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.";
25
  $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";
26
  $l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information";
28
  $l_welcome = "Page principale de votre portail captif";
27
  $l_welcome = "Page principale de votre portail captif";
29
  $l_acc_access = "<a href=\"https://$private_ip/acc\">Acc&egrave;s au centre de gestion (ALCASAR Control Center)</A>";
28
  $l_acc_access = "<a href=\"https://$private_ip/acc\">Acc&egrave;s au centre de gestion (ALCASAR Control Center)</A>";
30
  if ($user[4] == "0") {
29
  if ($user[4] == "0") {
31
	  $l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre syst&egrave;me";
30
	  $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>";}
31
	  $l_logout = "<a href=\"http://www.google.fr\">Ouvrir une session Internet</A>";}
33
  else {
32
  else {
34
	  $l_logout_explain = "Ferme la session de l'usager : <b>$user[5]</b>";
33
	  $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>";}
34
	  $l_logout = "<a href=\"http://$private_ip:3990/logoff\">D&eacute;connexion</A>";}
36
  $l_password_change = "<a href=\"https://$private_ip/pass\">Changer votre mot de passe</A>";
35
  $l_password_change = "<a href=\"https://$private_ip/pass\">Changer votre mot de passe</A>";
37
  $l_password_change_explain = "Vous devez poss&eacute;der un compte de consultation Internet.";
36
  $l_password_change_explain = "Vous devez poss&eacute;der un compte de consultation Internet.";
38
  $l_back_page = "<a href=\"javascript:history.back()\">Page pr&eacute;c&eacute;dente</a>";
37
  $l_back_page = "<a href=\"javascript:history.back()\">Page pr&eacute;c&eacute;dente</a>";
39
}
38
}
40
else {
39
else {
41
  $l_access_denied = "ACCESS DENIED";
40
  $l_access_denied = "ACCESS DENIED";
42
  $l_access_welcome = "Welcome on ALCASAR";
41
  $l_access_welcome = "Welcome on ALCASAR";
43
  $l_access_unavailable = "ACCESS UNAVAILABLE";
42
  $l_access_unavailable = "ACCESS UNAVAILABLE";
44
  $l_required_domain = "Required WEB site";
43
  $l_required_domain = "Required WEB site";
45
  $l_explain_acc_access = "This center control the portal. You must have an administrative account.";
44
  $l_explain_acc_access = "This center control the portal. You must have an administrative account.";
46
  $l_explain_access_deny = "Your portal has just detected that the Internet access is down";
45
  $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";
46
  $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.";
47
  $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";
48
  $l_contact_net_pb = "Contact your network responsive or your Internet provider for more information";
50
  $l_welcome = "Your captive portal main page";
49
  $l_welcome = "Your captive portal main page";
51
  $l_acc_access = "<a href=\"https://$private_ip/acc\">Access to the ALCASAR Control Center</A>";
50
  $l_acc_access = "<a href=\"https://$private_ip/acc\">Access to the ALCASAR Control Center</A>";
52
  if ($user[4] == "0") {
51
  if ($user[4] == "0") {
53
	  $l_logout_explain = "No Internet consultation session is actualy open on your system";
52
	  $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>";}
53
	  $l_logout = "<a href=\"http://www.google.fr\">Open an Internet session</A>";}
55
  else {
54
  else {
56
	  $l_logout_explain = "Close the session of the user : <b>$user[5]</b>";
55
	  $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>";}
56
	  $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>";
57
  $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.";
58
  $l_password_change_explain = "You should already have an Internet access account.";
60
  $l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
59
  $l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
61
}
60
}
62
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied));
61
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied));
63
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny));
62
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny));
64
 
-
 
-
 
63
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
65
echo "<head><title>ALCASAR - $l_title";
64
echo "<html><head><title>ALCASAR - $l_title";
66
?>
65
?>
67
	</title>
66
	</title>
68
	<LINK rel=stylesheet type=text/css href="css/style_intercept.css">
67
	<LINK rel=stylesheet type=text/css href="css/style_intercept.css">
69
</head>
68
</head>
70
 
69
 
71
	<BODY>
70
	<BODY>
72
<?
71
<?
73
if ($direct_access){
72
if ($direct_access){
74
	echo "
73
	echo "
75
		<DIV id=\"cadre_titre\" class=\"titre_controle\">
74
		<DIV id=\"cadre_titre\" class=\"titre_controle\">
76
			<P id=\"acces_controle\" class=\"titre_controle\">$l_title</P>";
75
			<P id=\"acces_controle\" class=\"titre_controle\">$l_title</P>";
77
if ($network_pb) {
76
if ($network_pb) {
78
	echo "	<SPAN>$l_explain_net_pb</SPAN>";
77
	echo "	<SPAN>$l_explain_net_pb</SPAN>";
79
	}
78
	}
80
	}
79
	}
81
else {
80
else {
82
	echo"
81
	echo"
83
		<DIV id=\"cadre_titre\" class=\"titre_refus\">
82
		<DIV id=\"cadre_titre\" class=\"titre_refus\">
84
			<P id=\"acces_controle\" class=\"titre_refus\">$l_title</P>";
83
			<P id=\"acces_controle\" class=\"titre_refus\">$l_title</P>";
85
	}
84
	}
86
?>
85
?>
87
			<DIV id="boite_logo">
86
			<DIV id="boite_logo">
88
				<IMG src="images/organisme.png">
87
				<IMG src="images/organisme.png">
89
			</DIV>
88
			</DIV>
90
		</DIV>
89
		</DIV>
91
		<DIV id="contenu_acces">
90
		<DIV id="contenu_acces">
92
			<DIV id="box_url">
91
			<DIV id="box_url">
93
				<? if (! $direct_access){echo "$l_required_domain : $_SERVER[HTTP_HOST]";}?>
92
				<? if (! $direct_access){echo "$l_required_domain : $_SERVER[HTTP_HOST]";}?>
94
			</DIV>
93
			</DIV>
95
<? if ($direct_access){
94
<? if ($direct_access){
96
	echo "	<DIV id=\"box_bienvenue\">
95
	echo "	<DIV id=\"box_bienvenue\">
97
				$l_welcome
96
				$l_welcome
98
			</DIV>
97
			</DIV>
99
			<DIV class=\"box_menu_courte\" id=\"box_1\">
98
			<DIV class=\"box_menu_courte\" id=\"box_1\">
100
				<IMG src=\"images/cle.png\">
99
				<IMG src=\"images/cle.png\">
101
				<SPAN>$l_password_change</SPAN>
100
				<SPAN>$l_password_change</SPAN>
102
				<P>$l_password_change_explain</P>
101
				<P>$l_password_change_explain</P>
103
			</DIV>";
102
			</DIV>";
104
		if ($user[4] == "0") {
103
		if ($user[4] == "0") {
105
			echo "
104
			echo "
106
			<DIV class=\"box_menu_courte\" id=\"box_2\">
105
			<DIV class=\"box_menu_courte\" id=\"box_2\">
107
			<SPAN>";
106
			<SPAN>";
108
			if (! $network_pb) { echo "$l_logout";}
107
			if (! $network_pb) { echo "$l_logout";}
109
			echo " </SPAN>
108
			echo " </SPAN>
110
				<IMG src=\"images/globe_acces.png\">
109
				<IMG src=\"images/globe_acces.png\">
111
				<P>$l_logout_explain</P> 
110
				<P>$l_logout_explain</P> 
112
			</DIV>";}
111
			</DIV>";}
113
			else {
112
			else {
114
			echo "
113
			echo "
115
			<DIV class=\"box_menu_courte\" id=\"box_2\">
114
			<DIV class=\"box_menu_courte\" id=\"box_2\">
116
				<SPAN>$l_logout</SPAN>
115
				<SPAN>$l_logout</SPAN>
117
				<IMG src=\"images/globe.png\">
116
				<IMG src=\"images/globe.png\">
118
				<P>$l_logout_explain</P> 
117
				<P>$l_logout_explain</P> 
119
			</DIV>";}			
118
			</DIV>";}			
120
	echo "	<DIV class=\"box_menu_large\" id=\"box_3\">
119
	echo "	<DIV class=\"box_menu_large\" id=\"box_3\">
121
				<SPAN>$l_acc_access</SPAN>
120
				<SPAN>$l_acc_access</SPAN>
122
				<IMG src=\"images/logo-alcasar.png\">
121
				<IMG src=\"images/logo-alcasar.png\">
123
				<P>$l_explain</P>
122
				<P>$l_explain</P>
124
			</DIV>";}
123
			</DIV>";}
125
	else {echo "
124
	else {echo "
126
			<DIV id=\"box_refuse\">
125
			<DIV id=\"box_refuse\">
127
				<img src=\"images/interdit.png\">
126
				<img src=\"images/interdit.png\">
128
				<P>$l_explain</P>
127
				<P>$l_explain</P>
129
			</DIV>
128
			</DIV>
130
			<DIV id=\"liens_redir\">
129
			<DIV id=\"liens_redir\">
131
				<P>$l_back_page</P>
130
				<P>$l_back_page</P>
132
			</DIV>";}
131
			</DIV>";}
133
	if (($network_pb)&&(! $direct_access))
132
	if (($network_pb)&&(! $direct_access))
134
			{
133
			{
135
	echo "		<SPAN>Diagnostic : $diagnostic</SPAN>";
134
	echo "		<SPAN>Diagnostic : $diagnostic</SPAN>";
136
}
135
}
137
?>
136
?>
138
		</DIV>
137
		</DIV>
139
	</BODY>
138
	</BODY>
140
</html>
139
</html>
141
 
140