X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fsubqueue.php;h=ba473456004ef06ffa364d1fc7ad4b59e56415bd;hb=c950f1854623f0df2a50c193f624f0a0bf1fcbb3;hp=38bc16e56236d28e1acdc471e07977ebab1961f2;hpb=5a2bab07b25443eacc7f5cfde4b9932cdb511e92;p=quix0rs-gnu-social.git diff --git a/actions/subqueue.php b/actions/subqueue.php index 38bc16e562..ba47345600 100644 --- a/actions/subqueue.php +++ b/actions/subqueue.php @@ -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 } }