Commit 4816615b authored by Kristián Feldsam's avatar Kristián Feldsam

New service - fixed DKIM key generation

There is limitation - this script doens't respect dkim_strength setting in mail server config and instead use default 2048 value
Signed-off-by: Kristián Feldsam's avatarKristián Feldsam <feldsam@gmail.com>
parent 67a72dec
......@@ -91,7 +91,7 @@
<div class="form-group dkim">
<div class="col-sm-9 col-sm-push-3">
<a class="btn btn-default formbutton-default" href="javascript:setRequest('create')" value="{tmpl_var name='dkim_generate_txt'}">{tmpl_var name='dkim_generate_txt'}</a>
<a class="btn btn-default formbutton-default" id="dkim-button" value="{tmpl_var name='dkim_generate_txt'}">{tmpl_var name='dkim_generate_txt'}</a>
</div>
</div>
......@@ -226,6 +226,31 @@
$("#create_service").val("1");
ISPConfig.submitForm('pageForm','wizard/new_service.php');
});
$("#dkim-button").click(function() { getDKIM(); });
function getDKIM() {
var domain_id = jQuery('#domain').val();
var client_group_id = jQuery('#client_group_id').val();
var server_id = jQuery('#server_id').val();
var dkim_selector = jQuery('#dkim_selector').val();
var dkim_public = jQuery('#dkim_public').val();
jQuery.getJSON('mail/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {
domain_id : domain_id,
client_group_id : client_group_id,
server_id : server_id,
dkim_public : dkim_public,
dkim_selector : dkim_selector,
type : "create_dkim"
}, function(data) {
var dns=data['dkim_selector'] + '._domainkey.' + data['domain'] + '. 3600 TXT v=DKIM1; t=s; p=' + data['dns_record'];
$("#dkim_selector").val(data.dkim_selector);
$("#dkim_public").val(data.dkim_public);
$("#dkim_private").val(data.dkim_private);
$("#dns_record").val(dns);
});
};
jQuery('#dns_ip').ispconfigSearch({
dataSrc: '/dns/ajax_get_json.php?type=get_ipv4',
......@@ -255,4 +280,3 @@
resultBoxPosition: ''
});
</script>
<script language="JavaScript" type="text/javascript" src="js/mail_domain_dkim.js"></script>
\ No newline at end of file
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