mirror of
https://github.com/PirateBox-Dev/PirateBoxScripts_Webserver.git
synced 2026-12-05 08:48:41 +00:00
Captive Portal: Make use of PirateBox environment variable for intial redirect
This commit is contained in:
1 parent
2e23a2eb91
commit
948cb8178b
2 files changed
+5
-2
No files matched your search
@@ -15,7 +15,7 @@
|
||||
// captive portal
|
||||
//
|
||||
function get_config(){
|
||||
$hostname="piratebox.lan";
|
||||
$hostname=$_ENV['PIRATEBOX_HOSTNAME'];
|
||||
return array (
|
||||
'SQLITE_FILE' => "sqlite:/tmp/captive.sqlite" ,
|
||||
'minimum_answers' => 5 ,
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
// $_SERVER['REQUEST_URI'] - URL , needed for Client OS
|
||||
// $_SERVER['HTTP_USER_AGENT'] - needed for Client OS verification
|
||||
// ( $_SERVER['SERVER_NAME'] - possibly )
|
||||
//
|
||||
// For Redirect:
|
||||
// $_ENV['PIRATEBOX_HOSTNAME']
|
||||
|
||||
require_once ("captive.func.php");
|
||||
|
||||
@@ -15,7 +18,7 @@ require_once ("captive.func.php");
|
||||
$config = get_config();
|
||||
|
||||
if ( isset ($_GET['enter'] ) ) {
|
||||
header('Location: http://piratebox.lan/', true, 302);
|
||||
header('Location: http://'.$config['hostname'], true, 302);
|
||||
count_ip($_SERVER['REMOTE_ADDR'],"no",99);
|
||||
|
||||
exit;
|
||||
|
||||
Reference in new issue
Block a user