Display an error when authenticity token is invalid.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3094 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
ebab5a0074
commit
f3bcb705f7
|
@ -38,6 +38,8 @@ class ApplicationController < ActionController::Base
|
||||||
filter_parameter_logging :password
|
filter_parameter_logging :password
|
||||||
protect_from_forgery
|
protect_from_forgery
|
||||||
|
|
||||||
|
rescue_from ActionController::InvalidAuthenticityToken, :with => :invalid_authenticity_token
|
||||||
|
|
||||||
include Redmine::Search::Controller
|
include Redmine::Search::Controller
|
||||||
include Redmine::MenuManager::MenuController
|
include Redmine::MenuManager::MenuController
|
||||||
helper Redmine::MenuManager::MenuHelper
|
helper Redmine::MenuManager::MenuHelper
|
||||||
|
@ -189,6 +191,10 @@ class ApplicationController < ActionController::Base
|
||||||
render :text => '', :layout => !request.xhr?, :status => 500
|
render :text => '', :layout => !request.xhr?, :status => 500
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def invalid_authenticity_token
|
||||||
|
render_error "Invalid form authenticity token."
|
||||||
|
end
|
||||||
|
|
||||||
def render_feed(items, options={})
|
def render_feed(items, options={})
|
||||||
@items = items || []
|
@items = items || []
|
||||||
@items.sort! {|x,y| y.event_datetime <=> x.event_datetime }
|
@items.sort! {|x,y| y.event_datetime <=> x.event_datetime }
|
||||||
|
|
Loading…
Reference in New Issue