Translated using Weblate (Bulgarian)
[phpmyadmin.git] / error_report.php
blob3ed045bcc7f1b8e63693235924210826f3b2e617
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 (isset($_REQUEST['send_error_report'])
14 && $_REQUEST['send_error_report'] == true
15 ) {
16 $server_response = PMA_sendErrorReport(PMA_getReportData(false));
18 if ($server_response === false) {
19 $success = false;
20 } else {
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"
27 ) {
28 if ($success) {
29 $response->addJSON(
30 'message',
31 PMA_Message::error(
32 __(
33 'An error has been detected and an error report has been '
34 .'automatically submitted based on your settings.'
36 . '<br />'
37 . __('You may want to refresh the page.')
40 } else {
41 $response->addJSON(
42 'message',
43 PMA_Message::error(
44 __(
45 'An error has been detected and an error report has been '
46 . 'generated but failed to be sent.'
48 . ' '
49 . __(
50 'If you experience any '
51 . 'problems please submit a bug report manually.'
53 . '<br />'
54 . __('You may want to refresh the page.')
58 } else {
59 if ($success) {
60 $response->addJSON(
61 'message',
62 PMA_Message::success(
63 __('Thank you for submitting this report.')
64 . '<br />'
65 . __('You may want to refresh the page.')
68 } else {
69 $response->addJSON(
70 'message',
71 PMA_Message::error(
72 __('Thank you for submitting this report.')
73 . ' '
74 . __('Unfortunately the submission failed.')
75 . ' '
76 . __(
77 'If you experience any '
78 . 'problems please submit a bug report manually.'
80 . '<br />'
81 . __('You may want to refresh the page.')
85 if (isset($_REQUEST['always_send'])
86 && $_REQUEST['always_send'] === "true"
87 ) {
88 PMA_persistOption("SendErrorReports", "always", "ask");
91 } elseif (! empty($_REQUEST['get_settings'])) {
92 $response->addJSON('report_setting', $GLOBALS['cfg']['SendErrorReports']);
93 } else {
94 $response->addHTML(PMA_getErrorReportForm());