we are going to fix this by automatically generating data for ppl that register HOWEVER, just in case that fails for some reason, I have applied a filter that ensures if some data is not associated with a person they cannot navigate to all aspects of the application. This is a preventive measure
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
class AdminController < ApplicationController
|
class AdminController < ApplicationController
|
||||||
|
|
||||||
|
skip_before_filter :has_info
|
||||||
|
|
||||||
def dashboard
|
def dashboard
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
before_filter :authenticated
|
before_filter :authenticated, :has_info
|
||||||
helper_method :current_user, :is_admin?
|
helper_method :current_user, :is_admin?
|
||||||
|
|
||||||
# Our security guy keep talking about sea-surfing, cool story bro.
|
# Our security guy keep talking about sea-surfing, cool story bro.
|
||||||
@@ -27,4 +27,18 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
class DashboardController < ApplicationController
|
class DashboardController < ApplicationController
|
||||||
|
|
||||||
|
skip_before_filter :has_info
|
||||||
|
|
||||||
def home
|
def home
|
||||||
@user = current_user
|
@user = current_user
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class SessionsController < ApplicationController
|
class SessionsController < ApplicationController
|
||||||
|
|
||||||
|
skip_before_filter :has_info
|
||||||
skip_before_filter :authenticated, :only => [:new, :create]
|
skip_before_filter :authenticated, :only => [:new, :create]
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class TutorialsController < ApplicationController
|
class TutorialsController < ApplicationController
|
||||||
|
|
||||||
|
skip_before_filter :has_info
|
||||||
skip_before_filter :authenticated
|
skip_before_filter :authenticated
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class UsersController < ApplicationController
|
class UsersController < ApplicationController
|
||||||
|
|
||||||
|
skip_before_filter :has_info
|
||||||
skip_before_filter :authenticated, :only => [:new, :create]
|
skip_before_filter :authenticated, :only => [:new, :create]
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|||||||
@@ -4,7 +4,9 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12"> <!--begin span12 -->
|
<div class="span12"> <!--begin span12 -->
|
||||||
<%= render :partial => "layouts/dashboard/dashboard_stats"%>
|
<% if @user.paid_time_off %>
|
||||||
|
<%= render :partial => "layouts/dashboard/dashboard_stats"%>
|
||||||
|
<% end %>
|
||||||
</div> <!-- end span12 -->
|
</div> <!-- end span12 -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="widget">
|
<div class="widget">
|
||||||
<div class="widget-header">
|
<div class="widget-header">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<span class="fs1" aria-hidden="true" data-icon=""></span> Profile Settings
|
<span class="fs1" aria-hidden="true" data-icon=""></span> Profile Settings
|
||||||
<span class="mini-title">
|
<span class="mini-title">
|
||||||
Edit your account details
|
Edit your account details
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user