From fc713b660b7aa25ed1c5491fe2f2e36628bff14c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 8 Mar 2012 06:45:56 -0600 Subject: [PATCH] hide silenced users' profile pages --- lib/profileaction.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/profileaction.php b/lib/profileaction.php index 1bc1494557..45866b52f9 100644 --- a/lib/profileaction.php +++ b/lib/profileaction.php @@ -86,6 +86,13 @@ class ProfileAction extends Action return false; } + $user = common_current_user(); + + if ($this->profile->hasRole(Profile_role::SILENCED) && + (empty($user) || !$user->hasRight(Right::SILENCEUSER))) { + throw new ClientException(_('This profile has been silenced by site moderators'), 403); + } + $this->tag = $this->trimmed('tag'); $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; common_set_returnto($this->selfUrl());