diff --git a/README.md b/README.md index 46a01a533..cba8d6b34 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,6 @@ For development configuration, add: ``` Configuration on plain TCP EPP is as follows: -Add: ```apache diff --git a/app/controllers/epp/commands_controller.rb b/app/controllers/epp/commands_controller.rb index 8b121fe68..1d3152cdd 100644 --- a/app/controllers/epp/commands_controller.rb +++ b/app/controllers/epp/commands_controller.rb @@ -1,6 +1,5 @@ class Epp::CommandsController < ApplicationController include Epp::Common - include Epp::CommandsHelper include Epp::DomainsHelper OBJECT_TYPES = { diff --git a/app/helpers/epp/commands_helper.rb b/app/helpers/epp/commands_helper.rb deleted file mode 100644 index eab4e1e09..000000000 --- a/app/helpers/epp/commands_helper.rb +++ /dev/null @@ -1,6 +0,0 @@ -module Epp::CommandsHelper - def command_params_for type - node_set = parsed_frame.css("epp command #{type} #{type}").children.select(&:element?) - node_set.inject({}) {|hash, obj| hash[obj.name.to_sym] = obj.text;hash } - end -end diff --git a/app/helpers/epp/domains_helper.rb b/app/helpers/epp/domains_helper.rb index 00f1bbf19..350ef6cce 100644 --- a/app/helpers/epp/domains_helper.rb +++ b/app/helpers/epp/domains_helper.rb @@ -12,14 +12,16 @@ module Epp::DomainsHelper ### HELPER METHODS ### def domain_create_params - cp = command_params_for('create') + node_set = parsed_frame.css("epp command create create").children.select(&:element?) + command_params = node_set.inject({}) {|hash, obj| hash[obj.name.to_sym] = obj.text;hash } + { - name: cp[:name], + name: command_params[:name], registrar_id: current_epp_user.registrar.try(:id), registered_at: Time.now, valid_from: Date.today, - valid_to: Date.today + cp[:period].to_i.years, - auth_info: cp[:authInfo] + valid_to: Date.today + command_params[:period].to_i.years, + auth_info: command_params[:authInfo] } end