<?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';
$domain = new Domain((int) $_REQUEST['dom']);
$domain->ensure_userdomain();
DEBUG($domain);
title('DNS-Records für '.filter_input_general($domain->fqdn));
headline('DNS-Records für <em>'.filter_input_general($domain->fqdn).'</em>');
$records = get_domain_records($domain->id);
$auto_records = get_domain_auto_records($domain->fqdn);
output('<table><tr><th>Hostname</th><th>Typ</th><th>IP-Adresse/Inhalt</th><th>TTL</th><th> </th></tr>
');
foreach ($records AS $rec)
{
$data = ( $rec['ip'] ? $rec['ip'] : $rec['data'] );
if ($rec['dyndns'])
{
$dyndns = get_dyndns_account($rec['dyndns']);
$data = internal_link('dyndns_edit', '<em>DynDNS #'.$rec['dyndns'].' ('.$dyndns['handle'].')</em>', 'id='.$rec['dyndns']);
}
if ($rec['type'] == 'mx')
{
$data .= ' ('.$rec['spec'].')';