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

@@ -1669,7 +1669,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
* @param string $extra
* optional, default empty
* @param int $increase_by
* optional, default 1
* optional, default 1
*/
public static function increaseUsage($customerid = 0, $resource = null, $extra = '', $increase_by = 1)
{
@@ -1684,7 +1684,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
* @param string $extra
* optional, default empty
* @param int $decrease_by
* optional, default 1
* optional, default 1
*/
public static function decreaseUsage($customerid = 0, $resource = null, $extra = '', $decrease_by = 1)
{

View File

@@ -32,13 +32,13 @@ class DnsEntry
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->type = $type;
$this->content = $content;
$this->priority = $prio;
$this->ttl = $ttl;
$this->ttl = ($ttl <= 0 ? Settings::Get('system.defaultttl') : $ttl);
$this->class = $class;
}

View File

@@ -1,6 +1,8 @@
<?php
namespace Froxlor\Dns;
use Froxlor\Settings;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2016 the Froxlor Team (see authors).
@@ -26,9 +28,9 @@ class DnsZone
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->serial = $serial;
$this->records = $records;