Merge branch 'master' of github.com:internetee/registry

This commit is contained in:
Andres Keskküla 2014-11-07 15:11:18 +02:00
commit a0c9c303db
25 changed files with 440 additions and 174 deletions

View file

@ -80,7 +80,9 @@ module Epp::DomainsHelper
@domain = find_domain(secure: false)
handle_errors(@domain) and return unless @domain
handle_errors(@domain) and return unless @domain.transfer(domain_transfer_params)
@domain_transfer = @domain.transfer(domain_transfer_params)
handle_errors(@domain) and return unless @domain_transfer
render '/epp/domains/transfer'
end

View file

@ -0,0 +1,41 @@
module Epp::PollHelper
def poll
req_poll if parsed_frame.css('poll').first['op'] == 'req'
ack_poll if parsed_frame.css('poll').first['op'] == 'ack'
end
def req_poll
@message = current_epp_user.queued_messages.last
render 'epp/poll/poll_no_messages' and return unless @message
if @message.attached_obj_type && @message.attached_obj_id
@object = Object.const_get(@message.attached_obj_type).find(@message.attached_obj_id)
end
render 'epp/poll/poll_req'
end
def ack_poll
@message = current_epp_user.queued_messages.find_by(id: parsed_frame.css('poll').first['msgID'])
unless @message
epp_errors << {
code: '2303',
msg: I18n.t('message_was_not_found'),
value: { obj: 'msgID', val: parsed_frame.css('poll').first['msgID'] }
}
handle_errors and return
end
handle_errors(@message) and return unless @message.dequeue
render 'epp/poll/poll_ack'
end
private
def validate__poll_request
op = parsed_frame.css('poll').first[:op]
return true if %w(ack req).include?(op)
epp_errors << { code: '2306', msg: I18n.t('errors.messages.attribute_op_is_invalid') }
false
end
end