From f99b37f56dad8e3a1f844f8d3b33ee1ba4b86d62 Mon Sep 17 00:00:00 2001
From: latham <latham@ispconfig3>
Date: Wed, 25 May 2011 19:11:40 -0400
Subject: [PATCH] the altertable for the groups

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

diff --git a/interface/web/dns/dns_soa_edit.php b/interface/web/dns/dns_soa_edit.php
index 4c4d25a..e836025 100644
--- a/interface/web/dns/dns_soa_edit.php
+++ b/interface/web/dns/dns_soa_edit.php
@@ -50,6 +50,16 @@
 
 class page_action extends tform_actions {
 	
+	function onShow() {
+		global $app;
+		//* Reset the page number of the list form for the dns
+		//* records to 0 if we are on the first tab of the soa form.
+		if($app->tform->getNextTab() == 'dns_soa') {
+			$_SESSION['search']['dns_a']['page'] = 0;
+		}
+		parent::onShow();
+	}
+	
 	function onShowNew() {
 		global $app, $conf;
 		
@@ -154,7 +164,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 +234,4 @@
 $page = new page_action;
 $page->onLoad();
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1