public
Description: Simple Ruby on Rails plugin to do administration logins through usernames and passwords saved in YAML.
Homepage: http://geminstallthat.wordpress.com/2008/11/07/simple_admin-met-a-pieman/
Clone URL: git://github.com/latimes/simple_admin.git
name age message
file MIT-LICENSE Tue Nov 27 11:44:27 -0800 2007 Initial import for simple_login git-svn-id: ht... [mshastri]
file README Thu Nov 06 17:05:06 -0800 2008 added copyright [dmcinnes]
file Rakefile Tue Nov 27 11:44:27 -0800 2007 Initial import for simple_login git-svn-id: ht... [mshastri]
file init.rb Fri Nov 30 10:42:36 -0800 2007 changed simple_login to simple_admin git-svn... [dmcinnes]
directory lib/ Mon Aug 04 15:06:19 -0700 2008 re-factored self.admin_mode? git-svn-id: http... [jdewey]
directory tasks/ Tue Apr 01 14:30:15 -0700 2008 fixed the LOGIN_FILE undefined shizzle git-sv... [reid]
directory test/ Thu Nov 06 14:34:27 -0800 2008 test works now :) [dmcinnes]
README
SimpleLogin
===========

Simple plugin to do administration logins through usernames and passwords saved in YAML.

Example
=======

Add this to your application controller and it will ask for Basic HTTP authentication on everything:

  include SimpleAdmin

  before_filter :check_basic_http_credentials

Like all filters you can add conditions:

  before_filter :check_basic_http_credentials, :only => :login

When including SimpleAdmin in your controller you also get access to the authenticate(username, password) method which 
can be used for custom login pages:

  def login
    if authenticate(params[:username], params[:password])
      session[:admin] = true
      redirect_to main_page
    end
  end

The plugin stores users in a YAML file.  To add a user to the file run the admin:add_user rake task.  You'll have to 
provide the username and password parameters:

  rake admin:add_user username=mrwalrus password=mahbukkit

Rake will append the user to the login.yaml file or create a new one.  The default location for this file is 
config/admin/login.yml but can be overridden by setting the LOGIN_FILE environment variable.

Say you want to use a different set of logins in production then in development?  Add this to your 
environments/production.rb file (changing the path to your desired location):

  ENV["LOGIN_FILE"] = "#{RAILS_ROOT}/config/admin/production/login.yml"


Copyright (c) 2008 Los Angeles Times, released under the MIT license