X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapitimelinegroup.php;h=de13e7eb9871b95c3ed5d90b869aa236db08e200;hb=c899e4a84ee45b65950980ccb87e52129871d58e;hp=2a6f35d7281d2bf4fe0e90cc7abfe22987ca36c6;hpb=061af8fa06ccb98f667d1ee670da2dbb179d8b0e;p=quix0rs-gnu-social.git diff --git a/actions/apitimelinegroup.php b/actions/apitimelinegroup.php index 2a6f35d728..de13e7eb98 100644 --- a/actions/apitimelinegroup.php +++ b/actions/apitimelinegroup.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'; /** * Returns the most recent notices (default 20) posted to the group specified by 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 ApiTimelineGroupAction extends ApiAction +class ApiTimelineGroupAction extends ApiPrivateAuthAction { var $group = null; @@ -63,7 +69,6 @@ class ApiTimelineGroupAction extends ApiAction parent::prepare($args); $this->group = $this->getTargetGroup($this->arg('id')); - $this->notices = $this->getNotices(); return true; } @@ -81,6 +86,13 @@ class ApiTimelineGroupAction extends ApiAction function handle($args) { parent::handle($args); + + if (empty($this->group)) { + $this->clientError(_('Group not found!'), 404, $this->format); + return false; + } + + $this->notices = $this->getNotices(); $this->showTimeline(); }