X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapigroupmembership.php;h=0e01f92f001dd1db76da5874b4feedba0bdb41f7;hb=b209dcf8a75dd1ead7fa9ae7df06d9a73d77928d;hp=99ac965fa18d2c5aa9de82cf91ef317a3be8e025;hpb=0b1f48ebd0fcfed50d2110b7731196e9adcc04a6;p=quix0rs-gnu-social.git diff --git a/actions/apigroupmembership.php b/actions/apigroupmembership.php index 99ac965fa1..0e01f92f00 100644 --- a/actions/apigroupmembership.php +++ b/actions/apigroupmembership.php @@ -35,8 +35,6 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/apiprivateauth.php'; - /** * List 20 newest members of the group specified by name or ID. * @@ -61,11 +59,16 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction * * @return boolean success flag */ - function prepare($args) + protected function prepare(array $args=array()) { parent::prepare($args); $this->group = $this->getTargetGroup($this->arg('id')); + if (empty($this->group)) { + // TRANS: Client error displayed trying to show group membership on a non-existing group. + $this->clientError(_('Group not found.'), 404); + } + $this->profiles = $this->getProfiles(); return true; @@ -76,19 +79,11 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction * * Show the members of the group * - * @param array $args $_REQUEST data (unused) - * * @return void */ - function handle($args) + protected function handle() { - parent::handle($args); - - if (empty($this->group)) { - // TRANS: Client error displayed trying to show group membership on a non-existing group. - $this->clientError(_('Group not found.'), 404, $this->format); - return false; - } + parent::handle(); // XXX: RSS and Atom @@ -100,13 +95,8 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction $this->showJsonUsers($this->profiles); break; default: - $this->clientError( - // TRANS: Client error displayed trying to execute an unknown API method showing group membership. - _('API method not found.'), - 404, - $this->format - ); - break; + // TRANS: Client error displayed when coming across a non-supported API method. + $this->clientError(_('API method not found.'), 404); } }