keep compatibility and do not generate pdns records/zone when custom zonefile is set
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -61,32 +61,38 @@ class pdns extends DnsBase
|
|||||||
$subzones[] = $this->walkDomainList($domains[$child_domain_id], $domains);
|
$subzones[] = $this->walkDomainList($domains[$child_domain_id], $domains);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($domain['zonefile'] == '') {
|
||||||
// check for system-hostname
|
// check for system-hostname
|
||||||
$isFroxlorHostname = false;
|
$isFroxlorHostname = false;
|
||||||
if (isset($domain['froxlorhost']) && $domain['froxlorhost'] == 1) {
|
if (isset($domain['froxlorhost']) && $domain['froxlorhost'] == 1) {
|
||||||
$isFroxlorHostname = true;
|
$isFroxlorHostname = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($domain['ismainbutsubto'] == 0) {
|
if ($domain['ismainbutsubto'] == 0) {
|
||||||
$zoneContent = createDomainZone(($domain['id'] == 'none') ?
|
$zoneContent = createDomainZone(($domain['id'] == 'none') ?
|
||||||
$domain :
|
$domain :
|
||||||
$domain['id'],
|
$domain['id'],
|
||||||
$isFroxlorHostname);
|
$isFroxlorHostname);
|
||||||
if (count($subzones)) {
|
if (count($subzones)) {
|
||||||
foreach ($subzones as $subzone) {
|
foreach ($subzones as $subzone) {
|
||||||
$zoneContent->records[] = $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 {
|
} else {
|
||||||
return createDomainZone(($domain['id'] == 'none') ?
|
$this->_logger->logAction(CRON_ACTION, LOG_ERROR,
|
||||||
$domain :
|
'Custom zonefiles are NOT supported when PowerDNS is selected as DNS daemon (triggered by: ' .
|
||||||
$domain['id'],
|
$domain['domain'] . ')');
|
||||||
$isFroxlorHostname,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user