From 9aadffbca86356b334bf9d418278cf209a016b85 Mon Sep 17 00:00:00 2001
From: Franco Fichtner " . gettext("Unfortunately we have detected a programming bug.") . " " . gettext("Would you like to submit the programming debug logs to the OPNsense developers for inspection?") . " " . gettext("Please double check the contents to ensure you are comfortable sending this information before clicking Yes.") . " " . gettext("Contents of crash reports") . ": " . gettext(" - Submit this to the developers for inspection") . " " . gettext(" - Just delete the crash report and take me back to the Dashboard") . " ' . gettext('Processing...');
ob_flush();
flush();
- if(is_array($files_to_upload)) {
- $resp = upload_crash_report($files_to_upload);
- array_map('unlink', glob("/var/crash/*"));
- // Erase the contents of the PHP error log
- fclose(fopen("/tmp/PHP_errors.log", 'w'));
- echo " " . gettext("Continue") . "" . gettext(" and delete crash report files from local disk.") . " ' . gettext('Luckily we have not detected a programming bug.') . '
";
- echo "
";
- print_r($resp);
- echo "
' . gettext('Uploading...');
+ ob_flush();
+ flush();
+ $resp = upload_crash_report($files_to_upload);
+ echo '
' . print_r($resp) . '
'; + if ($_POST['Submit'] == 'yes') { + echo gettext('Thank you for submitting this crash report.'); + } elseif ($_POST['Submit'] == 'no') { + echo gettext('Please consider submitting a crash report if the error persists.'); + } else { + echo gettext('Luckily we have not detected a programming bug.'); + } + echo '
'; } else { $crash_files = glob("/var/crash/*"); $crash_reports = $crash_report_header; + $php_errors = @file_get_contents('/tmp/PHP_errors.log'); if (!empty($php_errors)) { $crash_reports .= "\nPHP Errors:\n"; $crash_reports .= $php_errors; } - if(is_array($crash_files)) { - foreach($crash_files as $cf) { - if(filesize($cf) < FILE_SIZE) { - $crash_reports .= "\nFilename: {$cf}\n"; - $crash_reports .= file_get_contents($cf); - } + foreach ($crash_files as $cf) { + if (filesize($cf) < FILE_SIZE) { + $crash_reports .= "\nFilename: {$cf}\n"; + $crash_reports .= file_get_contents($cf); } - } else { - echo "Could not locate any crash data."; } - output_crash_reporter_html($crash_reports); + echo "" . gettext("Unfortunately we have detected at least one programming bug.") . "
"; + echo "
" . sprintf(gettext("Would you like to submit this crash report to the %s developers?"), $g['product_name']) . "
"; + echo "
"; + echo "
" . gettext("Please-double check the contents to ensure you are comfortable submitting the following information:") . "