28 lines
669 B
Ruby
28 lines
669 B
Ruby
|
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
|