- if (!$this->profile) {
- // TRANS: Error message displayed when referring to a user without a profile.
- $this->serverError(_('User has no profile.'));
- return false;
+ protected function prepare(array $args=array())
+ {
+ // this will call ->doPreparation() which child classes use to set $this->target
+ parent::prepare($args);
+
+ if ($this->target->hasRole(Profile_role::SILENCED)
+ && (!$this->scoped instanceof Profile || !$this->scoped->hasRight(Right::SILENCEUSER))) {
+ throw new ClientException(_('This profile has been silenced by site moderators'), 403);