mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
Merge branch 'master' of github.com:domify/registry
This commit is contained in:
commit
39eb5b9864
6 changed files with 42 additions and 7 deletions
|
@ -100,6 +100,7 @@ class Epp::ContactsController < EppController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
contact_org_disabled
|
contact_org_disabled
|
||||||
|
fax_disabled
|
||||||
@prefix = nil
|
@prefix = nil
|
||||||
requires 'extension > extdata > ident'
|
requires 'extension > extdata > ident'
|
||||||
end
|
end
|
||||||
|
@ -113,6 +114,7 @@ class Epp::ContactsController < EppController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
contact_org_disabled
|
contact_org_disabled
|
||||||
|
fax_disabled
|
||||||
requires 'id', 'authInfo > pw'
|
requires 'id', 'authInfo > pw'
|
||||||
@prefix = nil
|
@prefix = nil
|
||||||
end
|
end
|
||||||
|
@ -131,4 +133,13 @@ class Epp::ContactsController < EppController
|
||||||
msg: "#{I18n.t(:contact_org_error)}: postalInfo > org [org]"
|
msg: "#{I18n.t(:contact_org_error)}: postalInfo > org [org]"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def fax_disabled
|
||||||
|
return true if ENV['fax_enabled'] == 'true'
|
||||||
|
return true if params[:parsed_frame].css('fax').text.blank?
|
||||||
|
epp_errors << {
|
||||||
|
code: '2306',
|
||||||
|
msg: "#{I18n.t(:contact_fax_error)}: fax [fax]"
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,12 +9,12 @@ module ApplicationHelper
|
||||||
"background-image: url(#{image_path(unstable_env.to_s + '.png')});"
|
"background-image: url(#{image_path(unstable_env.to_s + '.png')});"
|
||||||
end
|
end
|
||||||
|
|
||||||
def ident_indicator(contact)
|
def ident_for(contact)
|
||||||
case contact.ident_type
|
case contact.ident_type
|
||||||
when 'birthday'
|
when 'birthday'
|
||||||
"[#{contact.ident_type}]"
|
"#{contact.ident} [#{contact.ident_type}]"
|
||||||
else
|
else
|
||||||
"[#{contact.ident_country_code} #{contact.ident_type}]"
|
"#{contact.ident} [#{contact.ident_country_code} #{contact.ident_type}]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
.row
|
.row
|
||||||
.col-sm-12
|
.col-sm-12
|
||||||
%h2.text-center-xs= t('contacts')
|
%h2.text-center-xs= t(:contacts)
|
||||||
%hr
|
%hr
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
- @contacts.each do |contact|
|
- @contacts.each do |contact|
|
||||||
%tr
|
%tr
|
||||||
%td= link_to(contact, admin_contact_path(contact))
|
%td= link_to(contact, admin_contact_path(contact))
|
||||||
%td= "#{contact.ident} #{ident_indicator(contact)}"
|
%td= ident_for(contact)
|
||||||
%td= contact.email
|
%td= contact.email
|
||||||
%td= contact.code
|
%td= contact.code
|
||||||
%td
|
%td
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
.panel-body
|
.panel-body
|
||||||
%dl.dl-horizontal
|
%dl.dl-horizontal
|
||||||
%dt= t(:ident)
|
%dt= t(:ident)
|
||||||
%dd= "#{@contact.ident} #{ident_indicator(@contact)}"
|
%dd= ident_for(@contact)
|
||||||
|
|
||||||
%br
|
%br
|
||||||
|
|
||||||
|
|
|
@ -491,3 +491,4 @@ en:
|
||||||
revoke_this_certificate: 'Revoke this certificate'
|
revoke_this_certificate: 'Revoke this certificate'
|
||||||
crt_revoked: 'CRT (revoked)'
|
crt_revoked: 'CRT (revoked)'
|
||||||
contact_org_error: 'Parameter value policy error. Org should be blank'
|
contact_org_error: 'Parameter value policy error. Org should be blank'
|
||||||
|
contact_fax_error: 'Parameter value policy error. Fax should be blank'
|
||||||
|
|
|
@ -145,7 +145,7 @@ describe 'EPP Contact', epp: true do
|
||||||
Contact.last.code.should == 'registrar1:12345'
|
Contact.last.code.should == 'registrar1:12345'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should return parameter value policy errror' do
|
it 'should return parameter value policy error for org' do
|
||||||
response = create_request({ postalInfo: { org: { value: 'should not save' } } })
|
response = create_request({ postalInfo: { org: { value: 'should not save' } } })
|
||||||
response[:msg].should ==
|
response[:msg].should ==
|
||||||
'Parameter value policy error. Org should be blank: postalInfo > org [org]'
|
'Parameter value policy error. Org should be blank: postalInfo > org [org]'
|
||||||
|
@ -153,6 +153,15 @@ describe 'EPP Contact', epp: true do
|
||||||
|
|
||||||
Contact.last.org_name.should == nil
|
Contact.last.org_name.should == nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should return parameter value policy error for fax' do
|
||||||
|
response = create_request({ fax: { value: 'should not save' } })
|
||||||
|
response[:msg].should ==
|
||||||
|
'Parameter value policy error. Fax should be blank: fax [fax]'
|
||||||
|
response[:result_code].should == '2306'
|
||||||
|
|
||||||
|
Contact.last.fax.should == nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'update command' do
|
context 'update command' do
|
||||||
|
@ -289,6 +298,20 @@ describe 'EPP Contact', epp: true do
|
||||||
|
|
||||||
Contact.find_by(code: 'sh8013').org_name.should == nil
|
Contact.find_by(code: 'sh8013').org_name.should == nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should return parameter value policy errror for fax update' do
|
||||||
|
response = update_request({
|
||||||
|
id: { value: 'sh8013' },
|
||||||
|
chg: {
|
||||||
|
fax: { value: 'should not save' }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
response[:msg].should ==
|
||||||
|
'Parameter value policy error. Fax should be blank: fax [fax]'
|
||||||
|
response[:result_code].should == '2306'
|
||||||
|
|
||||||
|
Contact.find_by(code: 'sh8013').fax.should == nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'delete command' do
|
context 'delete command' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue