diff --git a/src/usr/local/www/status.php b/src/usr/local/www/status.php index fc2c6328b1..baa596d659 100644 --- a/src/usr/local/www/status.php +++ b/src/usr/local/www/status.php @@ -74,6 +74,25 @@ require_once("gwlb.inc"); $output_path = "/tmp/status_output/"; $output_file = "/tmp/status_output.tgz"; +if ($_POST['submit'] == "DOWNLOAD" && file_exists($output_file)) { + session_cache_limiter('public'); + $fd = fopen($output_file, "rb"); + header("Content-Type: application/octet-stream"); + header("Content-Length: " . filesize($output_file)); + header("Content-Disposition: attachment; filename=\"" . + trim(htmlentities(basename($output_file))) . "\""); + if (isset($_SERVER['HTTPS'])) { + header('Pragma: '); + header('Cache-Control: '); + } else { + header("Pragma: private"); + header("Cache-Control: private, must-revalidate"); + } + + fpassthru($fd); + exit; +} + if (is_dir($output_path)) { unlink_if_exists("{$output_path}/*"); @rmdir($output_path); @@ -371,17 +390,24 @@ exec("/bin/date", $dateOutput, $dateStatus); $currentDate = $dateOutput[0]; $pgtitle = array($g['product_name'], "Status"); -include("head.inc"); +include("head.inc"); ?> -print_info_box( +
+ +