Sha256: cbf1289c9d4dd39152d350fa81f1553190b2c367f4f63adfd2ab786055086c52

Contents?: true

Size: 918 Bytes

Versions: 15

Compression:

Stored size: 918 Bytes

Contents

# The AdminController is the parent class that makes sure all administrator actions
# require a logged-in User with an admin Role.
class Admin::BaseController < ApplicationController

  layout 'admin'

  # Replace this with your own authentication / authorization stuff
  before_filter :http_authentication
  # Example when using Devise gem
  # before_filter :authenticate_admin!

  # Add controller names you want to include as tab. Eg.
  #  @@tabs = %w(messages) # if you created a Admin::MessagesController using the admin_scaffold generator.
  cattr_accessor :tabs
  @@tabs = %w()

  #  GET /admin/
  def index
  end

private

  ADMIN_USERNAME = 'admin' # HTTP Basic admin username
  ADMIN_PASSWORD = 'admin' # HTTP Basic admin password

  def http_authentication
    authenticate_or_request_with_http_basic do |username, password|
      username == ADMIN_USERNAME && password == ADMIN_PASSWORD
    end
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
admin_interface-2.2.5 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.2.4 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.2.3 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.2.2 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.2.1 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.2.0 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.1.15 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.1.14 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.1.13 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.1.12 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.1.11 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.1.10 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.1.9 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.1.8 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb
admin_interface-2.1.7 lib/generators/admin_interface/templates/setup/controllers/base_controller.rb