Last change
on this file since 0f6d75f was 7b7d827, checked in by njw <njw@…>, 11 years ago |
opened projects: hothotwrite and contact
|
-
Property mode
set to
100644
|
File size:
604 bytes
|
Rev | Line | |
---|
[7b7d827] | 1 | class LoginController < ApplicationController
|
---|
| 2 | layout 'standard'
|
---|
| 3 |
|
---|
| 4 | def index
|
---|
| 5 | @logged_in = session[:valid_login]
|
---|
| 6 | end
|
---|
| 7 |
|
---|
| 8 | def logout
|
---|
| 9 | session[:valid_login] = nil
|
---|
| 10 | end
|
---|
| 11 |
|
---|
| 12 | def login
|
---|
| 13 | session[:valid_login] = nil
|
---|
| 14 | if request.post?
|
---|
| 15 | session[:valid_login] = params[:password] == ApplicationController.application_password
|
---|
| 16 | if session[:valid_login]
|
---|
| 17 | uri = session[:original_uri]
|
---|
| 18 | session[:original_uri] = nil
|
---|
| 19 | redirect_to(uri || { :action => "index" })
|
---|
| 20 | else
|
---|
| 21 | flash[:notice] = "Invalid user/password combination"
|
---|
| 22 | end
|
---|
| 23 | end
|
---|
| 24 | end
|
---|
| 25 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.