Skip to content

Commit f20cff6

Browse files
author
Till Brehm
committed
Merge branch '3446-dns-err' into 'develop'
Resolve "creating two same alias DNS records result to .err bind zone config" Closes #3446 See merge request ispconfig/ispconfig3!1198
2 parents 5ca9a0c + f22c61b commit f20cff6

File tree

106 files changed

+182
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+182
-142
lines changed

interface/web/dns/dns_a_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class page_action extends dns_page_action {
4848
protected function checkDuplicate() {
4949
global $app;
5050
//* Check for duplicates where IP and hostname are the same
51-
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = ? AND zone = ? and data = ? and id != ?) OR (type = 'CNAME' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->dataRecord["data"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id);
51+
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = ? AND zone = ? and data = ? and id != ?) OR (type = 'CNAME' AND name = ? AND zone = ? and id != ?) OR (type = 'ALIAS' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->dataRecord["data"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id);
5252
if($tmp['number'] > 0) return true;
5353
return false;
5454
}

interface/web/dns/dns_aaaa_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class page_action extends dns_page_action {
4848
protected function checkDuplicate() {
4949
global $app;
5050
//* Check for duplicates where IP and hostname are the same
51-
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'AAAA' AND name = ? AND zone = ? and data = ? and id != ?) OR (type = 'CNAME' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->dataRecord["data"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id);
51+
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'AAAA' AND name = ? AND zone = ? and data = ? and id != ?) OR (type = 'CNAME' AND name = ? AND zone = ? and id != ?) OR (type = 'ALIAS' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->dataRecord["data"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id);
5252
if($tmp['number'] > 0) return true;
5353
return false;
5454
}

interface/web/dns/dns_alias_edit.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@
4444

4545
// Loading classes
4646
class page_action extends dns_page_action {
47-
47+
protected function checkDuplicate() {
48+
global $app;
49+
//* Check for duplicates where IP and hostname are the same
50+
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = ? AND zone = ? and id != ?) OR (type = 'AAAA' AND name = ? AND zone = ? and id != ?) OR (type = 'CNAME' AND name = ? AND zone = ? and id != ?) OR (type = 'DNAME' AND name = ? AND zone = ? and id != ?) OR (type = 'ALIAS' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id);
51+
if($tmp['number'] > 0) return true;
52+
return false;
53+
}
4854
}
4955

5056
$page = new page_action;

interface/web/dns/dns_cname_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class page_action extends dns_page_action {
4848
protected function checkDuplicate() {
4949
global $app;
5050
//* Check for duplicates where IP and hostname are the same
51-
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = ? AND zone = ? and id != ?) OR (type = 'AAAA' AND name = ? AND zone = ? and id != ?) OR (type = 'CNAME' AND name = ? AND zone = ? and id != ?) OR (type = 'DNAME' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id);
51+
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = ? AND zone = ? and id != ?) OR (type = 'AAAA' AND name = ? AND zone = ? and id != ?) OR (type = 'CNAME' AND name = ? AND zone = ? and id != ?) OR (type = 'DNAME' AND name = ? AND zone = ? and id != ?) OR (type = 'ALIAS' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id);
5252
if($tmp['number'] > 0) return true;
5353
return false;
5454
}

interface/web/dns/dns_dname_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class page_action extends dns_page_action {
4848
protected function checkDuplicate() {
4949
global $app;
5050
//* Check for duplicates where IP and hostname are the same
51-
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'CNAME' AND name = ? AND zone = ? and id != ?) OR (type = 'DNAME' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id);
51+
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'CNAME' AND name = ? AND zone = ? and id != ?) OR (type = 'DNAME' AND name = ? AND zone = ? and id != ?) OR (type = 'ALIAS' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id);
5252
if($tmp['number'] > 0) return true;
5353
return false;
5454
}

interface/web/dns/lib/lang/ar_dns_a.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ $wb['name_error_empty'] = 'The hostname is empty.';
1212
$wb['name_error_regex'] = 'The hostname has the wrong format.';
1313
$wb['data_error_empty'] = 'IP-Address empty';
1414
$wb['ip_error_wrong'] = 'IP-Address format invalid';
15-
$wb['data_error_duplicate'] = 'Duplicate A or CNAME record';
15+
$wb['data_error_duplicate'] = 'Duplicate A, ALIAS or CNAME record';
1616
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
1717
?>

interface/web/dns/lib/lang/ar_dns_aaaa.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DN
1111
$wb['name_error_empty'] = 'The hostname is empty.';
1212
$wb['name_error_regex'] = 'The hostname has the wrong format.';
1313
$wb['data_error_empty'] = 'IP-Address empty';
14-
$wb['data_error_duplicate'] = 'Duplicate AAAA or CNAME record';
14+
$wb['data_error_duplicate'] = 'Duplicate AAAA, ALIAS or CNAME record';
1515
$wb['ip_error_wrong'] = 'IP-Address format invalid';
1616
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
1717
?>

interface/web/dns/lib/lang/ar_dns_alias.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ $wb['name_error_empty'] = 'The hostname is empty.';
1212
$wb['name_error_regex'] = 'The hostname has the wrong format.';
1313
$wb['data_error_empty'] = 'Target hostname empty';
1414
$wb['data_error_regex'] = 'Target hostname format invalid';
15+
$wb['data_error_duplicate'] = 'Duplicate A, AAAA, ALIAS, CNAME, or DNAME record';
1516
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
1617
?>

interface/web/dns/lib/lang/ar_dns_cname.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ $wb['name_error_empty'] = 'The hostname is empty.';
1212
$wb['name_error_regex'] = 'The hostname has the wrong format.';
1313
$wb['data_error_empty'] = 'Target hostname empty';
1414
$wb['data_error_regex'] = 'Target hostname format invalid';
15-
$wb['data_error_duplicate'] = 'Duplicate A, AAAA, CNAME, or DNAME record';
15+
$wb['data_error_duplicate'] = 'Duplicate A, AAAA, ALIAS, CNAME, or DNAME record';
1616
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
1717
?>

interface/web/dns/lib/lang/bg_dns_a.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ $wb['name_error_empty'] = 'Полето за хост име е празно.';
1212
$wb['name_error_regex'] = 'Избраното име на хост е в грешен формат.';
1313
$wb['data_error_empty'] = 'Полето за IP адреса е празно';
1414
$wb['ip_error_wrong'] = 'Формата на IP адреса е грешен';
15-
$wb['data_error_duplicate'] = 'Duplicate A or CNAME record';
15+
$wb['data_error_duplicate'] = 'Duplicate A, ALIAS or CNAME record';
1616
$wb['ttl_range_error'] = 'Минималния TTL е 60 секунди.';
1717
?>

0 commit comments

Comments
 (0)