From: Evan Prodromou Date: Thu, 8 Mar 2012 12:45:56 +0000 (-0600) Subject: hide silenced users' profile pages X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fc713b660b7aa25ed1c5491fe2f2e36628bff14c;p=quix0rs-gnu-social.git hide silenced users' profile pages --- 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());