From cc65688b3da3e16729a1f73dd50fd975bd1ff741 Mon Sep 17 00:00:00 2001
From: hellkat <hellkat@ispconfig3>
Date: Tue, 26 Mar 2013 00:43:51 -0400
Subject: [PATCH]     Merged revisions 3845-3876 and 3879-3918 from stable branch.

---
 interface/web/dns/dns_mx_edit.php |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/interface/web/dns/dns_mx_edit.php b/interface/web/dns/dns_mx_edit.php
index d78ae72..73483f7 100644
--- a/interface/web/dns/dns_mx_edit.php
+++ b/interface/web/dns/dns_mx_edit.php
@@ -108,6 +108,17 @@
 		parent::onSubmit();
 	}
 	
+	function onInsert() {
+		global $app, $conf;
+		
+		// Check if record is existing already
+		$duplicate_mx = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ".$app->functions->intval($this->dataRecord["zone"])." AND name = '".$this->dataRecord["name"]."' AND type = '".$this->dataRecord["type"]."' AND data = '".$this->dataRecord["data"]."' AND ".$app->tform->getAuthSQL('r'));
+		
+		if(is_array($duplicate_mx) && !empty($duplicate_mx)) $app->error($app->tform->wordbook["duplicate_mx_record_txt"]);
+		
+		parent::onInsert();
+	}
+	
 	function onAfterInsert() {
 		global $app, $conf;
 		

--
Gitblit v1.9.1