From 731427255eaf3e6fa3a1dc95f89f691fa57183da Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Sun, 7 Aug 2016 17:22:28 +0200 Subject: [PATCH] fix call to undefined method pdns::_generateDomainConfig() in PowerDNS cronjob when using custom zone-file in a domain Signed-off-by: Michael Kaufmann (d00p) --- scripts/jobs/cron_tasks.inc.dns.20.pdns.php | 51 +++++++++------------ 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/scripts/jobs/cron_tasks.inc.dns.20.pdns.php b/scripts/jobs/cron_tasks.inc.dns.20.pdns.php index 594cb41d..ddf89f45 100644 --- a/scripts/jobs/cron_tasks.inc.dns.20.pdns.php +++ b/scripts/jobs/cron_tasks.inc.dns.20.pdns.php @@ -61,39 +61,32 @@ class pdns extends DnsBase $subzones[] = $this->walkDomainList($domains[$child_domain_id], $domains); } - if ($domain['zonefile'] == '') { - // check for system-hostname - $isFroxlorHostname = false; - if (isset($domain['froxlorhost']) && $domain['froxlorhost'] == 1) { - $isFroxlorHostname = true; - } + // check for system-hostname + $isFroxlorHostname = false; + if (isset($domain['froxlorhost']) && $domain['froxlorhost'] == 1) { + $isFroxlorHostname = true; + } - if ($domain['ismainbutsubto'] == 0) { - $zoneContent = createDomainZone(($domain['id'] == 'none') ? - $domain : - $domain['id'], - $isFroxlorHostname); - if (count($subzones)) { - foreach ($subzones as $subzone) { - $zoneContent->records[] = $subzone; - } + if ($domain['ismainbutsubto'] == 0) { + $zoneContent = createDomainZone(($domain['id'] == 'none') ? + $domain : + $domain['id'], + $isFroxlorHostname); + if (count($subzones)) { + foreach ($subzones as $subzone) { + $zoneContent->records[] = $subzone; } - $pdnsDomId = $this->_insertZone($zoneContent->origin, $zoneContent->serial); - $this->_insertRecords($pdnsDomId, $zoneContent->records, $zoneContent->origin); - $this->_insertAllowedTransfers($pdnsDomId); - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'DB entries stored for zone `' . $domain['domain'] . '`'); - } else { - return createDomainZone(($domain['id'] == 'none') ? - $domain : - $domain['id'], - $isFroxlorHostname, - true); } + $pdnsDomId = $this->_insertZone($zoneContent->origin, $zoneContent->serial); + $this->_insertRecords($pdnsDomId, $zoneContent->records, $zoneContent->origin); + $this->_insertAllowedTransfers($pdnsDomId); + $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'DB entries stored for zone `' . $domain['domain'] . '`'); } else { - $this->_logger->logAction(CRON_ACTION, LOG_ERROR, - 'Zonefiles are NOT supported when PowerDNS is selected as DNS daemon (triggered by: ' . - $domain['domain'] . ')'); - $this->_bindconf_file .= $this->_generateDomainConfig($domain); + return createDomainZone(($domain['id'] == 'none') ? + $domain : + $domain['id'], + $isFroxlorHostname, + true); } }