From a59731a3cc9c0fc6fba481e83d56ebd22ed3c87d Mon Sep 17 00:00:00 2001
From: dcy <dcy@ispconfig3>
Date: Sat, 17 Jul 2010 10:34:07 -0400
Subject: [PATCH] Secondary DNS functionality for PowerDNS and Bind

---
 interface/web/dns/dns_soa_edit.php |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/interface/web/dns/dns_soa_edit.php b/interface/web/dns/dns_soa_edit.php
index 4c4d25a..646dae0 100644
--- a/interface/web/dns/dns_soa_edit.php
+++ b/interface/web/dns/dns_soa_edit.php
@@ -154,7 +154,12 @@
 		if(stristr($this->dataRecord["mbox"],'@')) {
 			$this->dataRecord["mbox"] = str_replace('@','.',$this->dataRecord["mbox"]);
 		}
-		
+
+		//* Check if a secondary zone with the same name already exists 	
+		$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_slave WHERE origin = \"".$this->dataRecord["origin"]."\" AND server_id = \"".$this->dataRecord["server_id"]."\"");
+		if($tmp["number"] > 0) {
+  			$app->error($app->tform->wordbook["origin_error_unique"]);
+		}		
 
 		parent::onSubmit();
 	}
@@ -219,4 +224,4 @@
 $page = new page_action;
 $page->onLoad();
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1