correctly use system-setting of default-ttl, thx to K1rk

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2019-01-17 09:26:04 +01:00
parent de33ec509b
commit 8b96912ab4
3 changed files with 8 additions and 6 deletions

View File

@@ -32,13 +32,13 @@ class DnsEntry
public $content; public $content;
public function __construct($record = '', $type = 'A', $content = null, $prio = 0, $ttl = 18000, $class = 'IN') public function __construct($record = '', $type = 'A', $content = null, $prio = 0, $ttl = 0, $class = 'IN')
{ {
$this->record = $record; $this->record = $record;
$this->type = $type; $this->type = $type;
$this->content = $content; $this->content = $content;
$this->priority = $prio; $this->priority = $prio;
$this->ttl = $ttl; $this->ttl = ($ttl <= 0 ? Settings::Get('system.defaultttl') : $ttl);
$this->class = $class; $this->class = $class;
} }

View File

@@ -1,6 +1,8 @@
<?php <?php
namespace Froxlor\Dns; namespace Froxlor\Dns;
use Froxlor\Settings;
/** /**
* This file is part of the Froxlor project. * This file is part of the Froxlor project.
* Copyright (c) 2016 the Froxlor Team (see authors). * Copyright (c) 2016 the Froxlor Team (see authors).
@@ -26,9 +28,9 @@ class DnsZone
public $records; public $records;
public function __construct($ttl = 18000, $origin = '', $serial = '', $records = null) public function __construct($ttl = 0, $origin = '', $serial = '', $records = null)
{ {
$this->ttl = $ttl; $this->ttl = ($ttl <= 0 ? Settings::Get('system.defaultttl') : $ttl);
$this->origin = $origin; $this->origin = $origin;
$this->serial = $serial; $this->serial = $serial;
$this->records = $records; $this->records = $records;