diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 48b9591..d039717 100755 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -1,5 +1,7 @@ class AdminController < ApplicationController + skip_before_filter :has_info + def dashboard end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5fe5675..f0f5454 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,6 +1,6 @@ class ApplicationController < ActionController::Base - before_filter :authenticated + before_filter :authenticated, :has_info helper_method :current_user, :is_admin? # Our security guy keep talking about sea-surfing, cool story bro. @@ -27,4 +27,18 @@ class ApplicationController < ActionController::Base end end + def has_info + redirect = false + if current_user + 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 + rescue + redirect = true + end + end + redirect_to home_dashboard_index_path if redirect + end + end diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 4ed95df..593abe4 100755 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -1,5 +1,7 @@ class DashboardController < ApplicationController + skip_before_filter :has_info + def home @user = current_user end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 7efd1b1..b803b8e 100755 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,5 +1,6 @@ class SessionsController < ApplicationController + skip_before_filter :has_info skip_before_filter :authenticated, :only => [:new, :create] def new diff --git a/app/controllers/tutorials_controller.rb b/app/controllers/tutorials_controller.rb index bd6fd61..1e1d1dd 100755 --- a/app/controllers/tutorials_controller.rb +++ b/app/controllers/tutorials_controller.rb @@ -1,5 +1,6 @@ class TutorialsController < ApplicationController + skip_before_filter :has_info skip_before_filter :authenticated def index diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e4e79cb..fcdde75 100755 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,5 +1,6 @@ class UsersController < ApplicationController + skip_before_filter :has_info skip_before_filter :authenticated, :only => [:new, :create] def new diff --git a/app/views/dashboard/home.html.erb b/app/views/dashboard/home.html.erb index 343a182..8d206b3 100755 --- a/app/views/dashboard/home.html.erb +++ b/app/views/dashboard/home.html.erb @@ -4,7 +4,9 @@