2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Handle error report submission
8 require_once 'libraries/common.inc.php';
9 require_once 'libraries/error_report.lib.php';
11 $response = PMA_Response
::getInstance();
13 if (isset($_REQUEST['send_error_report'])
14 && $_REQUEST['send_error_report'] == true
16 $server_response = PMA_sendErrorReport(PMA_getReportData(false));
18 if ($server_response === false) {
21 $decoded_response = json_decode($server_response, true);
22 $success = !empty($decoded_response) ?
$decoded_response["success"] : false;
25 if (isset($_REQUEST['automatic'])
26 && $_REQUEST['automatic'] === "true"
33 'An error has been detected and an error report has been '
34 .'automatically submitted based on your settings.'
37 . __('You may want to refresh the page.')
45 'An error has been detected and an error report has been '
46 . 'generated but failed to be sent.'
50 'If you experience any '
51 . 'problems please submit a bug report manually.'
54 . __('You may want to refresh the page.')
63 __('Thank you for submitting this report.')
65 . __('You may want to refresh the page.')
72 __('Thank you for submitting this report.')
74 . __('Unfortunately the submission failed.')
77 'If you experience any '
78 . 'problems please submit a bug report manually.'
81 . __('You may want to refresh the page.')
85 if (isset($_REQUEST['always_send'])
86 && $_REQUEST['always_send'] === "true"
88 PMA_persistOption("SendErrorReports", "always", "ask");
91 } elseif (! empty($_REQUEST['get_settings'])) {
92 $response->addJSON('report_setting', $GLOBALS['cfg']['SendErrorReports']);
94 $response->addHTML(PMA_getErrorReportForm());