Adding support for PowerDNS-Replication (#974)

Adding support for powerdns-replication
This commit is contained in:
Nicolas
2021-08-19 12:00:09 +02:00
committed by GitHub
parent f1887aaaf2
commit 67351ec3c2
7 changed files with 39 additions and 11 deletions

View File

@@ -1,6 +1,8 @@
<?php
namespace Froxlor\Cron\Dns;
use Froxlor\Settings;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2016 the Froxlor Team (see authors).
@@ -13,7 +15,7 @@ namespace Froxlor\Cron\Dns;
* @author Froxlor team <team@froxlor.org> (2016-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron
*
*
*/
class PowerDNS extends DnsBase
{
@@ -111,15 +113,16 @@ class PowerDNS extends DnsBase
private function insertZone($domainname, $serial = 0)
{
$ins_stmt = \Froxlor\Dns\PowerDNS::getDB()->prepare("
INSERT INTO domains set `name` = :domainname, `notified_serial` = :serial, `type` = 'NATIVE'
$ins_stmt = \Froxlor\Dns\PowerDNS::getDB()->prepare("
INSERT INTO domains set `name` = :domainname, `notified_serial` = :serial, `type` = :type
");
$ins_stmt->execute(array(
'domainname' => $domainname,
'serial' => $serial
));
$lastid = \Froxlor\Dns\PowerDNS::getDB()->lastInsertId();
return $lastid;
$ins_stmt->execute(array(
'domainname' => $domainname,
'serial' => $serial,
'type' => strtoupper(Settings::Get('system.powerdns_mode'))
));
$lastid = \Froxlor\Dns\PowerDNS::getDB()->lastInsertId();
return $lastid;;
}
private function insertRecords($domainid = 0, $records = array(), $origin = "")

View File

@@ -10,7 +10,7 @@ final class Froxlor
const VERSION = '0.10.27';
// Database version (YYYYMMDDC where C is a daily counter)
const DBVERSION = '202107300';
const DBVERSION = '202108180';
// Distribution branding-tag (used for Debian etc.)
const BRANDING = '';