[Web] Do not show Solr and Clam status when disabled, thanks to Tina

master
andryyy 2020-01-10 20:48:35 +01:00
parent 274c05f5bf
commit e76beebebb
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 4 additions and 6 deletions

View File

@ -4,12 +4,8 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == "admin") {
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/header.inc.php';
$_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
if (strtolower(getenv('SKIP_SOLR')) == 'n') {
$solr_status = solr_status();
}
else {
$solr_status = false;
}
$solr_status = (preg_match("/^([yY][eE][sS]|[yY])+$/", $_ENV["SKIP_SOLR"]) === false) ? solr_status() : false;
$clamd_status = (preg_match("/^([yY][eE][sS]|[yY])+$/", $_ENV["SKIP_CLAMD"]) === false) ? true : false;
?>
<div class="container">
@ -107,6 +103,8 @@ else {
<?php
$containers = (docker('info'));
foreach ($containers as $container => $container_info) {
if ($container == 'clamd-mailcow' && $clamd_status === false) { continue; }
if ($container == 'solr-mailcow' && $solr_status === false) { continue; }
?>
<li class="list-group-item">
<?=$container . ' (' . $container_info['Config']['Image'] . ')';?>