add missing error-language-string; check whether domain is bind-domain

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2016-05-10 07:37:07 +02:00
parent 283e272b99
commit e33d7b756f
3 changed files with 12 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ if (! defined('AREA'))
*/ */
// This file is being included in admin_domains and customer_domains // 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; $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; $ttl = isset($_POST['record']['ttl']) ? (int) $_POST['record']['ttl'] : 18000;
// get domain-name // 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( $domain = Database::pexecute_first($dom_stmt, array(
'did' => $domain_id 'did' => $domain_id
)); ));
if ($domain['isbinddomain'] != '0') {
standard_error('dns_domain_nodns');
}
$domain = $idna_convert->decode($domain['domain']); $domain = $idna_convert->decode($domain['domain']);
// select all entries // 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) { if ($type == 'A' && filter_var($content, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false) {
$errors[] = $lng['error']['dns_arec_noipv4']; $errors[] = $lng['error']['dns_arec_noipv4'];
} elseif ($type == 'AAAA' && filter_var($content, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) { } 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') { } elseif ($type == 'MX') {
if ($prio === null || $prio < 0) { if ($prio === null || $prio < 0) {
$errors[] = $lng['error']['dns_mx_prioempty']; $errors[] = $lng['error']['dns_mx_prioempty'];

View File

@@ -1990,8 +1990,10 @@ $lng['extras']['path_protection_label'] = '<strong class="red">Important</strong
$lng['extras']['path_protection_info'] = '<strong class="red">We strongly recommend protecting the given path, see "Extras" -> "Directory protection"</strong>'; $lng['extras']['path_protection_info'] = '<strong class="red">We strongly recommend protecting the given path, see "Extras" -> "Directory protection"</strong>';
$lng['tasks']['backup_customerfiles'] = 'Backup job for customer %loginname%'; $lng['tasks']['backup_customerfiles'] = 'Backup job for customer %loginname%';
$lng['error']['dns_domain_nodns'] = 'DNS is not enabled for this domain';
$lng['error']['dns_content_empty'] = 'No content given'; $lng['error']['dns_content_empty'] = 'No content given';
$lng['error']['dns_arec_noipv4'] = 'No valid IP address for A-record given'; $lng['error']['dns_arec_noipv4'] = 'No valid IP address for A-record given';
$lng['error']['dns_aaaarec_noipv6'] = 'No valid IP address for AAAA-record given';
$lng['error']['dns_mx_prioempty'] = 'Invalid MX priority given'; $lng['error']['dns_mx_prioempty'] = 'Invalid MX priority given';
$lng['error']['dns_mx_needdom'] = 'The MX content value must be a valid domain-name'; $lng['error']['dns_mx_needdom'] = 'The MX content value must be a valid domain-name';
$lng['error']['dns_mx_noalias'] = 'The MX-content value cannot be an CNAME entry.'; $lng['error']['dns_mx_noalias'] = 'The MX-content value cannot be an CNAME entry.';

View File

@@ -4,7 +4,9 @@ $header
<h2> <h2>
<img src="templates/{$theme}/assets/img/icons/domain_edit_big.png" alt="{$title}" />&nbsp; <img src="templates/{$theme}/assets/img/icons/domain_edit_big.png" alt="{$title}" />&nbsp;
{$title} {$title}
&nbsp;(<small><a href="{$linker->getLink(array('section' => 'domains', 'page' => 'domaindnseditor', 'domain_id' => $id))}">edit DNS</a></small>) <if $result['isbinddomain'] == '1'>
&nbsp;(<small><a href="{$linker->getLink(array('section' => 'domains', 'page' => 'domaindnseditor', 'domain_id' => $id))}">edit DNS</a></small>)
</if>
</h2> </h2>
</header> </header>