Line 1... |
Line 1... |
1 |
<?php
|
1 |
<?php
|
2 |
$private_ip = "192.168.182.1";
|
2 |
$private_ip = "192.168.182.1";
|
- |
|
3 |
$hostname = "alcasar";
|
3 |
$network_pb = False;
|
4 |
$network_pb = False;
|
4 |
$direct_access = False;
|
5 |
$direct_access = False;
|
5 |
$diagnostic = "eth0 link down";
|
6 |
$diagnostic = "eth0 link down";
|
6 |
$remote_ip = ($_SERVER['REMOTE_ADDR']);
|
7 |
$remote_ip = ($_SERVER['REMOTE_ADDR']);
|
7 |
$tab = array();$user = array();
|
8 |
$tab = array();$user = array();
|
8 |
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
|
9 |
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
|
9 |
$user = explode (" ", $tab[0]);
|
10 |
$user = explode (" ", $tab[0]);
|
10 |
# on discrimine les accès directs sur Alcasar par rapport aux redirections
|
11 |
# on discrimine les accès directs sur Alcasar par rapport aux redirections
|
11 |
if (($_SERVER['HTTP_HOST'] == $private_ip) || ($_SERVER['HTTP_HOST'] == "alcasar")){$direct_access=True;}
|
12 |
if (($_SERVER['HTTP_HOST'] == $private_ip) || ($_SERVER['HTTP_HOST'] == "alcasar") || ($_SERVER['HTTP_HOST'] == $hostname)){$direct_access=True;}
|
12 |
# Choice of language
|
13 |
# Choice of language
|
13 |
$Language = 'en';
|
14 |
$Language = 'en';
|
14 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
15 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
15 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
16 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
16 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
17 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
Line 23... |
Line 24... |
23 |
$l_explain_access_deny = "Vous tentez d'accéder à une ressource dont le contenu est réputé contenir des informations inappropriées.";
|
24 |
$l_explain_access_deny = "Vous tentez d'accéder à une ressource dont le contenu est réputé contenir des informations inappropriées.";
|
24 |
$l_explain_net_pb = "Votre portail détecte que l'accès à Internet est indisponible.";
|
25 |
$l_explain_net_pb = "Votre portail détecte que l'accès à Internet est indisponible.";
|
25 |
$l_contact_access_deny = "Contactez le responsable de la sécurité (OSSI/RSSI) si vous pensez que ce filtrage est abusif.";
|
26 |
$l_contact_access_deny = "Contactez le responsable de la sécurité (OSSI/RSSI) si vous pensez que ce filtrage est abusif.";
|
26 |
$l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information";
|
27 |
$l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information";
|
27 |
$l_welcome = "Page principale de votre portail captif";
|
28 |
$l_welcome = "Page principale de votre portail captif";
|
28 |
$l_acc_access = "<a href=\"https://$private_ip/acc\">Accès au centre de gestion (ALCASAR Control Center)</A>";
|
29 |
$l_acc_access = "<a href=\"https://$hostname/acc\">Accès au centre de gestion (ALCASAR Control Center)</A>";
|
29 |
if ($user[4] == "0") {
|
30 |
if ($user[4] == "0") {
|
30 |
$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système";
|
31 |
$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système";
|
31 |
$l_logout = "<a href=\"http://www.google.fr\">Ouvrir une session Internet</A>";}
|
32 |
$l_logout = "<a href=\"http://www.google.fr\">Ouvrir une session Internet</A>";}
|
32 |
else {
|
33 |
else {
|
33 |
$l_logout_explain = "Ferme la session de l'usager : <b>$user[5]</b>";
|
34 |
$l_logout_explain = "Ferme la session de l'usager : <b>$user[5]</b>";
|
34 |
$l_logout = "<a href=\"http://$private_ip:3990/logoff\">Déconnexion</A>";}
|
35 |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Déconnexion</A>";}
|
35 |
$l_password_change = "<a href=\"https://$private_ip/pass\">Changer votre mot de passe</A>";
|
36 |
$l_password_change = "<a href=\"https://$hostname/pass\">Changer votre mot de passe</A>";
|
36 |
$l_password_change_explain = "Vous devez posséder un compte de consultation Internet.";
|
37 |
$l_password_change_explain = "Vous devez posséder un compte de consultation Internet.";
|
37 |
$l_back_page = "<a href=\"javascript:history.back()\">Page précédente</a>";
|
38 |
$l_back_page = "<a href=\"javascript:history.back()\">Page précédente</a>";
|
38 |
}
|
39 |
}
|
39 |
else {
|
40 |
else {
|
40 |
$l_access_denied = "ACCESS DENIED";
|
41 |
$l_access_denied = "ACCESS DENIED";
|
Line 45... |
Line 46... |
45 |
$l_explain_access_deny = "Your portal has just detected that the Internet access is down";
|
46 |
$l_explain_access_deny = "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";
|
47 |
$l_explain_net_pb = "Your portal has just detected that the Internet access is down";
|
47 |
$l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
|
48 |
$l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
|
48 |
$l_contact_net_pb = "Contact your network responsive or your Internet provider for more information";
|
49 |
$l_contact_net_pb = "Contact your network responsive or your Internet provider for more information";
|
49 |
$l_welcome = "Your captive portal main page";
|
50 |
$l_welcome = "Your captive portal main page";
|
50 |
$l_acc_access = "<a href=\"https://$private_ip/acc\">Access to the ALCASAR Control Center</A>";
|
51 |
$l_acc_access = "<a href=\"https://$hostname/acc\">Access to the ALCASAR Control Center</A>";
|
51 |
if ($user[4] == "0") {
|
52 |
if ($user[4] == "0") {
|
52 |
$l_logout_explain = "No Internet consultation session is actualy open on your system";
|
53 |
$l_logout_explain = "No Internet consultation session is actualy open on your system";
|
53 |
$l_logout = "<a href=\"http://www.google.fr\">Open an Internet session</A>";}
|
54 |
$l_logout = "<a href=\"http://www.google.fr\">Open an Internet session</A>";}
|
54 |
else {
|
55 |
else {
|
55 |
$l_logout_explain = "Close the session of the user : <b>$user[5]</b>";
|
56 |
$l_logout_explain = "Close the session of the user : <b>$user[5]</b>";
|
56 |
$l_logout = "<a href=\"http://$private_ip:3990/logoff\">Logoff</A>";}
|
57 |
$l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff</A>";}
|
57 |
$l_password_change = "<a href=\"https://$private_ip/pass\">Change your password</A>";
|
58 |
$l_password_change = "<a href=\"https://$hostname/pass\">Change your password</A>";
|
58 |
$l_password_change_explain = "You should already have an Internet access account.";
|
59 |
$l_password_change_explain = "You should already have an Internet access account.";
|
59 |
$l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
|
60 |
$l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
|
60 |
}
|
61 |
}
|
61 |
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied));
|
62 |
$l_title = ($direct_access ? $l_access_welcome : ($network_pb ? $l_access_unavailable : $l_access_denied));
|
62 |
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny));
|
63 |
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb : $l_explain_access_deny));
|