mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 20:55:44 +02:00
Check whether registrant element exists before determining registrant change
This commit is contained in:
parent
178d199020
commit
f25b7a3b7f
4 changed files with 11 additions and 6 deletions
|
@ -106,7 +106,6 @@ module Epp
|
||||||
updated = @domain.update(params[:parsed_frame], current_user)
|
updated = @domain.update(params[:parsed_frame], current_user)
|
||||||
(handle_errors(@domain) && return) unless updated
|
(handle_errors(@domain) && return) unless updated
|
||||||
|
|
||||||
Dispute.close_by_domain(@domain.name) if @domain.disputed?
|
|
||||||
pending = @domain.epp_pending_update.present?
|
pending = @domain.epp_pending_update.present?
|
||||||
render_epp_response "/epp/domains/success#{'_pending' if pending}"
|
render_epp_response "/epp/domains/success#{'_pending' if pending}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -100,14 +100,14 @@ class Registrar
|
||||||
authorize! :update, Depp::Domain
|
authorize! :update, Depp::Domain
|
||||||
@data = @domain.info(params[:domain_name])
|
@data = @domain.info(params[:domain_name])
|
||||||
@domain_params = Depp::Domain.construct_params_from_server_data(@data)
|
@domain_params = Depp::Domain.construct_params_from_server_data(@data)
|
||||||
@disputed = Dispute.active.find_by(domain_name: params[:domain_name]).present?
|
@dispute = Dispute.active.find_by(domain_name: params[:domain_name])
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
authorize! :update, Depp::Domain
|
authorize! :update, Depp::Domain
|
||||||
@domain_params = params[:domain]
|
@domain_params = params[:domain]
|
||||||
@data = @domain.update(@domain_params)
|
@data = @domain.update(@domain_params)
|
||||||
@disputed = Dispute.active.find_by(domain_name: @domain_params[:name]).present?
|
@dispute = Dispute.active.find_by(domain_name: @domain_params[:name])
|
||||||
|
|
||||||
if response_ok?
|
if response_ok?
|
||||||
redirect_to info_registrar_domains_url(domain_name: @domain_params[:name])
|
redirect_to info_registrar_domains_url(domain_name: @domain_params[:name])
|
||||||
|
|
|
@ -475,7 +475,11 @@ class Epp::Domain < Domain
|
||||||
self.up_date = Time.zone.now
|
self.up_date = Time.zone.now
|
||||||
end
|
end
|
||||||
|
|
||||||
same_registrant_as_current = (registrant.code == frame.css('registrant').text)
|
same_registrant_as_current = true
|
||||||
|
# registrant block may not be present, so we need this to rule out false positives
|
||||||
|
unless frame.css('registrant').text.blank?
|
||||||
|
same_registrant_as_current = (registrant.code == frame.css('registrant').text)
|
||||||
|
end
|
||||||
|
|
||||||
if !same_registrant_as_current && disputed?
|
if !same_registrant_as_current && disputed?
|
||||||
disputed_pw = frame.css('reserved > pw').text
|
disputed_pw = frame.css('reserved > pw').text
|
||||||
|
@ -484,7 +488,9 @@ class Epp::Domain < Domain
|
||||||
'pw element required for dispute domains')
|
'pw element required for dispute domains')
|
||||||
else
|
else
|
||||||
dispute = Dispute.active.find_by(domain_name: name, password: disputed_pw)
|
dispute = Dispute.active.find_by(domain_name: name, password: disputed_pw)
|
||||||
if dispute.nil?
|
if dispute
|
||||||
|
Dispute.close_by_domain(name)
|
||||||
|
else
|
||||||
add_epp_error('2202', nil, nil, 'Invalid authorization information; '\
|
add_epp_error('2202', nil, nil, 'Invalid authorization information; '\
|
||||||
'invalid reserved>pw value')
|
'invalid reserved>pw value')
|
||||||
end
|
end
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
.col-md-7
|
.col-md-7
|
||||||
= check_box_tag 'domain[verified]', '1', @domain_params[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
|
= check_box_tag 'domain[verified]', '1', @domain_params[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
|
||||||
|
|
||||||
- if !params[:domain_name] || @disputed
|
- if !params[:domain_name] || @dispute.present?
|
||||||
.form-group
|
.form-group
|
||||||
.col-md-3.control-label
|
.col-md-3.control-label
|
||||||
= label_tag :domain_reserved_pw, t(:reserved_pw)
|
= label_tag :domain_reserved_pw, t(:reserved_pw)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue