From 74829e1a721252733980d16ae69153e2ec6f6ec3 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 19 Jan 2010 10:11:32 -0500
Subject: [PATCH] Fixed: FS#838 - DNS serial is updated by viewing records. Changed: removed datalog update function in tform.inc.php and just left the stub function there for legacy support with a call to the new function in the db_mysql.inc.php.

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

diff --git a/interface/web/dns/dns_soa_edit.php b/interface/web/dns/dns_soa_edit.php
index defdb97..d2eb158 100644
--- a/interface/web/dns/dns_soa_edit.php
+++ b/interface/web/dns/dns_soa_edit.php
@@ -135,9 +135,11 @@
 			}
 		}
 		
+		/*
 		// Update the serial number of the SOA record
 		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ".$this->id);
 		$this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
+		*/
 		
 		
 		//* Check if soa, ns and mbox have a dot at the end
@@ -176,6 +178,13 @@
 	function onAfterUpdate() {
 		global $app, $conf;
 		
+		$tmp = $app->db->diffrec($this->oldDataRecord,$app->tform->getDataRecord($this->id));
+		if($tmp['diff_num'] > 0) {
+			// Update the serial number of the SOA record
+			$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ".$this->id);
+			$app->db->query("UPDATE dns_soa SET serial = '".$app->validate_dns->increase_serial($soa["serial"])."' WHERE id = ".$this->id);
+		}
+		
 		// make sure that the record belongs to the client group and not the admin group when a dmin inserts it
 		if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) {
 			$client_group_id = intval($this->dataRecord["client_group_id"]);

--
Gitblit v1.9.1