From d65d6a3704f97400473abc6932cf41d0cd96360f Mon Sep 17 00:00:00 2001 From: ntimo Date: Mon, 23 Dec 2019 19:12:18 +0100 Subject: [PATCH] [API] Make Solr API return data if Solr is enabled --- data/web/json_api.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/data/web/json_api.php b/data/web/json_api.php index dddb0160..40d8c05b 100644 --- a/data/web/json_api.php +++ b/data/web/json_api.php @@ -1153,16 +1153,19 @@ if (isset($_SESSION['mailcow_cc_role']) || isset($_SESSION['pending_mailcow_cc_u echo json_encode($temp, JSON_UNESCAPED_SLASHES); break; case "solr": + $solr_status = solr_status(); $solr_size = ($solr_status['status']['dovecot-fts']['index']['size']); $solr_documents = ($solr_status['status']['dovecot-fts']['index']['numDocs']); if (strtolower(getenv('SKIP_SOLR')) != 'n') { - $solr_status = false; + $solr_enabled = false; + } else { + $solr_enabled = true; } echo json_encode(array( 'type' => 'info', - 'solr_enabled' => $solr_status, + 'solr_enabled' => $solr_enabled, 'solr_size' => $solr_size, 'solr_documents' => $solr_documents ));