]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/subqueue.php
ShowprofiletagAction now extends ShowstreamAction
[quix0rs-gnu-social.git] / actions / subqueue.php
index 38bc16e56236d28e1acdc471e07977ebab1961f2..ba473456004ef06ffa364d1fc7ad4b59e56415bd 100644 (file)
@@ -44,23 +44,15 @@ require_once(INSTALLDIR.'/lib/profilelist.php');
  */
 class SubqueueAction extends GalleryAction
 {
-    var $page = null;
+    protected $needLogin = true;
 
-    function isReadOnly($args)
-    {
-        return true;
-    }
-
-    // @todo FIXME: most of this belongs in a base class, sounds common to most group actions?
-    function prepare($args)
+    protected function prepare(array $args=array())
     {
         parent::prepare($args);
 
-        $cur = common_current_user();
-        if (!$cur || $cur->id != $this->profile->id) {
+        if ($this->scoped->id != $this->target->id) {
             // TRANS: Client error displayed when trying to approve group applicants without being a group administrator.
             $this->clientError(_('You may only approve your own pending subscriptions.'));
-            return false;
         }
         return true;
     }
@@ -71,12 +63,12 @@ class SubqueueAction extends GalleryAction
             // TRANS: Title of the first page showing pending subscribers still awaiting approval.
             // TRANS: %s is the name of the user.
             return sprintf(_('%s subscribers awaiting approval'),
-                           $this->profile->nickname);
+                           $this->target->getNickname());
         } else {
             // TRANS: Title of all but the first page showing pending subscribersmembers still awaiting approval.
             // TRANS: %1$s is the name of the user, %2$d is the page number of the members list.
             return sprintf(_('%1$s subscribers awaiting approval, page %2$d'),
-                           $this->profile->nickname,
+                           $this->target->getNickname(),
                            $this->page);
         }
     }
@@ -96,7 +88,7 @@ class SubqueueAction extends GalleryAction
 
         $cnt = 0;
 
-        $members = $this->profile->getRequests($offset, $limit);
+        $members = $this->target->getRequests($offset, $limit);
 
         if ($members) {
             // @fixme change!
@@ -108,7 +100,7 @@ class SubqueueAction extends GalleryAction
 
         $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
                           $this->page, 'subqueue',
-                          array('nickname' => $this->profile->nickname)); // urgh
+                          array('nickname' => $this->target->getNickname())); // urgh
     }
 }