From 70226f183334f66154b88347ea91cb79deca24db Mon Sep 17 00:00:00 2001 From: Etienne Massip Date: Fri, 24 Aug 2012 21:23:10 +0000 Subject: [PATCH] Use a back_url parameter instead of referrer to refresh the page after user deletion (#11691). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10234 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/application_controller.rb | 2 +- app/controllers/users_controller.rb | 2 +- app/views/users/index.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d6efa4124..0e5f6ba54 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -300,7 +300,7 @@ class ApplicationController < ActionController::Base end def redirect_back_or_default(default) - back_url = CGI.unescape(params[:back_url].to_s) + back_url = params[:back_url].to_s if !back_url.blank? begin uri = URI.parse(back_url) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a56371c5f..da6f6ae28 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -174,7 +174,7 @@ class UsersController < ApplicationController def destroy @user.destroy respond_to do |format| - format.html { redirect_to_referer_or(users_url) } + format.html { redirect_back_or_default(users_url) } format.api { render_api_ok } end end diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index a477a5c90..f88b5231e 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -46,7 +46,7 @@ <%= format_time(user.last_login_on) unless user.last_login_on.nil? %> <%= change_status_link(user) %> - <%= delete_link user_path(user) unless User.current == user %> + <%= delete_link user_path(user, :back_url => users_path(params)) unless User.current == user %> <% end -%>