mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 16:02:03 +02:00
Merge: new branch 104525314 from more recent master, merge changes
This commit is contained in:
commit
db3e849c8a
9 changed files with 167 additions and 18 deletions
|
@ -233,6 +233,11 @@ class Epp::Domain < Domain
|
|||
def admin_domain_contacts_attrs(frame, action)
|
||||
admin_attrs = domain_contact_attrs_from(frame, action, 'admin')
|
||||
|
||||
if action && !admin_attrs.empty? && admin_change_prohibited?
|
||||
add_epp_error('2304', 'admin', DomainStatus::SERVER_ADMIN_CHANGE_PROHIBITED, I18n.t(:object_status_prohibits_operation))
|
||||
return []
|
||||
end
|
||||
|
||||
case action
|
||||
when 'rem'
|
||||
return destroy_attrs(admin_attrs, admin_domain_contacts)
|
||||
|
@ -244,6 +249,11 @@ class Epp::Domain < Domain
|
|||
def tech_domain_contacts_attrs(frame, action)
|
||||
tech_attrs = domain_contact_attrs_from(frame, action, 'tech')
|
||||
|
||||
if action && !tech_attrs.empty? && tech_change_prohibited?
|
||||
add_epp_error('2304', 'tech', DomainStatus::SERVER_TECH_CHANGE_PROHIBITED, I18n.t(:object_status_prohibits_operation))
|
||||
return []
|
||||
end
|
||||
|
||||
case action
|
||||
when 'rem'
|
||||
return destroy_attrs(tech_attrs, tech_domain_contacts)
|
||||
|
@ -377,7 +387,6 @@ class Epp::Domain < Domain
|
|||
|
||||
def domain_statuses_attrs(frame, action)
|
||||
status_list = domain_status_list_from(frame)
|
||||
|
||||
if action == 'rem'
|
||||
to_destroy = []
|
||||
status_list.each do |x|
|
||||
|
@ -429,8 +438,19 @@ class Epp::Domain < Domain
|
|||
|
||||
at_add = attrs_from(frame.css('add'), current_user)
|
||||
at[:nameservers_attributes] += at_add[:nameservers_attributes]
|
||||
at[:admin_domain_contacts_attributes] += at_add[:admin_domain_contacts_attributes]
|
||||
at[:tech_domain_contacts_attributes] += at_add[:tech_domain_contacts_attributes]
|
||||
|
||||
if !at[:admin_domain_contacts_attributes].empty? && admin_change_prohibited?
|
||||
add_epp_error('2304', 'admin', DomainStatus::SERVER_ADMIN_CHANGE_PROHIBITED, I18n.t(:object_status_prohibits_operation))
|
||||
else
|
||||
at[:admin_domain_contacts_attributes] += at_add[:admin_domain_contacts_attributes]
|
||||
end
|
||||
|
||||
if !at[:tech_domain_contacts_attributes].empty? && tech_change_prohibited?
|
||||
add_epp_error('2304', 'tech', DomainStatus::SERVER_TECH_CHANGE_PROHIBITED, I18n.t(:object_status_prohibits_operation))
|
||||
else
|
||||
at[:tech_domain_contacts_attributes] += at_add[:tech_domain_contacts_attributes]
|
||||
end
|
||||
|
||||
at[:dnskeys_attributes] += at_add[:dnskeys_attributes]
|
||||
at[:statuses] =
|
||||
statuses - domain_statuses_attrs(frame.css('rem'), 'rem') + domain_statuses_attrs(frame.css('add'), 'add')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue