]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/profileaction.php
Subscription "get by" functions now don't use ArrayWrappers
[quix0rs-gnu-social.git] / lib / profileaction.php
index eaf515e04a45005e26e3d83c630125d608e9bf28..1efa9060678dba207b268c253a1e08b9348b49a4 100644 (file)
@@ -70,7 +70,7 @@ class ProfileAction extends Action
             return false;
         }
 
-        $this->user = User::staticGet('nickname', $nickname);
+        $this->user = User::getKV('nickname', $nickname);
 
         if (!$this->user) {
             // TRANS: Client error displayed when calling a profile action without specifying a user.
@@ -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());
@@ -118,7 +125,7 @@ class ProfileAction extends Action
 
     function showSubscriptions()
     {
-        $profile = $this->profile->getSubscriptions(0, PROFILES_PER_MINILIST + 1);
+        $profile = $this->profile->getSubscribed(0, PROFILES_PER_MINILIST + 1);
 
         $this->elementStart('div', array('id' => 'entity_subscriptions',
                                          'class' => 'section'));
@@ -259,7 +266,7 @@ class ProfileAction extends Action
             // TRANS: H2 text for user group membership statistics.
             $this->statsSectionLink('usergroups', _('Groups'));
             $this->text(' ');
-            $this->text($this->profile->getGroups()->N);
+            $this->text($this->profile->getGroups(0, null)->N);
             $this->elementEnd('h2');
 
             if ($groups) {