Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
lolo888
ISPConfig 3
Commits
957aaf31
Commit
957aaf31
authored
Sep 17, 2010
by
tbrehm
Browse files
Fixed: FS#1317 - Do not store Zone files in BIND plugin that do not have a ns record
parent
06ce83dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/plugins-available/bind_plugin.inc.php
View file @
957aaf31
...
...
@@ -252,7 +252,16 @@ class bind_plugin {
//* Only write the master file for the current server
$tmps
=
$app
->
db
->
queryAllRecords
(
"SELECT origin, xfer, also_notify FROM dns_soa WHERE active = 'Y' AND server_id="
.
$conf
[
"server_id"
]);
$zones
=
array
();
//* Check if the current zone that triggered this function has at least one NS record
$rec_num
=
$app
->
db
->
queryOneRecord
(
"SELECT count(id) as ns FROM dns_rr WHERE type = 'NS' AND zone = "
.
$data
[
'new'
][
'id'
]
.
" AND active = 'Y'"
);
if
(
$rec_num
[
'ns'
]
==
0
)
{
$exclude_zone
=
$data
[
'new'
][
'origin'
];
}
else
{
$exclude_zone
=
''
;
}
//* Loop trough zones
foreach
(
$tmps
as
$tmp
)
{
$options
=
''
;
...
...
@@ -263,10 +272,12 @@ class bind_plugin {
}
if
(
trim
(
$tmp
[
'also_notify'
])
!=
''
)
$options
.
=
' also-notify {'
.
str_replace
(
','
,
';'
,
$tmp
[
'also_notify'
])
.
";};
\n
"
;
$zones
[]
=
array
(
'zone'
=>
substr
(
$tmp
[
'origin'
],
0
,
-
1
),
'zonefile_path'
=>
$dns_config
[
'bind_zonefiles_dir'
]
.
'/pri.'
.
substr
(
$tmp
[
'origin'
],
0
,
-
1
),
'options'
=>
$options
);
if
(
$tmp
[
'origin'
]
!=
$exclude_zone
)
{
$zones
[]
=
array
(
'zone'
=>
substr
(
$tmp
[
'origin'
],
0
,
-
1
),
'zonefile_path'
=>
$dns_config
[
'bind_zonefiles_dir'
]
.
'/pri.'
.
substr
(
$tmp
[
'origin'
],
0
,
-
1
),
'options'
=>
$options
);
}
}
$tpl
=
new
tpl
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment