class LoginController < ApplicationController layout 'standard' def index @logged_in = session[:valid_login] end def logout session[:valid_login] = nil end def login session[:valid_login] = nil if request.post? session[:valid_login] = params[:password] == ApplicationController.application_password if session[:valid_login] uri = session[:original_uri] session[:original_uri] = nil redirect_to(uri || { :action => "index" }) else flash[:notice] = "Invalid user/password combination" end end end end