diff --git a/lib/Froxlor/Cron/Dns/Bind.php b/lib/Froxlor/Cron/Dns/Bind.php index 882b3d99a4..9001b65e39 100644 --- a/lib/Froxlor/Cron/Dns/Bind.php +++ b/lib/Froxlor/Cron/Dns/Bind.php @@ -55,18 +55,17 @@ public function writeConfigs() $domains = $this->getDomainList(); if (empty($domains)) { - $this->logger->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, 'No domains found for nameserver-config, skipping...'); - return; - } - - $this->bindconf_file = '# ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf' . "\n" . '# Created ' . date('d.m.Y H:i') . "\n" . '# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.' . "\n\n"; - - foreach ($domains as $domain) { - if ($domain['is_child']) { - // domains that are subdomains to other main domains are handled by recursion within walkDomainList() - continue; + $this->logger->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, 'No domains found for nameserver-config, not creating any zones...'); + $this->bindconf_file = ''; + } else { + $this->bindconf_file = '# ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf' . "\n" . '# Created ' . date('d.m.Y H:i') . "\n" . '# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.' . "\n\n"; + foreach ($domains as $domain) { + if ($domain['is_child']) { + // domains that are subdomains to other main domains are handled by recursion within walkDomainList() + continue; + } + $this->walkDomainList($domain, $domains); } - $this->walkDomainList($domain, $domains); } $bindconf_file_handler = fopen(FileDir::makeCorrectFile(Settings::Get('system.bindconf_directory') . '/froxlor_bind.conf'), 'w'); diff --git a/lib/Froxlor/Cron/Dns/PowerDNS.php b/lib/Froxlor/Cron/Dns/PowerDNS.php index 65fb25cac3..3562b6035d 100644 --- a/lib/Froxlor/Cron/Dns/PowerDNS.php +++ b/lib/Froxlor/Cron/Dns/PowerDNS.php @@ -45,18 +45,16 @@ public function writeConfigs() $this->clearZoneTables($domains); if (empty($domains)) { - $this->logger->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, 'No domains found for nameserver-config, skipping...'); - return; - } - - foreach ($domains as $domain) { - if ($domain['is_child']) { - // domains that are subdomains to other main domains are handled by recursion within walkDomainList() - continue; + $this->logger->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, 'No domains found for nameserver-config, not creating any zones...'); + } else { + foreach ($domains as $domain) { + if ($domain['is_child']) { + // domains that are subdomains to other main domains are handled by recursion within walkDomainList() + continue; + } + $this->walkDomainList($domain, $domains); } - $this->walkDomainList($domain, $domains); } - $this->logger->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, 'PowerDNS database updated'); $this->reloadDaemon(); $this->logger->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, 'Task4 finished');