Sha256: b82f82d1c08605f90b9efa3883822682f2293a092940087ca2fec1869c6e2463

Contents?: true

Size: 591 Bytes

Versions: 6

Compression:

Stored size: 591 Bytes

Contents

class ApplicationController < ActionController::Base
  protect_from_forgery

  before_filter :any_admin_user_exists?, :authenticate_admin_user!,
     :unless => :first_admin_user_action?

  def any_admin_user_exists?
    return if current_admin_user
    if AdminUser.first.nil?
      redirect_to :action => 'first', :controller => 'admin_users'
    end
  end

  def first_admin_user_action?
    params[:controller] == 'admin_users' and (
      params[:action] == 'first' or params[:action] == 'create'
    )
  end

  def after_sign_in_path_for(resource_or_scope)
    domains_path
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rmails-0.2.1 app/controllers/application_controller.rb
rmails-0.2.0 app/controllers/application_controller.rb
rmails-0.1.6 app/controllers/application_controller.rb
rmails-0.1.5 app/controllers/application_controller.rb
rmails-0.1.4 app/controllers/application_controller.rb
rmails-0.1.3 app/controllers/application_controller.rb