mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Refactor
This commit is contained in:
parent
8c070b6743
commit
a23ac67b7f
4 changed files with 6 additions and 12 deletions
|
@ -63,7 +63,6 @@ For development configuration, add:
|
|||
```
|
||||
|
||||
Configuration on plain TCP EPP is as follows:
|
||||
Add:
|
||||
```apache
|
||||
<IfModule mod_epp.c>
|
||||
<Directory "/usr/lib/cgi-bin/epp">
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
class Epp::CommandsController < ApplicationController
|
||||
include Epp::Common
|
||||
include Epp::CommandsHelper
|
||||
include Epp::DomainsHelper
|
||||
|
||||
OBJECT_TYPES = {
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue