check whether the domain to clean from pdns actually still exists there; fixes #992

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2021-10-21 12:00:36 +02:00
parent bd8327afbe
commit bcde7e93df

View File

@@ -99,6 +99,7 @@ class PowerDNS extends DnsBase
)); ));
$pdns_domain = $pdns_domains_stmt->fetch(\PDO::FETCH_ASSOC); $pdns_domain = $pdns_domains_stmt->fetch(\PDO::FETCH_ASSOC);
if ($pdns_domain && ! empty($pdns_domain['id'])) {
$del_rec_stmt->execute(array( $del_rec_stmt->execute(array(
'did' => $pdns_domain['id'] 'did' => $pdns_domain['id']
)); ));
@@ -110,6 +111,7 @@ class PowerDNS extends DnsBase
)); ));
} }
} }
}
private function insertZone($domainname, $serial = 0) private function insertZone($domainname, $serial = 0)
{ {
@@ -122,7 +124,7 @@ class PowerDNS extends DnsBase
'type' => strtoupper(Settings::Get('system.powerdns_mode')) 'type' => strtoupper(Settings::Get('system.powerdns_mode'))
)); ));
$lastid = \Froxlor\Dns\PowerDNS::getDB()->lastInsertId(); $lastid = \Froxlor\Dns\PowerDNS::getDB()->lastInsertId();
return $lastid;; return $lastid;
} }
private function insertRecords($domainid = 0, $records = array(), $origin = "") private function insertRecords($domainid = 0, $records = array(), $origin = "")