mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Merge branch 'master' of github.com:internetee/registry
This commit is contained in:
commit
c78e40a65a
8 changed files with 75 additions and 10 deletions
|
@ -8,7 +8,8 @@ module Epp::ContactsHelper
|
|||
code: ph[:id],
|
||||
phone: ph[:voice],
|
||||
ident: ph[:ident],
|
||||
email: ph[:email]
|
||||
email: ph[:email],
|
||||
org_name: ph[:postalInfo][:org]
|
||||
)
|
||||
end
|
||||
@contact.name = ph[:postalInfo][:name]
|
||||
|
@ -53,8 +54,17 @@ module Epp::ContactsHelper
|
|||
end
|
||||
|
||||
def info_contact
|
||||
epp_errors << { code: '2101', msg: 'Unimplemented command' }
|
||||
render 'epp/error'
|
||||
#TODO add data missing from contacts/info builder ( marked with 'if false' in said view )
|
||||
current_epp_user
|
||||
ph = params_hash['epp']['command']['info']['info']
|
||||
|
||||
@contact = Contact.where(code: ph[:id]).first
|
||||
if @contact
|
||||
render '/epp/contacts/info'
|
||||
else
|
||||
epp_errors << { code: '2303', msg: 'Object does not exist' }
|
||||
render 'epp/error'
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
33
app/views/epp/contacts/info.xml.builder
Normal file
33
app/views/epp/contacts/info.xml.builder
Normal file
|
@ -0,0 +1,33 @@
|
|||
xml.epp_head do
|
||||
xml.response do
|
||||
xml.result('code' => '1000') do
|
||||
xml.msg 'Command completed successfully'
|
||||
end
|
||||
|
||||
xml.resData do
|
||||
xml.tag!('contact:chkData', 'xmlns:contact' => 'http://www.nic.cz/xml/epp/contact-1.6',
|
||||
'xsi:schemaLocation' => 'http://www.nic.cz/xml/epp/contact-1.6 contact-1.6.xsd') do
|
||||
xml.tag!('contact:name', @contact.name)
|
||||
xml.tag!('contact:org', @contact.org_name)
|
||||
xml.tag!('contact:addr') do
|
||||
xml.tag!('contact:street', @contact.addresses.first.street)
|
||||
xml.tag!('contact:street', @contact.addresses.first.city)
|
||||
end
|
||||
xml.tag!('contact:voice', @contact.phone)
|
||||
xml.tag!('contact:fax', @contact.fax)
|
||||
xml.tag!('contact:email', @contact.email)
|
||||
xml.tag!('contact:clID', @current_epp_user.username) if @current_epp_user
|
||||
xml.tag!('contact:crID', '123') if false
|
||||
xml.tag!('contact:crDate', @contact.created_at)
|
||||
xml.tag!('contact:upID', '123') if false
|
||||
xml.tag!('contact:upDate', @contact.updated_at) unless @contact.updated_at == @contact.created_at
|
||||
xml.tag!('contact:trDate', '123') if false
|
||||
xml.tag!('contact:authInfo', '123') if false
|
||||
xml.tag!('contact:disclose', '123') if false
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
xml << render('/epp/shared/trID')
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue