mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
crash reporter: remember email, helps with feedback
This commit is contained in:
parent
b8bbf07081
commit
be8e3e8a76
@ -93,6 +93,14 @@ if (isset($_POST['Submit'])) {
|
||||
$email = trim($_POST['Email']);
|
||||
if (!empty($email)) {
|
||||
$crash_report_header .= "Email {$email}\n";
|
||||
if (!isset($config['system']['contact_email']) ||
|
||||
$config['system']['contact_email'] !== $email) {
|
||||
$config['system']['contact_email'] = $email;
|
||||
write_config('Updated crash reporter contact email.');
|
||||
}
|
||||
} elseif (isset($config['system']['contact_email'])) {
|
||||
unset($config['system']['contact_email']);
|
||||
write_config('Removed crash reporter contact email.');
|
||||
}
|
||||
$desc = trim($_POST['Desc']);
|
||||
if (!empty($desc)) {
|
||||
@ -117,6 +125,8 @@ if (isset($_POST['Submit'])) {
|
||||
$has_crashed = get_crash_report(true) != '';
|
||||
}
|
||||
|
||||
$email = isset($config['system']['contact_email']) ? $config['system']['contact_email'] : '';
|
||||
|
||||
if ($has_crashed) {
|
||||
$crash_files = glob("/var/crash/*");
|
||||
$crash_reports['System Information'] = trim($crash_report_header);
|
||||
@ -158,7 +168,7 @@ if ($has_crashed) {
|
||||
echo "<p>" . gettext("Would you like to submit this crash report to the developers?") . "</p>";
|
||||
echo '<hr><p>' . gettext('You can help us further by adding your contact information and a problem description. ' .
|
||||
'Please note that providing your contact information greatly improves the chances of bugs being fixed.') . '</p>';
|
||||
echo sprintf('<p><input type="text" placeholder="%s" name="Email"></p>', gettext('your@email.com'));
|
||||
echo sprintf('<p><input type="text" placeholder="%s" name="Email" value="%s"></p>', gettext('your@email.com'), $email);
|
||||
echo sprintf('<p><textarea rows="5" placeholder="%s" name="Desc"></textarea></p>', gettext('A short problem description or steps to reproduce.'));
|
||||
echo "<hr><p>" . gettext("Please double-check the following contents to ensure you are comfortable submitting the following information.") . "</p>";
|
||||
foreach ($crash_reports as $report => $content) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user