mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 07:52:04 +02:00
Merge branch 'master' into registry-790
This commit is contained in:
commit
65b40997ca
51 changed files with 556 additions and 303 deletions
|
@ -13,9 +13,9 @@ class Ability
|
|||
|
||||
case @user.class.to_s
|
||||
when 'AdminUser'
|
||||
@user.roles.each { |role| send(role) } if @user.roles
|
||||
@user.roles&.each { |role| send(role) }
|
||||
when 'ApiUser'
|
||||
@user.roles.each { |role| send(role) } if @user.roles
|
||||
@user.roles&.each { |role| send(role) }
|
||||
when 'RegistrantUser'
|
||||
static_registrant
|
||||
end
|
||||
|
|
|
@ -45,8 +45,10 @@ class Directo < ActiveRecord::Base
|
|||
end
|
||||
|
||||
data = builder.to_xml.gsub("\n",'')
|
||||
response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false).to_s
|
||||
dump_result_to_db(mappers, response)
|
||||
Rails.logger.info("[Directo] XML request: #{data}")
|
||||
response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false)
|
||||
Rails.logger.info("[Directo] Directo responded with code: #{response.code}, body: #{response.body}")
|
||||
dump_result_to_db(mappers, response.to_s)
|
||||
end
|
||||
|
||||
STDOUT << "#{Time.zone.now.utc} - Directo receipts sending finished. #{counter} of #{total} are sent\n"
|
||||
|
@ -165,11 +167,15 @@ class Directo < ActiveRecord::Base
|
|||
end
|
||||
|
||||
data = builder.to_xml.gsub("\n",'')
|
||||
Rails.logger.info("[Directo] XML request: #{data}")
|
||||
|
||||
if debug
|
||||
STDOUT << "#{Time.zone.now.utc} - Directo xml had to be sent #{data}\n"
|
||||
else
|
||||
response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false).to_s
|
||||
response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false)
|
||||
Rails.logger.info("[Directo] Directo responded with code: #{response.code}, body: #{response.body}")
|
||||
response = response.to_s
|
||||
|
||||
Setting.directo_monthly_number_last = directo_next
|
||||
Nokogiri::XML(response).css("Result").each do |res|
|
||||
Directo.create!(request: data, response: res.as_json.to_h, invoice_number: directo_next)
|
||||
|
@ -190,4 +196,3 @@ class Directo < ActiveRecord::Base
|
|||
@pricelists[account_activity.price_id] = account_activity.price
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ class Epp::Contact < Contact
|
|||
end
|
||||
|
||||
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
|
||||
self.legal_document_id = doc.id
|
||||
end
|
||||
|
||||
|
@ -238,7 +238,7 @@ class Epp::Contact < Contact
|
|||
)
|
||||
self.legal_documents = [doc]
|
||||
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
|
||||
self.legal_document_id = doc.id
|
||||
end
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ class Epp::Domain < Domain
|
|||
)
|
||||
self.legal_documents = [doc]
|
||||
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
|
||||
self.legal_document_id = doc.id
|
||||
end
|
||||
# rubocop: enable Metrics/PerceivedComplexity
|
||||
|
@ -472,7 +472,7 @@ class Epp::Domain < Domain
|
|||
at.deep_merge!(attrs_from(frame.css('rem'), current_user, 'rem'))
|
||||
|
||||
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
|
||||
self.legal_document_id = doc.id
|
||||
end
|
||||
|
||||
|
@ -547,7 +547,7 @@ class Epp::Domain < Domain
|
|||
check_discarded
|
||||
|
||||
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
|
||||
end
|
||||
|
||||
if Setting.request_confirmation_on_domain_deletion_enabled &&
|
||||
|
|
|
@ -6,7 +6,8 @@ class LegalDocument < ActiveRecord::Base
|
|||
if ENV['legal_document_types'].present?
|
||||
TYPES = ENV['legal_document_types'].split(',').map(&:strip)
|
||||
else
|
||||
TYPES = %w(pdf bdoc ddoc zip rar gz tar 7z odt doc docx).freeze
|
||||
TYPES = %w(pdf asice asics sce scs adoc edoc bdoc ddoc zip rar gz tar 7z odt
|
||||
doc docx).freeze
|
||||
end
|
||||
|
||||
attr_accessor :body
|
||||
|
|
|
@ -36,6 +36,7 @@ class WhoisRecord < ActiveRecord::Base
|
|||
registrant = domain.registrant
|
||||
|
||||
@disclosed = []
|
||||
h[:disclaimer] = disclaimer_text if disclaimer_text.present?
|
||||
h[:name] = domain.name
|
||||
h[:status] = domain.statuses.map { |x| status_map[x] || x }
|
||||
h[:registered] = domain.registered_at.try(:to_s, :iso8601)
|
||||
|
@ -120,4 +121,10 @@ class WhoisRecord < ActiveRecord::Base
|
|||
def destroy_whois_record
|
||||
Whois::Record.where(name: name).delete_all
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def disclaimer_text
|
||||
Setting.registry_whois_disclaimer
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue