Added Analytics function to track user hits by ip address, referrer and user agent
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
|
||||
before_filter :authenticated, :has_info
|
||||
before_filter :authenticated, :has_info, :create_analytic
|
||||
helper_method :current_user, :is_admin?, :sanitize_font
|
||||
|
||||
# Our security guy keep talking about sea-surfing, cool story bro.
|
||||
@@ -45,6 +45,10 @@ class ApplicationController < ActionController::Base
|
||||
redirect_to home_dashboard_index_path if redirect
|
||||
end
|
||||
|
||||
def create_analytic
|
||||
Analytics.create({ :ip_address => request.remote_ip, :referrer => request.referrer, :user_agent => request.user_agent})
|
||||
end
|
||||
|
||||
def sanitize_font(css)
|
||||
css
|
||||
# css if css.match(/\A[0-9]+([\%]|pt)\z/)
|
||||
|
||||
Reference in New Issue
Block a user