diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2012-12-17 12:01:45 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2012-12-17 12:01:45 +0100 |
commit | b80bd744ad873f6fc43018bc4bfb90677de167bd (patch) | |
tree | 072c4b0e33d442528555b82c415f5e7a1712b2b0 /app/controllers/page_controller.rb | |
parent | 3e706c2025ecc5523e81ad649639ef2ff75e7bac (diff) |
Start of GS5.
Diffstat (limited to 'app/controllers/page_controller.rb')
-rw-r--r-- | app/controllers/page_controller.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/controllers/page_controller.rb b/app/controllers/page_controller.rb new file mode 100644 index 0000000..1f37449 --- /dev/null +++ b/app/controllers/page_controller.rb @@ -0,0 +1,24 @@ +class PageController < ApplicationController + # load_and_authorize_resource :class => false + # CanCan doesn't work here really good because Page is not a resource. + + before_filter :if_fresh_system_then_go_to_wizard + skip_before_filter :home_breadcrumb, :only => [:index] + + def index;end + def conference;end + + private + def if_fresh_system_then_go_to_wizard + if Tenant.count == 0 && User.count == 0 + # This is a brand new system. We need to run a setup first. + redirect_to wizards_new_initial_setup_path + else + if current_user.nil? + # You need to login first. + redirect_to log_in_path, :alert => I18n.t('pages.controller.access_denied_login_first') + end + end + end + +end |