Skip to content
Snippets Groups Projects
Commit 5c950fbb authored by Florian Schaal's avatar Florian Schaal
Browse files

add missing global $app

parent 223c561a
No related branches found
No related tags found
No related merge requests found
...@@ -46,6 +46,7 @@ require_once './dns_edit_base.php'; ...@@ -46,6 +46,7 @@ require_once './dns_edit_base.php';
class page_action extends dns_page_action { class page_action extends dns_page_action {
protected function checkDuplicate() { protected function checkDuplicate() {
global $app;
//* Check for duplicates where IP and hostname are the same //* 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); $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; if($tmp['number'] > 0) return true;
......
...@@ -46,6 +46,7 @@ require_once './dns_edit_base.php'; ...@@ -46,6 +46,7 @@ require_once './dns_edit_base.php';
class page_action extends dns_page_action { class page_action extends dns_page_action {
protected function checkDuplicate() { protected function checkDuplicate() {
global $app;
//* Check for duplicates where IP and hostname are the same //* 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); $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; if($tmp['number'] > 0) return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment