X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapiaccountratelimitstatus.php;h=592cf908fcf49d71dcfe896411361862b8180fe8;hb=3bddf01350d922ea2dea64a866216412ba467b75;hp=9eba5c55db3aad07ef5c9fa1a712eb785085328a;hpb=f746993c2bfb674d397cf095a2ab2ff7e757818b;p=quix0rs-gnu-social.git diff --git a/actions/apiaccountratelimitstatus.php b/actions/apiaccountratelimitstatus.php index 9eba5c55db..592cf908fc 100644 --- a/actions/apiaccountratelimitstatus.php +++ b/actions/apiaccountratelimitstatus.php @@ -21,53 +21,32 @@ * * @category API * @package StatusNet + * @author Brion Vibber + * @author Evan Prodromou + * @author Robin Millette + * @author Siebrand Mazeland * @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 * @link http://status.net/ */ -if (!defined('STATUSNET')) { - exit(1); -} - -require_once INSTALLDIR.'/lib/apibareauth.php'; +if (!defined('GNUSOCIAL')) { exit(1); } /** * We don't have a rate limit, but some clients check this method. - * It always returns the same thing: 100 hits left. + * It always returns the same thing: 150 hits left. * * @category API * @package StatusNet + * @author Evan Prodromou + * @author Robin Millette * @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 ApiAccountRateLimitStatusAction extends ApiBareAuthAction { - /** - * Take arguments for running - * - * @param array $args $_REQUEST args - * - * @return boolean success flag - * - */ - - function prepare($args) - { - parent::prepare($args); - - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return false; - } - } - - return true; - } - /** * Handle the request * @@ -77,24 +56,23 @@ class ApiAccountRateLimitStatusAction extends ApiBareAuthAction * * @return void */ - - function handle($args) + protected function handle() { - parent::handle($args); + parent::handle(); if (!in_array($this->format, array('xml', 'json'))) { $this->clientError( - _('API method not found!'), + // TRANS: Client error displayed when coming across a non-supported API method. + _('API method not found.'), 404, $this->format ); - return; } $reset = new DateTime(); $reset->modify('+1 hour'); - $this->init_document($this->format); + $this->initDocument($this->format); if ($this->format == 'xml') { $this->elementStart('hash'); @@ -122,8 +100,20 @@ class ApiAccountRateLimitStatusAction extends ApiBareAuthAction print json_encode($out); } - $this->end_document($this->format); + $this->endDocument($this->format); } + /** + * Return true if read only. + * + * MAY override + * + * @param array $args other arguments + * + * @return boolean is read only action? + */ + function isReadOnly($args) + { + return true; + } } -