Project

General

Profile

Download (493 Bytes) Statistics
| Branch: | Tag: | Revision:

root / app / controllers / logon_controller.rb @ a579432b

1
class LogonController < ApplicationController
2
  def index
3
    render :action => "login"
4
  end
5

    
6
  def login
7
    if request.post?
8
      if session[:user_id] = User.authenticate(params[:login], params[:password])
9
        flash[:message]  = _("Login successful")
10
        redirect_to_stored
11
      else
12
        flash[:warning] = _("Login unsuccessful")
13
      end
14
    end
15
  end
16

    
17
  def logout
18
    session[:user_id] = nil
19
    flash[:message] = 'Logged out'
20
    redirect_to :action => 'login'
21
  end
22
end
(3-3/5)