summaryrefslogtreecommitdiffstats
path: root/etc/inc/captiveportal.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-11-26 22:06:23 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-11-26 22:06:23 +0000
commit877ac35dc99371c7a854a4b9d0a79aa04901bb22 (patch)
treed0356122a49948f5f77dc9f777ecef33b8bede39 /etc/inc/captiveportal.inc
parent51bb9b9467620bd60a857ae988efd5d79af692f4 (diff)
downloadpfsense-877ac35dc99371c7a854a4b9d0a79aa04901bb22.zip
pfsense-877ac35dc99371c7a854a4b9d0a79aa04901bb22.tar.gz
Use Lighty. Hopefully it's here to stay, and mini_httpd is dead, jim.
Diffstat (limited to 'etc/inc/captiveportal.inc')
-rw-r--r--etc/inc/captiveportal.inc40
1 files changed, 13 insertions, 27 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index ebf6271..34167e7 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -187,32 +187,18 @@ EOD;
$procs = 16;
}
- /* start web server */
- mwexec("/usr/local/sbin/mini_httpd -a -M 0 -u root -maxproc {$procs}" .
- " -p 8000 -i {$g['varrun_path']}/mini_httpd.cp.pid");
-
- /* fire up another one for HTTPS if requested */
- if (isset($config['captiveportal']['httpslogin']) &&
- $config['captiveportal']['certificate'] && $config['captiveportal']['private-key']) {
-
- $cert = base64_decode($config['captiveportal']['certificate']);
- $key = base64_decode($config['captiveportal']['private-key']);
-
- $fd = fopen("{$g['varetc_path']}/cert-portal.pem", "w");
- if (!$fd) {
- printf("Error: cannot open cert-portal.pem in system_webgui_start().\n");
- return 1;
- }
- chmod("{$g['varetc_path']}/cert-portal.pem", 0600);
- fwrite($fd, $cert);
- fwrite($fd, "\n");
- fwrite($fd, $key);
- fclose($fd);
-
- mwexec("/usr/local/sbin/mini_httpd -S -a -M 0 -E {$g['varetc_path']}/cert-portal.pem" .
- " -u root -maxproc 16 -p 8001" .
- " -i {$g['varrun_path']}/mini_httpd.cps.pid");
- }
+ /* TEMPORARY! FAST_CGI reports _FALSE_ client ip
+ * addresses.
+ */
+ $use_fastcgi = false;
+
+ /* generate lighttpd configuration */
+ system_generate_lighty_config("{$g['varetc_path']}/lighty-CaptivePortal.conf",
+ $key, $cert, "lighty-CaptivePortal.pid", "8000", "/usr/local/captiveportal/",
+ "cert-portal.pem", "1", $procs, $use_fastcgi);
+
+ /* attempt to start lighttpd */
+ $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-CaptivePortal.conf");
/* start pruning process (interval = 60 seconds) */
mwexec("/usr/local/bin/minicron 60 {$g['varrun_path']}/minicron.pid " .
@@ -792,4 +778,4 @@ function captiveportal_logportalauth($user,$mac,$ip,$status) {
closelog();
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud