]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
hide silenced users' profile pages
authorEvan Prodromou <evan@status.net>
Thu, 8 Mar 2012 12:45:56 +0000 (06:45 -0600)
committerEvan Prodromou <evan@status.net>
Thu, 8 Mar 2012 12:45:56 +0000 (06:45 -0600)
lib/profileaction.php

index 1bc14945576258416e4034dde7d608b037816d2a..45866b52f9bde88a5d855bf16f3e998375891ad3 100644 (file)
@@ -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());