From 75cc840cbc3887d2734059c9b96550c7e67f3996 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Sun, 27 Jul 2014 10:28:13 -0400
Subject: [PATCH] Fixed: FS#3546 - bug in srv records in bind_dlz plugin.

---
 server/plugins-available/bind_dlz_plugin.inc.php |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/server/plugins-available/bind_dlz_plugin.inc.php b/server/plugins-available/bind_dlz_plugin.inc.php
index 21c0f86..63abcc4 100644
--- a/server/plugins-available/bind_dlz_plugin.inc.php
+++ b/server/plugins-available/bind_dlz_plugin.inc.php
@@ -252,6 +252,9 @@
 		if ($type == 'MX') {
 			$app->db->query("INSERT INTO named.records (zone, ttl, type, host, mx_priority, data, ispconfig_id)".
 				" VALUES ('$origin', $ttl, '$type', '$name', {$data["new"]["aux"]}, '$content', $ispconfig_id)");
+		} elseif ($type == 'SRV') {
+			$app->db->query("INSERT INTO named.records (zone, ttl, type, data, ispconfig_id)".
+				" VALUES ('$origin', $ttl, '$type', '{$data["new"]["aux"]} $content', $ispconfig_id)");
 		} else {
 			$app->db->query("INSERT INTO named.records (zone, ttl, type, host, data, ispconfig_id)".
 				" VALUES ('$origin', $ttl, '$type', '$name', '$content', $ispconfig_id)");
@@ -327,6 +330,9 @@
 				if ($type == 'MX') {
 					$app->db->query("UPDATE named.records SET zone = '$origin', ttl = $ttl, type = '$type', host = '$name', mx_priority = $prio, ".
 						"data = '$content' WHERE ispconfig_id = $ispconfig_id AND type != 'SOA'");
+				} elseif ($type == 'SRV') {
+					$app->db->query("UPDATE named.records SET zone = '$origin', ttl = $ttl, type = '$type', ".
+						"data = '$prio $content' WHERE ispconfig_id = $ispconfig_id AND type != 'SOA'");
 				} else {
 					$app->db->query("UPDATE named.records SET zone = '$origin', ttl = $ttl, type = '$type', host = '$name', ".
 						"data = '$content' WHERE ispconfig_id = $ispconfig_id AND type != 'SOA'");

--
Gitblit v1.9.1