summaryrefslogtreecommitdiffstats
path: root/etc/inc/system.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-12-03 19:40:04 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-12-03 19:40:04 +0000
commiteb0f441c33f992846a4a4aec2b037172ff085fa1 (patch)
treef5f78fe4e9f75baaf7b9b2bd3159489f882e3f5c /etc/inc/system.inc
parentc54d236c00a12dc978dbb717e83a35103cd0c3a2 (diff)
downloadpfsense-eb0f441c33f992846a4a4aec2b037172ff085fa1.zip
pfsense-eb0f441c33f992846a4a4aec2b037172ff085fa1.tar.gz
Fix captive portal redirects now that we are using LightHTTPD
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r--etc/inc/system.inc23
1 files changed, 18 insertions, 5 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index c9a2d3e..04d01d1 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -516,10 +516,17 @@ EOD;
return $res;
}
-function system_generate_lighty_config($filename, $cert, $key, $pid_file,
- $port = 80, $document_root = "/usr/local/www/",
- $cert_location = "cert.pem", $max_procs = 2,
- $max_requests = "1", $fast_cgi_enable = true) {
+function system_generate_lighty_config($filename,
+ $cert,
+ $key,
+ $pid_file,
+ $port = 80,
+ $document_root = "/usr/local/www/",
+ $cert_location = "cert.pem",
+ $max_procs = 2,
+ $max_requests = "1",
+ $fast_cgi_enable = true,
+ $captive_portal = false) {
global $config, $g;
@@ -528,6 +535,11 @@ function system_generate_lighty_config($filename, $cert, $key, $pid_file,
echo "system_generate_lighty_config() being called $mt\n";
}
+ if($captive_portal == true) {
+ $captiveportal = ",\"mod_rewrite\"";
+ $captive_portal_rewrite = "url.rewrite-once = ( \"(.*)\" => \"/index.php?redirurl=$1\" )";
+ }
+
if($port <> "")
$lighty_port = $port;
else
@@ -589,7 +601,7 @@ EOD;
## modules to load
server.modules = (
"mod_access",
- {$module}
+ {$module}{$captiveportal}
)
## Unused modules
@@ -615,6 +627,7 @@ server.modules = (
## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root = "{$document_root}"
+{$captive_portal_rewrite}
## where to send error-messages to
#server.errorlog = "/var/log/lighttpd.error.log"
OpenPOWER on IntegriCloud