<?php
require_once('inc/base.php');
require_once('inc/security.php');
require_once('class/domain.php');
require_role(ROLE_SYSTEMUSER);
require_once('dnsinclude.php');
$section = 'dns_dns';
$data = [];
$type = null;
$dyndns = false;
$dyndns_accounts = [];
foreach (get_dyndns_accounts() as $t) {
$dyndns_accounts[$t['id']] = $t['handle'];
}
if (isset($_REQUEST['type']) && $_REQUEST['type'] == "dyndns") {
$_REQUEST['type'] = 'a';
$dyndns = true;
}
if (isset($_REQUEST['type']) && $_REQUEST['type'] == "dyndns_aaaa") {
$_REQUEST['type'] = 'aaaa';
$dyndns = true;
}
$new = false;
if ($_REQUEST['id'] == 'new') {
$new = true;
$data = blank_dns_record($_REQUEST['type']);
$domain = new Domain((int) $_REQUEST['domain']);
$domain->ensure_userdomain();
$type = $_REQUEST['type'];