Story #107192666 - only show dsData if allowed, or keyData if allowed

This commit is contained in:
Matt Farnsworth 2015-11-13 15:01:18 +02:00
parent 0c21f9b304
commit 714b8364cb

View file

@ -81,18 +81,17 @@ xml.epp_head do
end
xml.tag!('secDNS:infData', 'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1') do
# might not have ds in first key? maybe check any? k.ds_digest if requirements change (DS not accepted by EIS)
if @domain.dnskeys[0].ds_digest.blank?
@domain.dnskeys.sort.each do |key|
tag_key_data(xml, key)
end
else
@domain.dnskeys.sort.each do |key|
if Setting.ds_data_allowed
(@domain.dnskeys.find_all { |key| key.ds_digest.present? }).sort.each do |key|
tag_ds_data(xml, key)
end
else
(@domain.dnskeys.find_all { |key| key.ds_digest.blank? }).sort.each do |key|
tag_key_data(xml, key)
end
end
end if @domain.dnskeys.any?
end
end if @domain.dnskeys.any? && (Setting.ds_data_allowed ? @domain.dnskeys.any? { |key| key.ds_digest.present? } : Setting.key_data_allowed)
render('epp/shared/trID', builder: xml)
end