Sha256: e7348e4fae1be9338d7fab486a33e1967d93e5d51a519c181c3c97814416071f

Contents?: true

Size: 932 Bytes

Versions: 96

Compression:

Stored size: 932 Bytes

Contents

module Phcmemberspro
	class ApplicationController < ActionController::Base

		# Filter and Security
		before_filter :require_user
		protect_from_forgery with: :exception

		# AuthRocket User Helpers
		def require_user
			unless current_user
				session[:last_url] = request.get? ? url_for(params) : url_for
				redirect_to new_login_url
			end
		end
	
		def current_user
			@_current_user ||= AuthRocket::Session.from_token(session[:ar_token]).try(:user)
		end
		helper_method :current_user
	
		def new_login_url
		ENV['AUTHROCKET_LOGIN_URL']
			# $ar_login_url
		end
		helper_method :new_login_url

		# Add Helpers
		helper Phcnotifi::Engine.helpers
		helper Phctitleseo::Engine.helpers

		# Resolve Layouts for Gem
		def phcmemberspro_membersmain_layouts_resolver
			case action_name
			when "show"
				"layouts/phcmemberspro/members/members_profile"
			else
				"layouts/phcmemberspro/members/members_all"
			end
		end

	end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
phcmemberspro-8.6.3 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.6.2 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.6.1 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.6.0 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.5.9 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.5.8 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.5.7 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.5.6 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.5.5 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.5.4 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.5.3 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.5.2 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.5.1 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.5.0 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.0.1 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-8.0.0 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-7.9.1 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-7.9.0 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-7.8.14 app/controllers/phcmemberspro/application_controller.rb
phcmemberspro-7.8.12 app/controllers/phcmemberspro/application_controller.rb