diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2010-05-21 22:18:16 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2010-05-21 22:18:16 -0400 |
commit | 7a7e94a7be45209c9043678e292e7b7873d0a5a4 (patch) | |
tree | 6234285310270d35d18ba1f6eb8f10a845e6b515 /etc | |
parent | 851f41843af062b44c1411b610c15848c3dcaf95 (diff) | |
download | pfsense-7a7e94a7be45209c9043678e292e7b7873d0a5a4.zip pfsense-7a7e94a7be45209c9043678e292e7b7873d0a5a4.tar.gz |
Allow php code to be included in the primary captive portal page. Add new ORIGINAL_PORTAL_IP post item which will be experimenting with a master mutli voucher setup.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/captiveportal.inc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 28dab57..48f9dba 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -181,6 +181,14 @@ EOD; $fd = @fopen("{$g['varetc_path']}/captiveportal.html", "w"); if ($fd) { + // Special case handling. Convert so that we can pass this page + // through the PHP interpreter later without clobbering the vars. + $htmltext = str_replace("\$PORTAL_REDIRURL\$", "#PORTAL_REDIRURL#", $htmltext); + $htmltext = str_replace("\$PORTAL_MESSAGE\$", "#PORTAL_MESSAGE#", $htmltext); + $htmltext = str_replace("\$CLIENT_MAC\$", "#CLIENT_MAC#", $htmltext); + $htmltext = str_replace("\$CLIENT_IP\$", "#CLIENT_IP#", $htmltext); + $htmltext = str_replace("\$ORIGINAL_PORTAL_IP\$", "#ORIGINAL_PORTAL_IP#", $htmltext); + $htmltext = str_replace("\$PORTAL_ACTION\$", "#PORTAL_ACTION#", $htmltext); fwrite($fd, $htmltext); fclose($fd); } @@ -210,6 +218,14 @@ EOD; $fd = @fopen("{$g['varetc_path']}/captiveportal-error.html", "w"); if ($fd) { + // Special case handling. Convert so that we can pass this page + // through the PHP interpreter later without clobbering the vars. + $errtext = str_replace("\$PORTAL_REDIRURL\$", "#PORTAL_REDIRURL#", $errtext); + $errtext = str_replace("\$PORTAL_MESSAGE\$", "#PORTAL_MESSAGE#", $errtext); + $errtext = str_replace("\$CLIENT_MAC\$", "#CLIENT_MAC#", $errtext); + $errtext = str_replace("\$CLIENT_IP\$", "#CLIENT_IP#", $errtext); + $errtext = str_replace("\$ORIGINAL_PORTAL_IP\$", "#ORIGINAL_PORTAL_IP#", $errtext); + $errtext = str_replace("\$PORTAL_ACTION\$", "#PORTAL_ACTION#", $errtext); fwrite($fd, $errtext); fclose($fd); } |