summaryrefslogtreecommitdiffstats
path: root/app/controllers/account_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-29 18:09:40 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-29 18:09:40 +0000
commitac56d1d5e54334624cfdf584b1b854c26d2dc00e (patch)
treed68714b8276990230d4accff12cab402c650c142 /app/controllers/account_controller.rb
parent72d208cb35820676aa4fe065097516b0fa22bcc3 (diff)
downloadredmine-ac56d1d5e54334624cfdf584b1b854c26d2dc00e.tar.gz
redmine-ac56d1d5e54334624cfdf584b1b854c26d2dc00e.zip
Do not show user profile if no visible project or activity (#4129, #3720).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2986 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/account_controller.rb')
-rw-r--r--app/controllers/account_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index 1b3bf63eb..f2d6a8d6e 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -35,6 +35,10 @@ class AccountController < ApplicationController
events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 10)
@events_by_day = events.group_by(&:event_date)
+ if @user != User.current && !User.current.admin? && @memberships.empty? && events.empty?
+ render_404 and return
+ end
+
rescue ActiveRecord::RecordNotFound
render_404
end