Commit be8e3e8a authored by Franco Fichtner's avatar Franco Fichtner

crash reporter: remember email, helps with feedback

parent b8bbf070
...@@ -93,6 +93,14 @@ if (isset($_POST['Submit'])) { ...@@ -93,6 +93,14 @@ if (isset($_POST['Submit'])) {
$email = trim($_POST['Email']); $email = trim($_POST['Email']);
if (!empty($email)) { if (!empty($email)) {
$crash_report_header .= "Email {$email}\n"; $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']); $desc = trim($_POST['Desc']);
if (!empty($desc)) { if (!empty($desc)) {
...@@ -117,6 +125,8 @@ if (isset($_POST['Submit'])) { ...@@ -117,6 +125,8 @@ if (isset($_POST['Submit'])) {
$has_crashed = get_crash_report(true) != ''; $has_crashed = get_crash_report(true) != '';
} }
$email = isset($config['system']['contact_email']) ? $config['system']['contact_email'] : '';
if ($has_crashed) { if ($has_crashed) {
$crash_files = glob("/var/crash/*"); $crash_files = glob("/var/crash/*");
$crash_reports['System Information'] = trim($crash_report_header); $crash_reports['System Information'] = trim($crash_report_header);
...@@ -158,7 +168,7 @@ if ($has_crashed) { ...@@ -158,7 +168,7 @@ if ($has_crashed) {
echo "<p>" . gettext("Would you like to submit this crash report to the developers?") . "</p>"; 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. ' . 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>'; '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 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>"; 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) { foreach ($crash_reports as $report => $content) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment