Commit aa137131e2f6fc86f42ab09af477de16666db8fb

Authored by Antonio Terceiro
1 parent f88dad03

Better screen for private profiles

(ActionItem1330)
app/controllers/application.rb
@@ -124,9 +124,10 @@ class ApplicationController < ActionController::Base @@ -124,9 +124,10 @@ class ApplicationController < ActionController::Base
124 render :template => 'shared/not_found.rhtml', :status => 404 124 render :template => 'shared/not_found.rhtml', :status => 404
125 end 125 end
126 126
127 - def render_access_denied(message = nil) 127 + def render_access_denied(message = nil, title = nil)
128 @no_design_blocks = true 128 @no_design_blocks = true
129 @message = message 129 @message = message
  130 + @title = title
130 render :template => 'shared/access_denied.rhtml', :status => 403 131 render :template => 'shared/access_denied.rhtml', :status => 403
131 end 132 end
132 133
app/controllers/public/profile_controller.rb
@@ -107,7 +107,7 @@ class ProfileController < PublicController @@ -107,7 +107,7 @@ class ProfileController < PublicController
107 107
108 def check_access_to_profile 108 def check_access_to_profile
109 unless profile.display_info_to?(user) 109 unless profile.display_info_to?(user)
110 - render :action => 'private_profile', :status => 403, :layout => false 110 + 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"))
111 end 111 end
112 end 112 end
113 113
app/views/shared/access_denied.rhtml
1 <div id='access-denied'> 1 <div id='access-denied'>
2 2
3 - <h1> <%= _('Access denied') %> </h1> 3 + <h1> <%= @title || _('Access denied') %> </h1>
4 4
5 <% unless @message.nil? %> 5 <% unless @message.nil? %>
6 <p><%= @message %></p> 6 <p><%= @message %></p>