This commit is contained in:
Toks
2014-01-08 15:42:27 -05:00
parent 986b1c2029
commit d3a67961e9
2 changed files with 9 additions and 3 deletions

View File

@@ -53,11 +53,15 @@ protected
respond_to do |fmt| respond_to do |fmt|
fmt.html do fmt.html do
if CurrentUser.is_anonymous?
if request.get? if request.get?
redirect_to new_session_path(:url => previous_url), :notice => "Access denied" redirect_to new_session_path(:url => previous_url), :notice => "Access denied"
else else
redirect_to new_session_path, :notice => "Access denied" redirect_to new_session_path, :notice => "Access denied"
end end
else
render :template => "static/access_denied", :status => 403
end
end end
fmt.xml do fmt.xml do
render :xml => {:success => false, :reason => "access denied"}.to_xml(:root => "response"), :status => 403 render :xml => {:success => false, :reason => "access denied"}.to_xml(:root => "response"), :status => 403

View File

@@ -1,5 +1,7 @@
<h1>Access Denied</h1> <h1>Access Denied</h1>
<%= link_to "Go back", :back, :rel => "prev" %>
<% content_for(:page_title) do %> <% content_for(:page_title) do %>
Access Denied - <%= Danbooru.config.app_name %> Access Denied - <%= Danbooru.config.app_name %>
<% end %> <% end %>