Commit db7208d3 authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'master' into 'stable-3.1'

Hide DNSSEC from Wizard if DNS-Mirrors are available (prevents broken DNSSEC-Imp…

…lementaion on Multiserver-Setups)

See merge request !401
parents 9a9242b4 9f3a0373
......@@ -167,13 +167,22 @@ if($_SESSION["s"]["user"]["typ"] != 'admin')
}
//* TODO: store dnssec-keys in the database - see below for non-admin-users
//* hide dnssec if we found dns-mirror-servers
$sql = "SELECT count(*) AS count FROM server WHERE mirror_server_id > 0 and dns_server = 1";
$rec=$app->db->queryOneRecord($sql);
$template_record = $app->db->queryOneRecord("SELECT * FROM dns_template WHERE template_id = ?", $template_id);
$fields = explode(',', $template_record['fields']);
if(is_array($fields)) {
foreach($fields as $field) {
$app->tpl->setVar($field."_VISIBLE", 1);
$field = strtolower($field);
$app->tpl->setVar($field, $_POST[$field]);
if($field == 'DNSSEC' && $rec['count'] > 0) {
//hide dnssec
} else {
$app->tpl->setVar($field."_VISIBLE", 1);
$field = strtolower($field);
$app->tpl->setVar($field, $_POST[$field]);
}
}
}
......
......@@ -50,6 +50,16 @@ $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update,
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
//* TODO: store dnssec-keys in the database - see below for non-admin-users
//* hide dnssec if we found dns-mirror-servers
$sql = "SELECT count(*) AS count FROM server WHERE mirror_server_id > 0 and dns_server = 1";
$rec=$app->db->queryOneRecord($sql);
if($rec['count'] > 0) {
$field_values = array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM');
} else {
$field_values = array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM', 'DNSSEC' => 'DNSSEC');
}
$form["tabs"]['template'] = array (
'title' => "DNS Template",
'width' => 100,
......@@ -74,7 +84,7 @@ $form["tabs"]['template'] = array (
'formtype' => 'CHECKBOXARRAY',
'default' => '',
'separator' => ',',
'value' => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM', 'DNSSEC' => 'DNSSEC'),
'value' => $field_values,
'validators' => array ( 0 => array ('type' => 'CUSTOM',
'class' => 'validate_dkim',
'function' => 'check_template',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment