diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 34b9b73..f057400 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -124,9 +124,10 @@ class ApplicationController < ActionController::Base render :template => 'shared/not_found.rhtml', :status => 404 end - def render_access_denied(message = nil) + def render_access_denied(message = nil, title = nil) @no_design_blocks = true @message = message + @title = title render :template => 'shared/access_denied.rhtml', :status => 403 end diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index 88a35bd..a1872be 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -107,7 +107,7 @@ class ProfileController < PublicController def check_access_to_profile unless profile.display_info_to?(user) - render :action => 'private_profile', :status => 403, :layout => false + render_access_denied(_("Sorry, this profile was defined as private by its owner. You'll not be able to view content here unless the profile owner adds you."), _("Oops ... you cannot go ahead here")) end end diff --git a/app/views/shared/access_denied.rhtml b/app/views/shared/access_denied.rhtml index 97d1647..044a32e 100644 --- a/app/views/shared/access_denied.rhtml +++ b/app/views/shared/access_denied.rhtml @@ -1,6 +1,6 @@
-

<%= _('Access denied') %>

+

<%= @title || _('Access denied') %>

<% unless @message.nil? %>

<%= @message %>

-- libgit2 0.21.2