X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapigroupmembership.php;h=c97b27fac425cd7e7f383e359d7738cec37a430d;hb=fee6b78e2896705b831fc98025581405e3e21e27;hp=27f77029eb62b154fdc49c2cde0f06ed7fd4fc73;hpb=e071a8cbffd8eaf63f2d92e15edc2f6f25d9c984;p=quix0rs-gnu-social.git diff --git a/actions/apigroupmembership.php b/actions/apigroupmembership.php index 27f77029eb..c97b27fac4 100644 --- a/actions/apigroupmembership.php +++ b/actions/apigroupmembership.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @author Zach Copley * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 @@ -31,19 +34,22 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/api.php'; +require_once INSTALLDIR . '/lib/apiprivateauth.php'; /** - * List 20 newest members of the group specified by name or ID. + * List 20 newest members of the group specified by name or ID. * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ -class ApiGroupMembershipAction extends ApiAction +class ApiGroupMembershipAction extends ApiPrivateAuthAction { var $group = null; var $profiles = null; @@ -81,6 +87,11 @@ class ApiGroupMembershipAction extends ApiAction { parent::handle($args); + if (empty($this->group)) { + $this->clientError(_('Group not found.'), 404, $this->format); + return false; + } + // XXX: RSS and Atom switch($this->format) { @@ -92,7 +103,7 @@ class ApiGroupMembershipAction extends ApiAction break; default: $this->clientError( - _('API method not found!'), + _('API method not found.'), 404, $this->format ); @@ -103,7 +114,7 @@ class ApiGroupMembershipAction extends ApiAction /** * Fetch the members of a group * - * @return array $profiles list of profiles + * @return array $profiles list of profiles */ function getProfiles() @@ -112,10 +123,9 @@ class ApiGroupMembershipAction extends ApiAction $profile = $this->group->getMembers( ($this->page - 1) * $this->count, - $this->count, - $this->since_id, - $this->max_id, - $this->since + $this->count, + $this->since_id, + $this->max_id ); while ($profile->fetch()) { @@ -157,7 +167,7 @@ class ApiGroupMembershipAction extends ApiAction * An entity tag for this list of groups * * Returns an Etag based on the action name, language - * the group id, and timestamps of the first and last + * the group id, and timestamps of the first and last * user who has joined the group * * @return string etag