From e109c9b6b6f314dea19bf92dffa217d962eaa200 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 12 Mar 2010 19:22:11 +0000 Subject: [PATCH] Do not reset session when a non logged in user request the login form (#4958). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3572 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/account_controller.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 8d807eb3..b0a5b42a 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -128,9 +128,11 @@ class AccountController < ApplicationController private def logout_user - cookies.delete :autologin - Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) if User.current.logged? - self.logged_user = nil + 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 authenticate_user