From e33d7b756f953681cb652538a74072ac1f9ae597 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Tue, 10 May 2016 07:37:07 +0200 Subject: [PATCH] add missing error-language-string; check whether domain is bind-domain Signed-off-by: Michael Kaufmann (d00p) --- dns_editor.php | 10 +++++++--- lng/english.lng.php | 2 ++ templates/Sparkle/admin/domains/domains_edit.tpl | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dns_editor.php b/dns_editor.php index b56bb4f1..9fbddf2e 100644 --- a/dns_editor.php +++ b/dns_editor.php @@ -18,7 +18,7 @@ if (! defined('AREA')) */ // This file is being included in admin_domains and customer_domains - // and therefore does not need to require lib/init.php +// and therefore does not need to require lib/init.php $domain_id = isset($_GET['domain_id']) ? (int) $_GET['domain_id'] : null; @@ -29,10 +29,14 @@ $content = isset($_POST['record']['content']) ? trim($_POST['record']['content'] $ttl = isset($_POST['record']['ttl']) ? (int) $_POST['record']['ttl'] : 18000; // get domain-name -$dom_stmt = Database::prepare("SELECT domain FROM `" . TABLE_PANEL_DOMAINS . "` WHERE id = :did"); +$dom_stmt = Database::prepare("SELECT domain, isbinddomain FROM `" . TABLE_PANEL_DOMAINS . "` WHERE id = :did"); $domain = Database::pexecute_first($dom_stmt, array( 'did' => $domain_id )); + +if ($domain['isbinddomain'] != '0') { + standard_error('dns_domain_nodns'); +} $domain = $idna_convert->decode($domain['domain']); // select all entries @@ -67,7 +71,7 @@ if ($action == 'add_record' && ! empty($_POST)) { if ($type == 'A' && filter_var($content, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false) { $errors[] = $lng['error']['dns_arec_noipv4']; } elseif ($type == 'AAAA' && filter_var($content, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) { - $errors[] = $lng['errors']['dns_aaaarec_noipv6']; + $errors[] = $lng['error']['dns_aaaarec_noipv6']; } elseif ($type == 'MX') { if ($prio === null || $prio < 0) { $errors[] = $lng['error']['dns_mx_prioempty']; diff --git a/lng/english.lng.php b/lng/english.lng.php index 83e7b232..976c0ae7 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1990,8 +1990,10 @@ $lng['extras']['path_protection_label'] = 'Important {$title}  {$title} -  (edit DNS) + +  (edit DNS) +