diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2011-02-07 10:43:25 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2011-02-07 10:43:25 -0500 |
commit | 90716b8ccb2ae399caaf7bdb1c3f51df2c0e1e2e (patch) | |
tree | a21cc7b6da300c3b7e2f6ff20bb8d9c333d05f88 /usr/local/www | |
parent | 2f14d0213c1dd0c9759adba87ba4ce503a0990df (diff) | |
parent | 4a1ab61871317eb8cb4b1898078a1920eefa976c (diff) | |
download | pfsense-90716b8ccb2ae399caaf7bdb1c3f51df2c0e1e2e.zip pfsense-90716b8ccb2ae399caaf7bdb1c3f51df2c0e1e2e.tar.gz |
Merge remote branch 'upstream/master'
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/crash_reporter.php | 26 | ||||
-rwxr-xr-x | usr/local/www/index.php | 31 |
2 files changed, 33 insertions, 24 deletions
diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index 06f3bdf..c75fe72 100755 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -63,10 +63,13 @@ function upload_crash_report($files) { function output_crash_reporter_html($crash_reports) { echo "<strong>" . gettext("Unfortunately we have detected a kernel crash (panic).") . "</strong></p>"; - echo "<strong>" . gettext("Would you like to submit the crash debug logs to the pfSense developers for inspection?") . "</strong></p>"; + echo "If you are unfamiliar with kernel panics wikipedia has information <a target='_new' href='http://en.wikipedia.org/wiki/Kernel_panic'>here</a>.<p/>"; + echo gettext("Would you like to submit the crash debug logs to the pfSense developers for inspection?") . "</p>"; + echo "<p>"; + echo "<i>" . gettext("Please double check the contents to ensure you are comfortable sending this information before clicking Yes.") . "</i><br/>"; echo "<p>"; echo gettext("Contents of crash reports") . ":<br/>"; - echo "<textarea rows='40' cols='65' name='crashreports'>{$crash_reports}</textarea>"; + echo "<textarea readonly rows='40' cols='65' name='crashreports'>{$crash_reports}</textarea>"; echo "<p/>"; echo "<input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("Yes") . "\">"; echo "<input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("No") . "\">"; @@ -77,6 +80,12 @@ function output_crash_reporter_html($crash_reports) { $pgtitle = array(gettext("Diagnostics"),gettext("Crash reporter")); include('head.inc'); +$crash_report_header = "Crash report begins. Anonymous machine information:\n\n"; +$crash_report_header .= php_uname("m") . "\n"; +$crash_report_header .= php_uname("r") . "\n"; +$crash_report_header .= php_uname("v") . "\n"; +$crash_report_header .= "\nCrash report details:\n"; + ?> <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> @@ -88,6 +97,7 @@ include('head.inc'); <?php if (gettext($_POST['Submit']) == "Yes") { echo gettext("Processing..."); + file_put_contents("/var/crash/crashreport_header.txt", $crash_report_header); exec("/usr/bin/gzip /var/crash/*"); $files_to_upload = glob("/var/crash/*"); echo "<p/>"; @@ -98,7 +108,7 @@ include('head.inc'); print_r($resp); exec("rm /var/crash/*"); echo gettext("Crash files have been submitted for inspection."); - echo "<p/><a href='/'>" . gettext("Continue") . "</a>"; + echo "<p/><a href='/'>" . gettext("Continue") . "</a>" . gettext(" and delete crash report files."); } else { echo "Could not find any crash files."; } @@ -108,11 +118,15 @@ include('head.inc'); exit; } else { $crash_files = glob("/var/crash/*"); - if(is_array($crash_files)) - foreach($crash_files as $cf) + $crash_reports .= $crash_report_header; + if(is_array($crash_files)) { + foreach($crash_files as $cf) { + $crash_reports .= "\nFilename: {$cf}\n"; $crash_reports .= file_get_contents($cf); - else + } + } else { echo "Could not locate any crash data."; + } output_crash_reporter_html($crash_reports); } ?> diff --git a/usr/local/www/index.php b/usr/local/www/index.php index 945f99b..43520ba 100755 --- a/usr/local/www/index.php +++ b/usr/local/www/index.php @@ -42,24 +42,6 @@ ##|*MATCH=index.php* ##|-PRIV -$crash = glob("/var/crash/*"); -$x = 0; -if(is_array($crash)) { - foreach($crash as $c) { - if($c == "minfree") - continue; - if($c == ".") - continue; - if($c == "..") - continue; - if($c == "") - continue; - $x++; - } - if($x > 0) - $savemsg = "We have detected a crash report. Click <a href='crash_reporter.php'>here</a> fore more information."; -} - // Turn off csrf for the dashboard $nocsrf = true; @@ -74,6 +56,19 @@ require_once('functions.inc'); require_once('guiconfig.inc'); require_once('notices.inc'); +// Check to see if we have a crash report +$crash = glob("/var/crash/*"); +$x = 0; +$skip_files = array(".", "..", "minfree", ""); +if(is_array($crash)) { + foreach($crash as $c) { + if (!in_array(basename($c), $skip_files)) + $x++; + } + if($x > 0) + $savemsg = "{$g['product_name']} has detected a crash report. Click <a href='crash_reporter.php'>here</a> for more information."; +} + ##build list of widgets $directory = "/usr/local/www/widgets/widgets/"; $dirhandle = opendir($directory); |