*
* @category API
* @package StatusNet
+ * @author Brion Vibber <brion@pobox.com>
+ * @author Evan Prodromou <evan@status.net>
+ * @author Robin Millette <robin@millette.info>
+ * @author Siebrand Mazeland <s.mazeland@xs4all.nl>
* @author Zach Copley <zach@status.net>
* @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
exit(1);
}
-require_once INSTALLDIR.'/lib/apibareauth.php';
+require_once INSTALLDIR . '/lib/apibareauth.php';
/**
* 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 <evan@status.net>
+ * @author Robin Millette <robin@millette.info>
* @author Zach Copley <zach@status.net>
* @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
*
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
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
);
$reset = new DateTime();
$reset->modify('+1 hour');
- $this->init_document($this->format);
+ $this->initDocument($this->format);
if ($this->format == 'xml') {
$this->elementStart('hash');
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;
+ }
}
-