From e8a29cf134f7df1a1e7637083f6d7adf64949b7c Mon Sep 17 00:00:00 2001
From: jmontoya <jmontoya@ispconfig3>
Date: Wed, 04 Aug 2010 12:57:28 -0400
Subject: [PATCH] Adding new functions to the Remoting class

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

diff --git a/interface/web/dns/dns_soa_edit.php b/interface/web/dns/dns_soa_edit.php
index a94cf01..646dae0 100644
--- a/interface/web/dns/dns_soa_edit.php
+++ b/interface/web/dns/dns_soa_edit.php
@@ -93,7 +93,8 @@
 			// Fill the client select field
 			$sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY name";
 			$clients = $app->db->queryAllRecords($sql);
-			$client_select = '<option value="'.$client['client_id'].'">'.$client['contact_name'].'</option>';
+			$tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']);
+			$client_select = '<option value="'.$tmp['groupid'].'">'.$client['contact_name'].'</option>';
 			$tmp_data_record = $app->tform->getDataRecord($this->id);
 			if(is_array($clients)) {
 				foreach( $clients as $client) {
@@ -153,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();
 	}
@@ -218,4 +224,4 @@
 $page = new page_action;
 $page->onLoad();
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1