From ce41d4f9b04bbe40b5030182304f772defb6a210 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Sat, 14 Nov 2009 20:18:57 +0000 Subject: [PATCH] Merged r3050 from trunk. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@3052 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/application.rb | 8 +++++++- doc/CHANGELOG | 1 + test/integration/admin_test.rb | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/controllers/application.rb b/app/controllers/application.rb index e8d0a85b7..29772ca13 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -82,7 +82,13 @@ class ApplicationController < ActionController::Base def require_login if !User.current.logged? - redirect_to :controller => "account", :action => "login", :back_url => url_for(params) + # Extract only the basic url parameters on non-GET requests + if request.get? + url = url_for(params) + else + url = url_for(:controller => params[:controller], :action => params[:action], :id => params[:id], :project_id => params[:project_id]) + end + redirect_to :controller => "account", :action => "login", :back_url => url return false end true diff --git a/doc/CHANGELOG b/doc/CHANGELOG index c1f8803b5..58b73601d 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -10,6 +10,7 @@ http://www.redmine.org/ * Fixed: pre tags containing " { :login => 'psmith', :firstname => 'Paul'}, :password => "psmith09", :password_confirmation => "psmith09" + assert_response :redirect + assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fusers%2Fadd" + end end -- 2.39.5