Skip to content

Commit d73ce64

Browse files
author
Florian Schaal
committed
DKIM: simplify the dkim-entry in a template
1 parent f0720ef commit d73ce64

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

interface/web/dns/dns_wizard.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@
245245
if($_POST['ns2'] != '') $tpl_content = str_replace('{NS2}', $_POST['ns2'], $tpl_content);
246246
if($_POST['email'] != '') $tpl_content = str_replace('{EMAIL}', $_POST['email'], $tpl_content);
247247
if(isset($_POST['dkim']) && preg_match('/^[\w\.\-\/]{2,255}\.[a-zA-Z0-9\-]{2,30}[\.]{0,1}$/', $_POST['domain'])) {
248-
$public_key=$app->db->queryOneRecord("SELECT dkim_public FROM mail_domain WHERE domain = '".$app->db->quote($_POST['domain'])."' AND dkim = 'y' AND ".$app->tform->getAuthSQL('r'));
248+
$public_key=$app->db->queryOneRecord("SELECT dkim_public FROM mail_domain WHERE domain = ? AND dkim = 'y' AND ".$app->tform->getAuthSQL('r'), $_POST['domain']);
249249
if ($public_key!='') {
250250
$dns_record=str_replace(array("\r\n", "\n", "\r", "-----BEGIN PUBLIC KEY-----", "-----END PUBLIC KEY-----"), '', $public_key['dkim_public']);
251-
$tpl_content = str_replace('TXT|'.$_POST['domain'].'|{DKIM}', 'TXT|default._domainkey.'.$_POST['domain'].'.|v=DKIM1; t=s; p='.$dns_record, $tpl_content);
251+
$tpl_content .= "\n".'TXT|default._domainkey.'.$_POST['domain'].'.|v=DKIM1; t=s; p='.$dns_record;
252252
}
253253
}
254254

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
'formtype' => 'CHECKBOXARRAY',
7575
'default' => '',
7676
'separator' => ',',
77-
'value' => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM (use TXT|{DOMAIN}.|{DKIM} in your Template)'),
77+
'value' => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM'),
7878
'validators' => array ( 0 => array ('type' => 'CUSTOM',
7979
'class' => 'validate_dkim',
8080
'function' => 'check_template',

0 commit comments

Comments
 (0)