Skip to content
Snippets Groups Projects
Commit af4b6986 authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'master' into 'stable-3.1'

Hide DNSSEC from SOA if DNS-Mirrors are available (prevents broken DNSSEC-Implem…

…entaion on Multiserver-Setups)

See merge request !400
parents 1dc92d03 d17ae005
No related branches found
No related tags found
No related merge requests found
...@@ -85,6 +85,18 @@ class page_action extends tform_actions { ...@@ -85,6 +85,18 @@ class page_action extends tform_actions {
$app->uses('ini_parser,getconf'); $app->uses('ini_parser,getconf');
$settings = $app->getconf->get_global_config('domains'); $settings = $app->getconf->get_global_config('domains');
//* TODO: store dnssec-keys in the database - see below for non-admin-users
//* hide dnssec if we found dns-mirror-servers
if($this->id > 0) {
$sql = "SELECT count(*) AS count FROM server WHERE mirror_server_id = ?";
$rec=$app->db->queryOneRecord($sql, $this->dataRecord['server_id']);
} else {
$sql = "SELECT count(*) AS count FROM server WHERE mirror_server_id > 0 and dns_server = 1";
$rec=$app->db->queryOneRecord($sql);
}
$show_dnssec=@($rec['count'] > 0)?0:1;
$app->tpl->setVar('show_dnssec', $show_dnssec);
/* /*
* Now we have to check, if we should use the domain-module to select the domain * Now we have to check, if we should use the domain-module to select the domain
* or not * or not
...@@ -135,6 +147,20 @@ class page_action extends tform_actions { ...@@ -135,6 +147,20 @@ class page_action extends tform_actions {
$client_group_id = $_SESSION["s"]["user"]["default_group"]; $client_group_id = $_SESSION["s"]["user"]["default_group"];
$client_dns = $app->db->queryOneRecord("SELECT dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); $client_dns = $app->db->queryOneRecord("SELECT dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
//* TODO: store dnssec-keys in the database
//* hide dnssec if we found dns-mirror-servers
$temp_rec=explode(",", $client_dns['dns_servers']);
$sql = "SELECT count(*) AS count FROM server WHERE mirror_server_id = ?";
foreach($temp_rec as $temp) {
$rec=$app->db->queryOneRecord($sql, $temp);
if ($rec['count'] > 0) {
break;
}
}
$show_dnssec=@($rec['count'] > 0)?0:1;
$app->tpl->setVar('show_dnssec', $show_dnssec);
$client_dns['dns_servers_ids'] = explode(',', $client_dns['dns_servers']); $client_dns['dns_servers_ids'] = explode(',', $client_dns['dns_servers']);
$only_one_server = count($client_dns['dns_servers_ids']) === 1; $only_one_server = count($client_dns['dns_servers_ids']) === 1;
......
...@@ -125,6 +125,7 @@ ...@@ -125,6 +125,7 @@
</div> </div>
</div> </div>
<tmpl_if name="show_dnssec">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">{tmpl_var name='dnssec_wanted_txt'}</label> <label class="col-sm-3 control-label">{tmpl_var name='dnssec_wanted_txt'}</label>
<div class="col-sm-9"> <div class="col-sm-9">
...@@ -135,7 +136,8 @@ ...@@ -135,7 +136,8 @@
<label for="update_acl" class="col-sm-3 control-label">{tmpl_var name='dnssec_info_txt'}</label> <label for="update_acl" class="col-sm-3 control-label">{tmpl_var name='dnssec_info_txt'}</label>
<div class="col-sm-9"><textarea readonly="true" rows="5" id="dnssec_info" name="dnssec_info" class="form-control">{tmpl_var name='dnssec_info'}</textarea></div> <div class="col-sm-9"><textarea readonly="true" rows="5" id="dnssec_info" name="dnssec_info" class="form-control">{tmpl_var name='dnssec_info'}</textarea></div>
</div> </div>
</tmpl_if>
<input type="hidden" name="id" value="{tmpl_var name='id'}"> <input type="hidden" name="id" value="{tmpl_var name='id'}">
<input name="serial" type="hidden" value="{tmpl_var name='serial'}"> <input name="serial" type="hidden" value="{tmpl_var name='serial'}">
...@@ -170,4 +172,4 @@ ...@@ -170,4 +172,4 @@
searchFieldWatermark: '', searchFieldWatermark: '',
resultBoxPosition: '' resultBoxPosition: ''
}); });
</script> </script>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment