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 // Fail gracefully if this is not a release version of phpMyAdmin
14 if(!$GLOBALS['PMA_Config']->isGitRevision()) {
15 $response->addJSON('message', PMA_Message
::error(
16 __('An error has been detected, however, you seem to be running on a git '
17 . 'version of phpMyAdmin.')
18 . __('Automatic report submission cannot be used. Please submit a '
19 . 'manual error report on the bug tracker.')
21 . __('You may want to refresh the page.')));
22 $response->isSuccess(false);
24 } elseif (!defined('LINE_COUNTS')) {
25 $response->addJSON('message', PMA_Message
::error(
26 __('An error has been detected, however, the JavaScript line count file '
27 . 'does not seem to exist in this phpMyAdmin installation.')
28 . __('Automatic report submission cannot be used. Please submit a '
29 . 'manual error report on the bug tracker.')
31 . __('You may want to refresh the page.')));
32 $response->isSuccess(false);
36 if ($_REQUEST['send_error_report'] == true) {
37 if ($_REQUEST['automatic'] === "true") {
38 $response->addJSON('message', PMA_Message
::error(
39 __('An error has been detected and an error report has been '
40 .'automatically submitted based on your settings.')
42 . __('You may want to refresh the page.')));
44 $response->addJSON('message', PMA_Message
::success(
45 __('Thank you for submitting this report.')
47 . __('You may want to refresh the page.')));
48 if($_REQUEST['always_send'] === "true") {
49 PMA_persistOption("SendErrorReports", "always", "ask");
52 } elseif ($_REQUEST['get_settings']) {
53 $response->addJSON('report_setting', $GLOBALS['cfg']['SendErrorReports']);
55 $response->addHTML(PMA_getErrorReportForm());