This commit is contained in:
Martin Lensment 2015-09-15 12:11:12 +03:00
parent 27f37b9ec4
commit f7906800c4
4 changed files with 2 additions and 44 deletions

View file

@ -3,12 +3,10 @@ class Registrar::PollsController < Registrar::DeppController # EPP controller
before_action :init_epp_xml
def show
# authorize! :view, :registrar_dashboard
@data = depp_current_user.request(@ex.poll)
end
def destroy
# authorize! :delete, :registrar_poll
@data = depp_current_user.request(@ex.poll(poll: {
value: '', attrs: { op: 'ack', msgID: params[:id] }
}))
@ -35,7 +33,6 @@ class Registrar::PollsController < Registrar::DeppController # EPP controller
# end
def confirm_transfer
# authorize! :confirm, :transfer
domain_params = params[:domain]
@data = @domain.confirm_transfer(domain_params)

View file

@ -70,13 +70,6 @@ class Registrar::SessionsController < Devise::SessionsController
flash[:alert] = I18n.t(:ip_is_not_whitelisted)
redirect_to :back and return
end
# if @api_user.can?(:create, :epp_login)
# unless @api_user.registrar.api_ip_white?(request.ip)
# flash[:alert] = I18n.t(:ip_is_not_whitelisted)
# redirect_to :back and return
# end
# end
end
sign_in @api_user if @api_user.identity_code == current_user.identity_code

View file

@ -9,29 +9,20 @@ class RegistrarController < ApplicationController
false
end
# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Metrics/CyclomaticComplexity
def check_ip
return unless current_user
unless current_user.is_a? ApiUser
sign_out(current_user)
return
end
# return if Rails.env.development?
return if Rails.env.development?
registrar_ip_whitelisted = current_user.registrar.registrar_ip_white?(request.ip)
# api_ip_whitelisted = true
# if current_user.can?(:create, :epp_request)
# api_ip_whitelisted = current_user.registrar.api_ip_white?(request.ip)
# end
return if registrar_ip_whitelisted # && api_ip_whitelisted
return if registrar_ip_whitelisted
flash[:alert] = t('ip_is_not_whitelisted')
sign_out(current_user)
redirect_to registrar_login_path and return
end
# rubocop:enable Metrics/PerceivedComplexity
# rubocop:enable Metrics/CyclomaticComplexity
helper_method :head_title_sufix
def head_title_sufix