adding password rest method and changing some logic around
This commit is contained in:
@@ -2,23 +2,23 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
before_filter :authenticated, :has_info
|
||||
helper_method :current_user, :is_admin?
|
||||
|
||||
|
||||
# Our security guy keep talking about sea-surfing, cool story bro.
|
||||
# protect_from_forgery
|
||||
|
||||
|
||||
private
|
||||
|
||||
def current_user
|
||||
@current_user ||= User.find_by_user_id(session[:user_id].to_s)
|
||||
end
|
||||
|
||||
|
||||
def authenticated
|
||||
path = request.fullpath.present? ? root_url(:url => request.fullpath) : root_url
|
||||
redirect_to path and reset_session if not current_user
|
||||
end
|
||||
|
||||
def is_admin?
|
||||
current_user.admin if current_user
|
||||
current_user.admin if current_user
|
||||
end
|
||||
|
||||
def administrative
|
||||
@@ -27,11 +27,11 @@ class ApplicationController < ActionController::Base
|
||||
redirect_to root_url
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def has_info
|
||||
redirect = false
|
||||
if current_user
|
||||
begin
|
||||
begin
|
||||
if !(current_user.retirement || current_user.paid_time_off.schedule || current_user.paid_time_off || current_user.work_info || current_user.performance)
|
||||
redirect = true
|
||||
end
|
||||
@@ -41,5 +41,5 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
redirect_to home_dashboard_index_path if redirect
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user