This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Tue Nov 27 11:44:27 -0800 2007 | |
| |
README | Thu Nov 06 17:05:06 -0800 2008 | |
| |
Rakefile | Tue Nov 27 11:44:27 -0800 2007 | |
| |
init.rb | Fri Nov 30 10:42:36 -0800 2007 | |
| |
lib/ | Mon Aug 04 15:06:19 -0700 2008 | |
| |
tasks/ | Tue Apr 01 14:30:15 -0700 2008 | |
| |
test/ | Thu Nov 06 14:34:27 -0800 2008 |
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







