Skip to content

Commit bf34076

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.1' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.1
2 parents 23af232 + db7208d commit bf34076

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

interface/web/dns/dns_wizard.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,22 @@
167167

168168
}
169169

170+
//* TODO: store dnssec-keys in the database - see below for non-admin-users
171+
//* hide dnssec if we found dns-mirror-servers
172+
$sql = "SELECT count(*) AS count FROM server WHERE mirror_server_id > 0 and dns_server = 1";
173+
$rec=$app->db->queryOneRecord($sql);
174+
170175
$template_record = $app->db->queryOneRecord("SELECT * FROM dns_template WHERE template_id = ?", $template_id);
171176
$fields = explode(',', $template_record['fields']);
172177
if(is_array($fields)) {
173178
foreach($fields as $field) {
174-
$app->tpl->setVar($field."_VISIBLE", 1);
175-
$field = strtolower($field);
176-
$app->tpl->setVar($field, $_POST[$field]);
179+
if($field == 'DNSSEC' && $rec['count'] > 0) {
180+
//hide dnssec
181+
} else {
182+
$app->tpl->setVar($field."_VISIBLE", 1);
183+
$field = strtolower($field);
184+
$app->tpl->setVar($field, $_POST[$field]);
185+
}
177186
}
178187
}
179188

interface/web/dns/form/dns_template.tform.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@
5050
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
5151
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
5252

53+
//* TODO: store dnssec-keys in the database - see below for non-admin-users
54+
//* hide dnssec if we found dns-mirror-servers
55+
$sql = "SELECT count(*) AS count FROM server WHERE mirror_server_id > 0 and dns_server = 1";
56+
$rec=$app->db->queryOneRecord($sql);
57+
if($rec['count'] > 0) {
58+
$field_values = array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM');
59+
} else {
60+
$field_values = array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM', 'DNSSEC' => 'DNSSEC');
61+
}
62+
5363
$form["tabs"]['template'] = array (
5464
'title' => "DNS Template",
5565
'width' => 100,
@@ -74,7 +84,7 @@
7484
'formtype' => 'CHECKBOXARRAY',
7585
'default' => '',
7686
'separator' => ',',
77-
'value' => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM', 'DNSSEC' => 'DNSSEC'),
87+
'value' => $field_values,
7888
'validators' => array ( 0 => array ('type' => 'CUSTOM',
7989
'class' => 'validate_dkim',
8090
'function' => 'check_template',

0 commit comments

Comments
 (0)