diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4ffb9d222..84042882d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -53,10 +53,14 @@ protected respond_to do |fmt| fmt.html do - if request.get? - redirect_to new_session_path(:url => previous_url), :notice => "Access denied" + if CurrentUser.is_anonymous? + if request.get? + redirect_to new_session_path(:url => previous_url), :notice => "Access denied" + else + redirect_to new_session_path, :notice => "Access denied" + end else - redirect_to new_session_path, :notice => "Access denied" + render :template => "static/access_denied", :status => 403 end end fmt.xml do diff --git a/app/views/static/access_denied.html.erb b/app/views/static/access_denied.html.erb index 41481149a..1b8aee37c 100644 --- a/app/views/static/access_denied.html.erb +++ b/app/views/static/access_denied.html.erb @@ -1,5 +1,7 @@