remove domain from pdns database if removed or updated so nameserver is disabled (remove) or update of db triggered when isemaildomain option is disabled, fixes #581

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-11-17 20:14:58 +01:00
parent e184201327
commit 13c624400e
6 changed files with 229 additions and 149 deletions

View File

@@ -1038,9 +1038,13 @@ class Domains extends ApiCommand implements ResourceEntity
$speciallogfile = $result['speciallogfile'];
}
if ($isbinddomain != $result['isbinddomain'] || $zonefile != $result['zonefile'] || $dkim != $result['dkim']) {
if ($isbinddomain != $result['isbinddomain'] || $zonefile != $result['zonefile'] || $dkim != $result['dkim'] || $isemaildomain != $result['isemaildomain']) {
inserttask('4');
}
// check whether nameserver has been disabled, #581
if ($isbinddomain != $result['isbinddomain'] && $isbinddomain == 0) {
inserttask('11', $result['domain']);
}
if ($isemaildomain == '0' && $result['isemaildomain'] == '1') {
$del_stmt = Database::prepare("
@@ -1499,6 +1503,9 @@ class Domains extends ApiCommand implements ResourceEntity
triggerLetsEncryptCSRForAliasDestinationDomain($result['aliasdomain'], $this->logger());
// remove domains DNS from powerDNS if used, #581
inserttask('11', $result['domain']);
$this->logger()->logAction(ADM_ACTION, LOG_INFO, "[API] deleted domain/subdomains (#" . $result['id'] . ")");
updateCounters();
inserttask('1');