Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohamed Ashraf <mohamed.ashraf.213@gmail.com>2013-11-17 23:29:14 +0400
committerMohamed Ashraf <mohamed.ashraf.213@gmail.com>2013-11-17 23:29:14 +0400
commitf82e321b753bbf5a123365c7deb474162bf45656 (patch)
tree8cc0c25c45c8183acd8c7b88164d8519eaf9bb6c /error_report.php
parent677e4496b77b653ac9311806669a0e562d701436 (diff)
Message shows failure of error report submission
Diffstat (limited to 'error_report.php')
-rw-r--r--error_report.php76
1 files changed, 57 insertions, 19 deletions
diff --git a/error_report.php b/error_report.php
index 4a4705cfc1..a0566d5609 100644
--- a/error_report.php
+++ b/error_report.php
@@ -13,28 +13,66 @@ $response = PMA_Response::getInstance();
if (isset($_REQUEST['send_error_report'])
&& $_REQUEST['send_error_report'] == true
) {
- PMA_sendErrorReport(PMA_getReportData(false));
+ $server_response = PMA_sendErrorReport(PMA_getReportData(false));
+ $success = $server_response === false ? false : json_decode($server_response, true)["success"];
if ($_REQUEST['automatic'] === "true") {
- $response->addJSON(
- 'message',
- PMA_Message::error(
- __(
- 'An error has been detected and an error report has been '
- .'automatically submitted based on your settings.'
+ if ($success) {
+ $response->addJSON(
+ 'message',
+ PMA_Message::error(
+ __(
+ 'An error has been detected and an error report has been '
+ .'automatically submitted based on your settings.'
+ )
+ . '<br />'
+ . __('You may want to refresh the page.')
)
- . '<br />'
- . __('You may want to refresh the page.')
- )
- );
+ );
+ } else {
+ $response->addJSON(
+ 'message',
+ PMA_Message::error(
+ __(
+ 'An error has been detected and an error report has been '
+ .'generated but failed to be sent.'
+ )
+ . ' '
+ . __(
+ 'If you experience any '
+ .'problems please submit a bug report manually'
+ )
+ . '<br />'
+ . __('You may want to refresh the page.')
+ )
+ );
+ }
} else {
- $response->addJSON(
- 'message',
- PMA_Message::success(
- __('Thank you for submitting this report.')
- . '<br />'
- . __('You may want to refresh the page.')
- )
- );
+ if ($success) {
+ $response->addJSON(
+ 'message',
+ PMA_Message::success(
+ __('Thank you for submitting this report.')
+ . '<br />'
+ . __('You may want to refresh the page.')
+ )
+ );
+ } else {
+ $response->addJSON(
+ 'message',
+ PMA_Message::error(
+ __('Thank you for submitting this report.')
+ . ' '
+ . __('Unfortunately the submission failed.')
+ . ' '
+ . __(
+ 'If you experience any '
+ .'problems please submit a bug report manually'
+ )
+ . '<br />'
+ . __('You may want to refresh the page.')
+ )
+ );
+ }
if ($_REQUEST['always_send'] === "true") {
PMA_persistOption("SendErrorReports", "always", "ask");
}