mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 02:39:37 +02:00
Allow other registrars to see that domain is registered already
This commit is contained in:
parent
8d24fe7b00
commit
4eed47fdf1
5 changed files with 11 additions and 10 deletions
|
@ -146,12 +146,18 @@ module Epp::DomainsHelper
|
||||||
|
|
||||||
## SHARED
|
## SHARED
|
||||||
def find_domain(secure = { secure: true })
|
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])
|
||||||
domain = Epp::EppDomain.find_by(name: @ph[:name]) if secure[:secure] == false
|
|
||||||
|
|
||||||
unless domain
|
unless domain
|
||||||
epp_errors << { code: '2303', msg: I18n.t('errors.messages.epp_domain_not_found'), value: { obj: 'name', val: @ph[:name] } }
|
epp_errors << { code: '2303', msg: I18n.t('errors.messages.epp_domain_not_found'), value: { obj: 'name', val: @ph[:name] } }
|
||||||
|
return nil
|
||||||
end
|
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
|
domain
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,8 +4,6 @@ class Contact < ActiveRecord::Base
|
||||||
|
|
||||||
include EppErrors
|
include EppErrors
|
||||||
|
|
||||||
EPP_ATTR_MAP = {}
|
|
||||||
|
|
||||||
has_one :local_address
|
has_one :local_address
|
||||||
has_one :international_address
|
has_one :international_address
|
||||||
has_one :disclosure, class_name: 'ContactDisclosure'
|
has_one :disclosure, class_name: 'ContactDisclosure'
|
||||||
|
|
|
@ -3,10 +3,6 @@ class DomainContact < ActiveRecord::Base
|
||||||
belongs_to :contact
|
belongs_to :contact
|
||||||
belongs_to :domain
|
belongs_to :domain
|
||||||
|
|
||||||
EPP_ATTR_MAP = {
|
|
||||||
hostname: 'hostObj'
|
|
||||||
}
|
|
||||||
|
|
||||||
def epp_code_map
|
def epp_code_map
|
||||||
{
|
{
|
||||||
'2302' => [
|
'2302' => [
|
||||||
|
|
|
@ -157,6 +157,7 @@ en:
|
||||||
repeating_postal_info: 'Only one of each postal info types may be provided'
|
repeating_postal_info: 'Only one of each postal info types may be provided'
|
||||||
invalid_type: 'PostalInfo type is invalid'
|
invalid_type: 'PostalInfo type is invalid'
|
||||||
unimplemented_command: 'Unimplemented command'
|
unimplemented_command: 'Unimplemented command'
|
||||||
|
domain_exists_but_belongs_to_other_registrar: 'Domain exists but belongs to other registrar'
|
||||||
|
|
||||||
setting_groups:
|
setting_groups:
|
||||||
codes:
|
codes:
|
||||||
|
|
|
@ -46,8 +46,8 @@ describe 'EPP Domain', epp: true do
|
||||||
|
|
||||||
it 'can not see other registrar domains' do
|
it 'can not see other registrar domains' do
|
||||||
response = epp_request(domain_info_xml, :xml, :elkdata)
|
response = epp_request(domain_info_xml, :xml, :elkdata)
|
||||||
expect(response[:result_code]).to eq('2303')
|
expect(response[:result_code]).to eq('2302')
|
||||||
expect(response[:msg]).to eq('Domain not found')
|
expect(response[:msg]).to eq('Domain exists but belongs to other registrar')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'transfers a domain' do
|
it 'transfers a domain' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue