Update po files
[phpmyadmin.git] / error_report.php
blob4fd1df28d76d8f1533b480c9b0b9a77aa1415993
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 // 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.')
20 . '<br />'
21 . __('You may want to refresh the page.')));
22 $response->isSuccess(false);
23 exit;
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.')
30 . '<br />'
31 . __('You may want to refresh the page.')));
32 $response->isSuccess(false);
33 exit;
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.')
41 . '<br />'
42 . __('You may want to refresh the page.')));
43 } else {
44 $response->addJSON('message', PMA_Message::success(
45 __('Thank you for submitting this report.')
46 . '<br />'
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']);
54 } else {
55 $response->addHTML(PMA_getErrorReportForm());