X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapifriendshipsexists.php;h=ca62b5f51420b81009d766bdebb30e6fd17d359d;hb=72460091ddc6763cb8d62f9d865390ea4973dd44;hp=d1d5d520fcf058485660bbd3946d599867029ea3;hpb=bb08611def2309711f91c1ab6cdab92fb7c069b2;p=quix0rs-gnu-social.git diff --git a/actions/apifriendshipsexists.php b/actions/apifriendshipsexists.php index d1d5d520fc..ca62b5f514 100644 --- a/actions/apifriendshipsexists.php +++ b/actions/apifriendshipsexists.php @@ -21,6 +21,8 @@ * * @category API * @package StatusNet + * @author Dan Moore + * @author Evan Prodromou * @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,23 +33,23 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/api.php'; +require_once INSTALLDIR . '/lib/apiprivateauth.php'; /** - * Tests for the existence of friendship between two users. Will return true if + * Tests for the existence of friendship between two users. Will return true if * user_a follows user_b, otherwise will return false. * * @category API * @package StatusNet + * @author Dan Moore + * @author Evan Prodromou * @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 ApiFriendshipsExistsAction extends TwitterApiAction +class ApiFriendshipsExistsAction extends ApiPrivateAuthAction { - - var $format = null; var $user_a = null; var $user_b = null; @@ -64,21 +66,10 @@ class ApiFriendshipsExistsAction extends TwitterApiAction { parent::prepare($args); - $this->format = $this->arg('format'); - $user_a_id = $this->trimmed('user_a'); $user_b_id = $this->trimmed('user_b'); - common_debug("user_a = " . $user_a_id); - common_debug("user_b = " . $user_b_id); - - $this->user_a = $this->getTargetUser($user_a_id); - - if (empty($this->user_a)) { - common_debug('gargargra'); - } - $this->user_b = $this->getTargetUser($user_b_id); return true; @@ -111,18 +102,33 @@ class ApiFriendshipsExistsAction extends TwitterApiAction switch ($this->format) { case 'xml': - $this->init_document('xml'); + $this->initDocument('xml'); $this->element('friends', null, $result); - $this->end_document('xml'); + $this->endDocument('xml'); break; case 'json': - $this->init_document('json'); + $this->initDocument('json'); print json_encode($result); - $this->end_document('json'); + $this->endDocument('json'); break; default: break; } } + /** + * Return true if read only. + * + * MAY override + * + * @param array $args other arguments + * + * @return boolean is read only action? + */ + + function isReadOnly($args) + { + return true; + } + }