No counter update when no current user #2348

This commit is contained in:
Priit Tark 2015-06-01 13:24:40 +03:00
parent 34c2e2d210
commit 2580d5efb0

View file

@ -1,4 +1,5 @@
class EppController < ApplicationController class EppController < ApplicationController
include Iptable
layout false layout false
protect_from_forgery with: :null_session protect_from_forgery with: :null_session
skip_before_action :verify_authenticity_token skip_before_action :verify_authenticity_token
@ -286,6 +287,7 @@ class EppController < ApplicationController
def iptables_counter_update def iptables_counter_update
return if ENV['iptables_counter_enabled'].blank? && ENV['iptables_counter_enabled'] != 'true' return if ENV['iptables_counter_enabled'].blank? && ENV['iptables_counter_enabled'] != 'true'
Iptable.counter_update(current_user.registrar_code, request.remote_ip) return if current_user.blank?
counter_update(current_user.registrar_code, request.remote_ip)
end end
end end