mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 11:38:30 +02:00
Add basic contact creation request to EPP
This commit is contained in:
parent
d0251de28f
commit
2187be6364
6 changed files with 100 additions and 1 deletions
|
@ -14,6 +14,22 @@ module Epp::Common
|
|||
Nokogiri::XML(params[:frame]).remove_namespaces!
|
||||
end
|
||||
|
||||
def get_params_hash(path)
|
||||
node_set = parsed_frame.css(path).children.select{ |x| x.element? && x.element_children.empty? }
|
||||
|
||||
node_set.inject({}) do |hash, obj|
|
||||
#convert to array if 1 or more attributes with same name
|
||||
if hash[obj.name.to_sym] && !hash[obj.name.to_sym].is_a?(Array)
|
||||
hash[obj.name.to_sym] = [hash[obj.name.to_sym]]
|
||||
hash[obj.name.to_sym] << obj.text.strip
|
||||
else
|
||||
hash[obj.name.to_sym] = obj.text.strip
|
||||
end
|
||||
|
||||
hash
|
||||
end
|
||||
end
|
||||
|
||||
def epp_session
|
||||
EppSession.find_or_initialize_by(session_id: cookies['session'])
|
||||
end
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
class Epp::CommandsController < ApplicationController
|
||||
include Epp::Common
|
||||
include Epp::DomainsHelper
|
||||
include Epp::ContactsHelper
|
||||
|
||||
OBJECT_TYPES = {
|
||||
'http://www.nic.cz/xml/epp/domain-1.4 domain-1.4.xsd' => 'domain'
|
||||
'http://www.nic.cz/xml/epp/domain-1.4 domain-1.4.xsd' => 'domain',
|
||||
'http://www.nic.cz/xml/epp/contact-1.6 contact-1.6.xsd' => 'contact'
|
||||
}
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue