*
* @category API
* @package StatusNet
+ * @author Craig Andrews <candrews@integralblue.com>
+ * @author Evan Prodromou <evan@status.net>
* @author Zach Copley <zach@status.net>
* @copyright 2009 StatusNet, Inc.
+ * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
exit(1);
}
-require_once INSTALLDIR.'/lib/apiauth.php';
+require_once INSTALLDIR . '/lib/apiauth.php';
/**
* Un-favorites the status specified in the ID parameter as the authenticating user.
*
* @category API
* @package StatusNet
+ * @author Craig Andrews <candrews@integralblue.com>
+ * @author Evan Prodromou <evan@status.net>
* @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 ApiFavoriteDestroyAction extends ApiAuthAction
{
- var $format = null;
- var $user = null;
var $notice = null;
+
/**
* Take arguments for running
*
{
parent::prepare($args);
- if ($this->requiresAuth()) {
- if ($this->checkBasicAuthUser() == false) {
- return;
- }
- }
-
- $this->format = $this->arg('format');
$this->user = $this->auth_user;
$this->notice = Notice::staticGet($this->arg('id'));
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
+ // TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400,
$this->format
if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError(
- _('API method not found!'),
+ _('API method not found.'),
404,
$this->format
);
if (!$fave->find(true)) {
$this->clientError(
- _('That status is not a favorite!'),
+ _('That status is not a favorite.'),
403,
$this->favorite
);
$this->user->blowFavesCache();
if ($this->format == 'xml') {
- $this->show_single_xml_status($this->notice);
+ $this->showSingleXmlStatus($this->notice);
} elseif ($this->format == 'json') {
$this->show_single_json_status($this->notice);
}