Tweaks get_problems

This commit is contained in:
Alan Garcia 2014-07-04 16:10:25 +00:00
parent 1f6766f7db
commit 71f3a60e8c
1 changed files with 18 additions and 9 deletions

View File

@ -2170,17 +2170,26 @@ order by
// by subdomain // by subdomain
$tmp = array(); $tmp = array();
foreach ($da['sub'] as $sub) { foreach ($da['sub'] as $sub) {
if ($sub['web_action']!='OK') continue; // Skip when disable or deleted
if (!$sub['only_dns']) { if ($sub['enable']=='DISABLE') continue;
if ($sub['enable']=='DISABLED') continue;
if ($sub['web_action']=='DELETE') continue;
// Skip if "only_dns" and no conf generated
if ($sub['only_dns']) continue;
// Init the value in the tmp array
if (!isset($tmp[$sub['fqdn']])) { if (!isset($tmp[$sub['fqdn']])) {
$tmp[$sub['fqdn']] = 0; $tmp[$sub['fqdn']] = 0;
} }
// Increment value
$tmp[$sub['fqdn']]++; $tmp[$sub['fqdn']]++;
// If there is more than 1 configuration file for this FQDN, alert !
if ($tmp[$sub['fqdn']] >= 2) { if ($tmp[$sub['fqdn']] >= 2) {
$errors[$sub['fqdn']] = sprintf(_("Problem on %s: there is more than 1 web configuration going to be generated for this sub-domain."), $sub['fqdn']); $errors[$sub['fqdn']] = sprintf(_("Problem on %s: there is more than 1 web configuration going to be generated for this sub-domain."), $sub['fqdn']);
} }
} }
}
// Check if we know each type of subdomain // Check if we know each type of subdomain
// Example: we may not know WEBMAIL if we upgrade from a previous setup // Example: we may not know WEBMAIL if we upgrade from a previous setup