Allow other registrars to see that domain is registered already

This commit is contained in:
Martin Lensment 2014-09-18 11:30:31 +03:00
parent 8d24fe7b00
commit 4eed47fdf1
5 changed files with 11 additions and 10 deletions

View file

@ -146,12 +146,18 @@ module Epp::DomainsHelper
## SHARED
def find_domain(secure = { secure: true })
domain = Epp::EppDomain.find_by(name: @ph[:name], registrar: current_epp_user.registrar) if secure[:secure] == true
domain = Epp::EppDomain.find_by(name: @ph[:name]) if secure[:secure] == false
domain = Epp::EppDomain.find_by(name: @ph[:name])
unless domain
epp_errors << { code: '2303', msg: I18n.t('errors.messages.epp_domain_not_found'), value: { obj: 'name', val: @ph[:name] } }
return nil
end
if domain.registrar != current_epp_user.registrar && secure[:secure] == true
epp_errors << { code: '2302', msg: I18n.t('errors.messages.domain_exists_but_belongs_to_other_registrar'), value: { obj: 'name', val: @ph[:name] } }
return nil
end
domain
end
end

View file

@ -4,8 +4,6 @@ class Contact < ActiveRecord::Base
include EppErrors
EPP_ATTR_MAP = {}
has_one :local_address
has_one :international_address
has_one :disclosure, class_name: 'ContactDisclosure'

View file

@ -3,10 +3,6 @@ class DomainContact < ActiveRecord::Base
belongs_to :contact
belongs_to :domain
EPP_ATTR_MAP = {
hostname: 'hostObj'
}
def epp_code_map
{
'2302' => [