58,6 → 58,14 |
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab); |
$user = explode (" ", $tab[0]); |
|
#then we clean his cache to redirect him properly |
header("Expires: Tue, 01 Jan 2000 00:00:00 GMT"); |
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); |
header("Cache-Control: post-check=0, pre-check=0", false); |
header("Pragma: no-cache"); |
|
|
# on discrimine les accès directs sur Alcasar par rapport aux redirections (blacklist ou pannes rso) |
if (isset($_SERVER['HTTP_HOST']) && (($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_ADDR']) || preg_match ("/^alcasar$/", $_SERVER['HTTP_HOST']) || preg_match ("/^$hostname$/", $_SERVER['HTTP_HOST']) || preg_match ("/^$organisme$/", $_SERVER['HTTP_HOST']))) |
{ |
103,15 → 111,13 |
else |
{ |
# cas où l'utilisateur non-loggué décide de joindre une page HTTP/S => redirection http://URL |
# ALCASAR => redirection index.php |
# on place l'IP de l'utilisateur dans un ipset not_auth_yet pour ne pas boucler |
exec("sudo /usr/sbin/ipset add not_auth_yet $remote_ip"); |
if(!$direct_access) |
exec("sudo /usr/sbin/ipset list not_auth_yet | grep $remote_ip | wc -l 2>&1", $ipset_not_auth_yet); |
# ALCASAR => redirection index.php |
# on place l'IP de l'utilisateur dans un ipset not_auth_yet pour ne pas boucler sur index.php et atteindre la page souhaité qui sera traité par coova-chilli |
if(!$direct_access && $ipset_not_auth_yet[0] == '0') |
{ |
header("Cache-Control: no-cache, must-revalidate"); |
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
header("Content-Type: application/xml; charset=utf-8"); |
header("Location: http://".$_SERVER['HTTP_HOST']); |
exec("sudo /usr/sbin/ipset add not_auth_yet $remote_ip"); |
header("Location: http://$_SERVER[HTTP_HOST]"); |
exit; |
} |
|
281,7 → 287,6 |
$img_internet = $img_connect; |
} |
|
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 |
?> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
<html> |