X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapiaccountratelimitstatus.php;h=167a2dd6f55b9c7b0957f169ac27b24aeedfb8a1;hb=3326b7b850f538f0e3c2c7969c5e566e2a374ffb;hp=c7c0e7c00187bed6ffa4b2e6a00642a296d080bc;hpb=aa0d9a86152d2485de6de5ec572ae87085ebe780;p=quix0rs-gnu-social.git diff --git a/actions/apiaccountratelimitstatus.php b/actions/apiaccountratelimitstatus.php index c7c0e7c001..167a2dd6f5 100644 --- a/actions/apiaccountratelimitstatus.php +++ b/actions/apiaccountratelimitstatus.php @@ -21,22 +21,20 @@ * * @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 do not have a rate limit, but some clients check this method. + * We don't have a rate limit, but some clients check this method. * It always returns the same thing: 150 hits left. * * @category API @@ -47,10 +45,8 @@ require_once INSTALLDIR . '/lib/apibareauth.php'; * @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 { - /** * Handle the request * @@ -60,18 +56,17 @@ 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(); @@ -105,8 +100,20 @@ class ApiAccountRateLimitStatusAction extends ApiBareAuthAction print json_encode($out); } - $this->endDocument($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(array $args=array()) + { + return true; + } } -