diff --git a/interface/web/dns/dns_a_edit.php b/interface/web/dns/dns_a_edit.php index 5b060c33ab4060ffa60eb3d0a234a34523716da6..595ebcc92c4c0bfad88970f31f1b9be830be81fd 100644 --- a/interface/web/dns/dns_a_edit.php +++ b/interface/web/dns/dns_a_edit.php @@ -46,6 +46,7 @@ require_once './dns_edit_base.php'; class page_action extends dns_page_action { protected function checkDuplicate() { + global $app; //* Check for duplicates where IP and hostname are the same $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); if($tmp['number'] > 0) return true; diff --git a/interface/web/dns/dns_cname_edit.php b/interface/web/dns/dns_cname_edit.php index b04af40051ec28adf7d311450d4fe4319aecf809..403650c1c444481d54bb26edef94f60251a74bb2 100644 --- a/interface/web/dns/dns_cname_edit.php +++ b/interface/web/dns/dns_cname_edit.php @@ -46,6 +46,7 @@ require_once './dns_edit_base.php'; class page_action extends dns_page_action { protected function checkDuplicate() { + global $app; //* Check for duplicates where IP and hostname are the same $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = ? AND zone = ? and id != ?) OR (type = 'CNAME' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id); if($tmp['number'] > 0) return true;