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
This commit is contained in:
parent
a1d8cab6c6
commit
70226f1833
|
@ -300,7 +300,7 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def redirect_back_or_default(default)
|
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?
|
if !back_url.blank?
|
||||||
begin
|
begin
|
||||||
uri = URI.parse(back_url)
|
uri = URI.parse(back_url)
|
||||||
|
|
|
@ -174,7 +174,7 @@ class UsersController < ApplicationController
|
||||||
def destroy
|
def destroy
|
||||||
@user.destroy
|
@user.destroy
|
||||||
respond_to do |format|
|
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 }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
<td class="last_login_on" align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
|
<td class="last_login_on" align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
|
||||||
<td class="buttons">
|
<td class="buttons">
|
||||||
<%= change_status_link(user) %>
|
<%= 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 %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
Loading…
Reference in New Issue