112,11 → 112,19 |
if(!$direct_access && $ipset_not_auth_yet[0] == '0') |
{ |
exec("sudo /usr/sbin/ipset add not_auth_yet $remote_ip"); # Add in the ipset "not_auth_yet" to not loop when redirected |
echo "<script>window.location.assign='http://$_SERVER[HTTP_HOST]'</script>"; |
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") |
{ |
header("Location: http://$_SERVER[HTTP_HOST]"); |
} |
else |
{ |
echo "<script>window.location.reload(true)</script>"; # the user web browser need to perform a new DNS request when redirected (as in a "<CTRL>+F5") |
//header("Location: http://$_SERVER[HTTP_HOST]"); |
echo "<script>window.location.href='http://$_SERVER[HTTP_HOST]'</script>"; |
} |
exit; |
} |
|
|
} |
|
# Choice of language |