hps_member/app/controllers/c_user_controller.rb

28 lines
669 B
Ruby
Raw Normal View History

2017-05-18 12:12:35 +00:00
class CUserController < ApplicationController
before_filter :set_key_for_this
layout "special"
helper_method :current_counselor_user
def is_user_authorized?
redirect_to member_login_path if current_counselor_user.nil?
end
def create_cuser_session(user=nil)
if !user.nil? and current_counselor_user.nil?
session[:current_counselor_user_id] = user.id
end
end
def destroy_cpanel_session
session.delete(:current_counselor_user_id)
end
def current_counselor_user
@current_counselor_user = HpsMember.find(session[:current_counselor_user_id]) rescue nil
end
def set_key_for_this
@key = Site.first.template
end
end