Show More
Commit Description:
initial commit...
Commit Description:
initial commit git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@1 6386c4cd-e34a-4fa8-8920-d93eb39b512e
References:
File last commit:
Show/Diff file:
Action:
app/controllers/login_controller.rb | 19 lines | 466 B | text/x-ruby | RubyLexer |
class LoginController < ApplicationController
def index
# show login screen
reset_session
redirect_to :controller => 'main', :action => 'login'
end
def login
if user = User.authenticate(params[:login], params[:password])
session[:user_id] = user.id
redirect_to :controller => 'main', :action => 'list'
else
flash[:notice] = 'Wrong password'
redirect_to :controller => 'main', :action => 'login'
end
end
end