Refactored ConfigFile class so that it is no longer a singleton
[phpmyadmin.git] / error_report.php
blob1b9fa017f8abe80d35883dc921d2d4d6b0b1a356
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Handle error report submission
6 * @package PhpMyAdmin
7 */
8 require_once 'libraries/common.inc.php';
9 require_once 'libraries/error_report.lib.php';
11 $response = PMA_Response::getInstance();
13 if ($_REQUEST['send_error_report'] == true) {
14 PMA_sendErrorReport(PMA_getReportData(false));
15 if ($_REQUEST['automatic'] === "true") {
16 $response->addJSON(
17 'message',
18 PMA_Message::error(
19 __(
20 'An error has been detected and an error report has been '
21 .'automatically submitted based on your settings.'
23 . '<br />'
24 . __('You may want to refresh the page.')
27 } else {
28 $response->addJSON(
29 'message',
30 PMA_Message::success(
31 __('Thank you for submitting this report.')
32 . '<br />'
33 . __('You may want to refresh the page.')
36 if ($_REQUEST['always_send'] === "true") {
37 PMA_persistOption("SendErrorReports", "always", "ask");
40 } elseif ($_REQUEST['get_settings']) {
41 $response->addJSON('report_setting', $GLOBALS['cfg']['SendErrorReports']);
42 } else {
43 $response->addHTML(PMA_getErrorReportForm());