Commit aa137131e2f6fc86f42ab09af477de16666db8fb
1 parent
f88dad03
Exists in
master
and in
29 other branches
Better screen for private profiles
(ActionItem1330)
Showing
3 changed files
with
4 additions
and
3 deletions
Show diff stats
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