Skip to content

Commit 75cc840

Browse files
author
Till Brehm
committed
Fixed: FS#3546 - bug in srv records in bind_dlz plugin.
1 parent 0df5269 commit 75cc840

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server/plugins-available/bind_dlz_plugin.inc.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ function rr_insert($event_name, $data)
252252
if ($type == 'MX') {
253253
$app->db->query("INSERT INTO named.records (zone, ttl, type, host, mx_priority, data, ispconfig_id)".
254254
" VALUES ('$origin', $ttl, '$type', '$name', {$data["new"]["aux"]}, '$content', $ispconfig_id)");
255+
} elseif ($type == 'SRV') {
256+
$app->db->query("INSERT INTO named.records (zone, ttl, type, data, ispconfig_id)".
257+
" VALUES ('$origin', $ttl, '$type', '{$data["new"]["aux"]} $content', $ispconfig_id)");
255258
} else {
256259
$app->db->query("INSERT INTO named.records (zone, ttl, type, host, data, ispconfig_id)".
257260
" VALUES ('$origin', $ttl, '$type', '$name', '$content', $ispconfig_id)");
@@ -327,6 +330,9 @@ function rr_update($event_name, $data)
327330
if ($type == 'MX') {
328331
$app->db->query("UPDATE named.records SET zone = '$origin', ttl = $ttl, type = '$type', host = '$name', mx_priority = $prio, ".
329332
"data = '$content' WHERE ispconfig_id = $ispconfig_id AND type != 'SOA'");
333+
} elseif ($type == 'SRV') {
334+
$app->db->query("UPDATE named.records SET zone = '$origin', ttl = $ttl, type = '$type', ".
335+
"data = '$prio $content' WHERE ispconfig_id = $ispconfig_id AND type != 'SOA'");
330336
} else {
331337
$app->db->query("UPDATE named.records SET zone = '$origin', ttl = $ttl, type = '$type', host = '$name', ".
332338
"data = '$content' WHERE ispconfig_id = $ispconfig_id AND type != 'SOA'");

0 commit comments

Comments
 (0)