source: ruby/trunk/rails/cancerehr/app/controllers/login_controller.rb@ 59

Last change on this file since 59 was 59, checked in by KOBAYASHI, Shinji, 15 years ago

login window created

File size: 629 bytes
Line 
1class LoginController < ApplicationController
2# layout "admin"
3 def add_user
4 @user = User.new(params[:user])
5 if request.post? and @user.save
6 flash.now[:notice] = "User:#{@user.name} created."
7 @user = User.new
8 end
9 end
10
11 def login
12 session[:user_id] = nil
13 if request.post?
14 user = User.authenticate(params[:name], params[:password])
15 if user
16 session[:user_id] = user.id
17 redirect_to(:action => "index")
18 else
19 flash[:notice] = "Invalid user"
20 end
21 end
22 end
23
24 def logout
25 end
26
27 def index
28
29 end
30
31 def deleteuser
32 end
33
34 def list_users
35 end
36end
Note: See TracBrowser for help on using the repository browser.