diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-12-13 16:34:16 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-12-13 16:34:25 -0200 |
commit | 92603e27d98bb89f63b2c0581f2fad2c39a9b09e (patch) | |
tree | 1dc5c75bd2d2e0bfd013bc8e1286ad791adbb4df /usr | |
parent | 940ef0e3bd2e95f43e0eafed01e8b20b08cc20c1 (diff) | |
download | pfsense-92603e27d98bb89f63b2c0581f2fad2c39a9b09e.zip pfsense-92603e27d98bb89f63b2c0581f2fad2c39a9b09e.tar.gz |
Add an option to restore default logout/error/portal custom pages on Captive Portal. Fixes #3362
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/services_captiveportal.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php index 4c5d5a0..3bf53f7 100755 --- a/usr/local/www/services_captiveportal.php +++ b/usr/local/www/services_captiveportal.php @@ -82,6 +82,11 @@ if ($_GET['act'] == "viewhtml") { echo $file_data; exit; +} else if ($_GET['act'] == "delhtmlhtml" && $a_cp[$cpzone] && $a_cp[$cpzone]['page']['htmltext']) { + unset($a_cp[$cpzone]['page']['htmltext']); + write_config(sprintf(gettext("Captive Portal: zone %s: Restore default portal page"), $cpzone)); + header("Location: services_captiveportal.php?zone={$cpzone}"); + exit; } else if ($_GET['act'] == "viewerrhtml") { if ($a_cp[$cpzone] && $a_cp[$cpzone]['page']['errtext']) echo base64_decode($a_cp[$cpzone]['page']['errtext']); @@ -96,6 +101,11 @@ if ($_GET['act'] == "viewhtml") { echo $file_data; exit; +} else if ($_GET['act'] == "delerrhtml" && $a_cp[$cpzone] && $a_cp[$cpzone]['page']['errtext']) { + unset($a_cp[$cpzone]['page']['errtext']); + write_config(sprintf(gettext("Captive Portal: zone %s: Restore default error page"), $cpzone)); + header("Location: services_captiveportal.php?zone={$cpzone}"); + exit; } else if ($_GET['act'] == "viewlogouthtml") { if ($a_cp[$cpzone] && $a_cp[$cpzone]['page']['logouttext']) echo base64_decode($a_cp[$cpzone]['page']['logouttext']); @@ -110,6 +120,11 @@ if ($_GET['act'] == "viewhtml") { echo $file_data; exit; +} else if ($_GET['act'] == "dellogouthtml" && $a_cp[$cpzone] && $a_cp[$cpzone]['page']['logouttext']) { + unset($a_cp[$cpzone]['page']['logouttext']); + write_config(sprintf(gettext("Captive Portal: zone %s: Restore default logout page"), $cpzone)); + header("Location: services_captiveportal.php?zone={$cpzone}"); + exit; } if (!is_array($config['ca'])) @@ -974,6 +989,10 @@ function enable_change(enable_change) { <a href="<?=$href?>" target="_new"><?=gettext("View current page"); ?></a> <br /> <a href="?zone=<?=$cpzone?>&act=gethtmlhtml" target="_blank"><?=gettext("Download current page"); ?></a> + <br /> + <a href="?zone=<?=$cpzone?>&act=delhtmlhtml" onclick="return confirm('Do you really want to restore default page?')" target="_blank"> + <?=gettext("Restore default portal page"); ?> + </a> <br> <br> <?php endif; ?> @@ -1010,6 +1029,10 @@ function enable_change(enable_change) { <a href="?zone=<?=$cpzone?>&act=viewerrhtml" target="_blank"><?=gettext("View current page"); ?></a> <br /> <a href="?zone=<?=$cpzone?>&act=geterrhtml" target="_blank"><?=gettext("Download current page"); ?></a> + <br /> + <a href="?zone=<?=$cpzone?>&act=delerrhtml" onclick="return confirm('Do you really want to restore default page?')" target="_blank"> + <?=gettext("Restore default error page"); ?> + </a> <br> <br> <?php endif; ?> @@ -1026,6 +1049,10 @@ function enable_change(enable_change) { <a href="?zone=<?=$cpzone?>&act=viewlogouthtml" target="_blank"><?=gettext("View current page"); ?></a> <br /> <a href="?zone=<?=$cpzone?>&act=getlogouthtml" target="_blank"><?=gettext("Download current page"); ?></a> + <br /> + <a href="?zone=<?=$cpzone?>&act=dellogouthtml" onclick="return confirm('Do you really want to restore default page?')" target="_blank"> + <?=gettext("Restore default logout page"); ?> + </a> <br> <br> <?php endif; ?> |