Line 1... |
Line 1... |
1 |
<?php
|
1 |
<?php
|
2 |
# $Id: index.php 1820 2016-04-07 13:59:46Z raphael.pion $
|
2 |
# $Id: index.php 1822 2016-04-08 16:21:33Z raphael.pion $
|
3 |
#
|
3 |
#
|
4 |
# index.php for ALCASAR captive portal
|
4 |
# index.php for ALCASAR captive portal
|
5 |
# by REXY
|
5 |
# by REXY
|
6 |
# UI & css style by stephane ERARD
|
6 |
# UI & css style by stephane ERARD
|
7 |
# The contents of this file may be used under the terms of the GNU
|
7 |
# The contents of this file may be used under the terms of the GNU
|
Line 100... |
Line 100... |
100 |
}
|
100 |
}
|
101 |
}
|
101 |
}
|
102 |
}
|
102 |
}
|
103 |
else
|
103 |
else
|
104 |
{
|
104 |
{
|
105 |
# cas où l'utilisateur non-loggué décide de joindre une page HTTP/S => redirection index.php&url=URL
|
105 |
# cas où l'utilisateur non-loggué décide de joindre une page HTTP/S => redirection http://URL
|
106 |
# ALCASAR => redirection index.php
|
106 |
# ALCASAR => redirection index.php
|
107 |
# on place l'IP de l'utilisateur dans un ipset user_not_connected pour ne pas boucler
|
107 |
# on place l'IP de l'utilisateur dans un ipset user_not_connected pour ne pas boucler
|
108 |
exec("sudo /usr/sbin/ipset add user_not_connected_yet $remote_ip");
|
108 |
exec("sudo /usr/sbin/ipset add user_not_connected_yet $remote_ip");
|
109 |
if(!$direct_access)
|
109 |
if(!$direct_access)
|
110 |
{
|
110 |
{
|
111 |
header("Location: http://alcasar?url=".$_SERVER['HTTP_HOST']);
|
111 |
header("Location: http://".$_SERVER['HTTP_HOST']);
|
112 |
exit;
|
112 |
exit;
|
113 |
}
|
113 |
}
|
114 |
|
114 |
|
115 |
}
|
115 |
}
|
116 |
####
|
116 |
####
|
Line 137... |
Line 137... |
137 |
$l_certif_explain = "Permet l'échange de données sécurisées entre votre station de consultation et le portail captif ALCASAR.<BR>Si ce certificat n'est pas enregistré sur votre station de consultation, il est possible que des alertes de sécurités soient émises par votre navigateur.<br><br>";
|
137 |
$l_certif_explain = "Permet l'échange de données sécurisées entre votre station de consultation et le portail captif ALCASAR.<BR>Si ce certificat n'est pas enregistré sur votre station de consultation, il est possible que des alertes de sécurités soient émises par votre navigateur.<br><br>";
|
138 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Aide complémentaire</a>";
|
138 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Aide complémentaire</a>";
|
139 |
$l_category = "catégorie :";
|
139 |
$l_category = "catégorie :";
|
140 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
140 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
141 |
$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système.";
|
141 |
$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système.";
|
142 |
if(isset($_GET["url"]))
|
- |
|
143 |
{
|
- |
|
144 |
$l_logout = "<a href=\"http://".$_GET["url"]."\">Ouvrir une session Internet</a>";
|
- |
|
145 |
}
|
- |
|
146 |
else
|
- |
|
147 |
{
|
- |
|
148 |
$l_logout = "<a href=\"http://www.google.com\">Ouvrir une session Internet</a>";
|
142 |
$l_logout = "<a href=\"http://www.google.com\">Ouvrir une session Internet</a>";
|
149 |
}
|
143 |
|
150 |
|
144 |
|
151 |
}
|
145 |
}
|
152 |
else {
|
146 |
else {
|
153 |
if ($user[5] != $user[0]) // authentication exception or not
|
147 |
if ($user[5] != $user[0]) // authentication exception or not
|
154 |
{
|
148 |
{
|
Line 186... |
Line 180... |
186 |
$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>";
|
180 |
$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>";
|
187 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Essa foi uma ajuda complementar</a>";
|
181 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Essa foi uma ajuda complementar</a>";
|
188 |
$l_category = "categoria :";
|
182 |
$l_category = "categoria :";
|
189 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
183 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
190 |
$l_logout_explain = "Não há conexão de Internet aberta em seu computador, deseja conectar?";
|
184 |
$l_logout_explain = "Não há conexão de Internet aberta em seu computador, deseja conectar?";
|
191 |
if(isset($_GET["url"]))
|
- |
|
192 |
{
|
- |
|
193 |
$l_logout = "<a href=\"http://".$_GET["url"]."\">Abrir uma conexão de Internet</a>";
|
- |
|
194 |
}
|
- |
|
195 |
else
|
- |
|
196 |
{
|
- |
|
197 |
$l_logout = "<a href=\"http://www.google.com\">Abrir uma conexão de Internet</a>";
|
185 |
$l_logout = "<a href=\"http://www.google.com\">Abrir uma conexão de Internet</a>";
|
198 |
}
|
186 |
|
199 |
|
187 |
|
200 |
}
|
188 |
}
|
201 |
else {
|
189 |
else {
|
202 |
if ($user[5] != $user[0]) // authentication exception or not
|
190 |
if ($user[5] != $user[0]) // authentication exception or not
|
203 |
{
|
191 |
{
|
Line 235... |
Line 223... |
235 |
$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>";
|
223 |
$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>";
|
236 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
|
224 |
$l_certif_explain_help = "<a href=\"alcasar-certificat.pdf\" target=\"_blank\">Complementary help</a>";
|
237 |
$l_category = "category :";
|
225 |
$l_category = "category :";
|
238 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
226 |
if ((isset ($user[4])) && ($user[4] == "0")) {
|
239 |
$l_logout_explain = "No Internet consultation session is actualy open on your system";
|
227 |
$l_logout_explain = "No Internet consultation session is actualy open on your system";
|
240 |
if(isset($_GET["url"]))
|
- |
|
241 |
{
|
- |
|
242 |
$l_logout = "<a href=\"http://".$_GET["url"]."\">Open an Internet session</a>";
|
- |
|
243 |
}
|
- |
|
244 |
else
|
- |
|
245 |
{
|
- |
|
246 |
$l_logout = "<a href=\"http://www.google.com\">Open an Internet session</a>";
|
228 |
$l_logout = "<a href=\"http://www.google.com\">Open an Internet session</a>";
|
247 |
}
|
229 |
|
248 |
|
230 |
|
249 |
}
|
231 |
}
|
250 |
else {
|
232 |
else {
|
251 |
if ($user[5] != $user[0]) // authentication exception or not
|
233 |
if ($user[5] != $user[0]) // authentication exception or not
|
252 |
{
|
234 |
{
|
Line 419... |
Line 401... |
419 |
<div id="adm" class="corn">
|
401 |
<div id="adm" class="corn">
|
420 |
<a href="https://<?php echo $hostname; ?>/acc/"><img src=<?php echo $img_rep.''.$img_adm; ?>></a>
|
402 |
<a href="https://<?php echo $hostname; ?>/acc/"><img src=<?php echo $img_rep.''.$img_adm; ?>></a>
|
421 |
</div>
|
403 |
</div>
|
422 |
</div>
|
404 |
</div>
|
423 |
</body>
|
405 |
</body>
|
424 |
</html>
|
- |
|
425 |
|
406 |
</html>
|
- |
|
407 |
|