adding password rest method and changing some logic around

This commit is contained in:
Mike McCabe
2013-12-11 22:25:02 -05:00
parent 8eb398950f
commit abe22b19e9
6 changed files with 56 additions and 40 deletions
+7 -7
View File
@@ -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