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

Merge branch 'dnssec-dnswizard' into 'stable-3.1'

Implemented a checkbox "enable DNSSEC" in DNS-Wizard

This Checkbox can be enabled or disabled by template.

Further I fixed an inconsistent design (HTML) which was introduced by @tbrehm yesterday I tink. (DKIM-Checkbox)

As everytime I only edited german and english language

See merge request !309
parents 6a85386a 28cd07d1
......@@ -25,7 +25,7 @@ ALTER TABLE `client_template`
ALTER TABLE `client` ADD `contact_firstname` VARCHAR( 64 ) NOT NULL DEFAULT '' AFTER `gender`;
UPDATE `dns_template` SET `fields` = 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM' WHERE `dns_template`.`template_id` =1;
UPDATE `dns_template` SET `fields` = 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM,DNSSEC' WHERE `dns_template`.`template_id` =1;
UPDATE `dns_template` SET `template` = '[ZONE]
origin={DOMAIN}.
ns={NS1}.
......
......@@ -2397,7 +2397,7 @@ INSERT INTO `country` (`iso`, `name`, `printable_name`, `iso3`, `numcode`, `eu`)
-- Dumping data for table `dns_template`
--
INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=3600\nttl=3600\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y');
INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM,DNSSEC', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=3600\nttl=3600\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y');
-- --------------------------------------------------------
......
......@@ -300,6 +300,7 @@ if($_POST['create'] == 1) {
if($_POST['ns1'] != '') $tpl_content = str_replace('{NS1}', $_POST['ns1'], $tpl_content);
if($_POST['ns2'] != '') $tpl_content = str_replace('{NS2}', $_POST['ns2'], $tpl_content);
if($_POST['email'] != '') $tpl_content = str_replace('{EMAIL}', $_POST['email'], $tpl_content);
$enable_dnssec = (($_POST['dnssec'] == 'Y') ? 'Y' : 'N');
if(isset($_POST['dkim']) && preg_match('/^[\w\.\-\/]{2,255}\.[a-zA-Z0-9\-]{2,30}[\.]{0,1}$/', $_POST['domain'])) {
$sql = $app->db->queryOneRecord("SELECT dkim_public, dkim_selector FROM mail_domain WHERE domain = ? AND dkim = 'y' AND ".$app->tform->getAuthSQL('r'), $_POST['domain']);
$public_key = $sql['dkim_public'];
......@@ -395,7 +396,8 @@ if($_POST['create'] == 1) {
"active" => 'Y',
"xfer" => $xfer,
"also_notify" => $also_notify,
"update_acl" => $update_acl
"update_acl" => $update_acl,
"dnssec_wanted" => $enable_dnssec
);
$dns_soa_id = $app->db->datalogInsert('dns_soa', $insert_data, 'id');
......
......@@ -74,7 +74,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'),
'value' => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM', 'DNSSEC' => 'DNSSEC'),
'validators' => array ( 0 => array ('type' => 'CUSTOM',
'class' => 'validate_dkim',
'function' => 'check_template',
......
......@@ -89,10 +89,16 @@
<div class="col-sm-9"><input type="text" name="email" id="email" value="{tmpl_var name='email'}" class="form-control" /></div></div>
</tmpl_if>
<tmpl_if name="DKIM_VISIBLE">
<label for="dkim" class="col-sm-3 control-label">{tmpl_var name='dkim_txt'}</label>
&nbsp;&nbsp;<input type="checkbox" disabled readonly checked><input name="dkim" type="hidden" maxlength="255" type="text"/>
<div class="form-group">
<label for="dkim" class="col-sm-3 control-label">{tmpl_var name='dkim_txt'}</label>
<div class="col-sm-9"><input type="checkbox" disabled readonly checked><input name="dkim" type="hidden" maxlength="255" type="text"/></div></div>
</tmpl_if>
<tmpl_if name="DNSSEC_VISIBLE">
<div class="form-group">
<label for="dkim" class="col-sm-3 control-label">{tmpl_var name='dnssec_txt'}</label>
<div class="col-sm-9"><input type="checkbox" name="dnssec" value="Y"></div></div>
</tmpl_if>
<input type="hidden" name="create" value="0" />
......
Markdown is supported
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