mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
Merged r3537 and r3572 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.9-stable@3644 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
667f7927a7
commit
46be83cd5e
@ -25,8 +25,7 @@ class AccountController < ApplicationController
|
|||||||
# Login request and validation
|
# Login request and validation
|
||||||
def login
|
def login
|
||||||
if request.get?
|
if request.get?
|
||||||
# Logout user
|
logout_user
|
||||||
self.logged_user = nil
|
|
||||||
else
|
else
|
||||||
# Authenticate user
|
# Authenticate user
|
||||||
if Setting.openid? && using_open_id?
|
if Setting.openid? && using_open_id?
|
||||||
@ -39,9 +38,7 @@ class AccountController < ApplicationController
|
|||||||
|
|
||||||
# Log out current user and redirect to welcome page
|
# Log out current user and redirect to welcome page
|
||||||
def logout
|
def logout
|
||||||
cookies.delete :autologin
|
logout_user
|
||||||
Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) if User.current.logged?
|
|
||||||
self.logged_user = nil
|
|
||||||
redirect_to home_url
|
redirect_to home_url
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -134,7 +131,15 @@ class AccountController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def logout_user
|
||||||
|
if User.current.logged?
|
||||||
|
cookies.delete :autologin
|
||||||
|
Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin'])
|
||||||
|
self.logged_user = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def password_authentication
|
def password_authentication
|
||||||
user = User.try_to_login(params[:username], params[:password])
|
user = User.try_to_login(params[:username], params[:password])
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user