From 475bdf6fba3ee8081f3726f98ecd3a50fdda305e Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 5 Oct 2009 17:10:30 -0700 Subject: New actions for the account methods we have implemented --- actions/apiaccountverifycredentials.php | 104 ++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 actions/apiaccountverifycredentials.php (limited to 'actions/apiaccountverifycredentials.php') diff --git a/actions/apiaccountverifycredentials.php b/actions/apiaccountverifycredentials.php new file mode 100644 index 000000000..b9c9bf0f7 --- /dev/null +++ b/actions/apiaccountverifycredentials.php @@ -0,0 +1,104 @@ +. + * + * @category API + * @package StatusNet + * @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/apiauth.php'; + +/** + * Check a user's credentials. Returns an HTTP 200 OK response code and a + * representation of the requesting user if authentication was successful; + * returns a 401 status code and an error message if not. + * + * @category API + * @package StatusNet + * @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 ApiAccountVerifyCredentialsAction extends ApiAuthAction +{ + var $format = null; + + /** + * 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; + } + } + + $this->format = $this->arg('format'); + return true; + } + + /** + * Handle the request + * + * Check whether the credentials are valid and output the result + * + * @param array $args $_REQUEST data (unused) + * + * @return void + */ + + function handle($args) + { + parent::handle($args); + + switch ($this->format) { + case 'xml': + case 'json': + $args['id'] = $this->auth_user->id; + $action_obj = new ApiUserShowAction(); + $action_obj->prepare($args); + $action_obj->handle($args); + break; + default: + header('Content-Type: text/html; charset=utf-8'); + print 'Authorized'; + } + + } + +} -- cgit v1.2.3-54-g00ecf From f746993c2bfb674d397cf095a2ab2ff7e757818b Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 9 Oct 2009 14:42:01 -0700 Subject: $format is used by every API action. Set it in the base class. --- actions/apiaccountratelimitstatus.php | 3 --- actions/apiaccountverifycredentials.php | 3 --- actions/apiblockcreate.php | 2 -- actions/apiblockdestroy.php | 2 -- actions/apidirectmessage.php | 3 --- actions/apidirectmessagenew.php | 3 --- actions/apifavoritecreate.php | 3 --- actions/apifavoritedestroy.php | 3 +-- actions/apifriendshipscreate.php | 3 --- actions/apifriendshipsdestroy.php | 3 --- actions/apifriendshipsexists.php | 4 ---- actions/apifriendshipsshow.php | 4 ---- actions/apigroupshow.php | 2 -- actions/apihelptest.php | 2 -- actions/apistatusnetconfig.php | 3 --- actions/apistatusnetversion.php | 3 --- actions/apiusershow.php | 4 ---- lib/api.php | 2 ++ 18 files changed, 3 insertions(+), 49 deletions(-) (limited to 'actions/apiaccountverifycredentials.php') diff --git a/actions/apiaccountratelimitstatus.php b/actions/apiaccountratelimitstatus.php index 3c6c3e714..9eba5c55d 100644 --- a/actions/apiaccountratelimitstatus.php +++ b/actions/apiaccountratelimitstatus.php @@ -46,8 +46,6 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; class ApiAccountRateLimitStatusAction extends ApiBareAuthAction { - var $format = null; - /** * Take arguments for running * @@ -67,7 +65,6 @@ class ApiAccountRateLimitStatusAction extends ApiBareAuthAction } } - $this->format = $this->arg('format'); return true; } diff --git a/actions/apiaccountverifycredentials.php b/actions/apiaccountverifycredentials.php index b9c9bf0f7..0d4928f6c 100644 --- a/actions/apiaccountverifycredentials.php +++ b/actions/apiaccountverifycredentials.php @@ -47,8 +47,6 @@ require_once INSTALLDIR.'/lib/apiauth.php'; class ApiAccountVerifyCredentialsAction extends ApiAuthAction { - var $format = null; - /** * Take arguments for running * @@ -68,7 +66,6 @@ class ApiAccountVerifyCredentialsAction extends ApiAuthAction } } - $this->format = $this->arg('format'); return true; } diff --git a/actions/apiblockcreate.php b/actions/apiblockcreate.php index ff303863e..642171271 100644 --- a/actions/apiblockcreate.php +++ b/actions/apiblockcreate.php @@ -47,7 +47,6 @@ require_once INSTALLDIR . '/lib/apiauth.php'; class ApiBlockCreateAction extends ApiAuthAction { - var $format = null; var $user = null; var $other = null; @@ -72,7 +71,6 @@ class ApiBlockCreateAction extends ApiAuthAction $this->user = $this->auth_user; $this->other = $this->getTargetUser($this->arg('id')); - $this->format = $this->arg('format'); return true; } diff --git a/actions/apiblockdestroy.php b/actions/apiblockdestroy.php index 0f24be3aa..109e66ac4 100644 --- a/actions/apiblockdestroy.php +++ b/actions/apiblockdestroy.php @@ -46,7 +46,6 @@ require_once INSTALLDIR . '/lib/apiauth.php'; class ApiBlockDestroyAction extends ApiAuthAction { - var $format = null; var $user = null; var $other = null; @@ -71,7 +70,6 @@ class ApiBlockDestroyAction extends ApiAuthAction $this->user = $this->auth_user; $this->other = $this->getTargetUser($this->arg('id')); - $this->format = $this->arg('format'); return true; } diff --git a/actions/apidirectmessage.php b/actions/apidirectmessage.php index 87ae44d7a..fa6883311 100644 --- a/actions/apidirectmessage.php +++ b/actions/apidirectmessage.php @@ -45,7 +45,6 @@ require_once INSTALLDIR.'/lib/apiauth.php'; class ApiDirectMessageAction extends ApiAuthAction { - var $format = null; var $messages = null; var $page = null; var $count = null; @@ -122,8 +121,6 @@ class ApiDirectMessageAction extends ApiAuthAction $this->id = "tag:$taguribase:DirectMessages:" . $this->user->id; } - $this->format = $this->arg('format'); - $this->messages = $this->getMessages(); return true; diff --git a/actions/apidirectmessagenew.php b/actions/apidirectmessagenew.php index d836409ae..b531d7c5c 100644 --- a/actions/apidirectmessagenew.php +++ b/actions/apidirectmessagenew.php @@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/apiauth.php'; class ApiDirectMessageNewAction extends ApiAuthAction { - var $format = null; var $source = null; var $user = null; var $other = null; @@ -97,8 +96,6 @@ class ApiDirectMessageNewAction extends ApiAuthAction $this->other = $this->getTargetUser($user_param); } - $this->format = $this->arg('format'); - return true; } diff --git a/actions/apifavoritecreate.php b/actions/apifavoritecreate.php index e45603c6a..6ee6960ba 100644 --- a/actions/apifavoritecreate.php +++ b/actions/apifavoritecreate.php @@ -46,8 +46,6 @@ require_once INSTALLDIR.'/lib/apiauth.php'; class ApiFavoriteCreateAction extends ApiAuthAction { - - var $format = null; var $user = null; var $notice = null; @@ -70,7 +68,6 @@ class ApiFavoriteCreateAction extends ApiAuthAction } } - $this->format = $this->arg('format'); $this->user = $this->auth_user; $this->notice = Notice::staticGet($this->arg('id')); diff --git a/actions/apifavoritedestroy.php b/actions/apifavoritedestroy.php index a70d5c79b..36946fbfb 100644 --- a/actions/apifavoritedestroy.php +++ b/actions/apifavoritedestroy.php @@ -47,9 +47,9 @@ require_once INSTALLDIR.'/lib/apiauth.php'; class ApiFavoriteDestroyAction extends ApiAuthAction { - var $format = null; var $user = null; var $notice = null; + /** * Take arguments for running * @@ -69,7 +69,6 @@ class ApiFavoriteDestroyAction extends ApiAuthAction } } - $this->format = $this->arg('format'); $this->user = $this->auth_user; $this->notice = Notice::staticGet($this->arg('id')); diff --git a/actions/apifriendshipscreate.php b/actions/apifriendshipscreate.php index 969fc1282..27bdbe062 100644 --- a/actions/apifriendshipscreate.php +++ b/actions/apifriendshipscreate.php @@ -47,8 +47,6 @@ require_once INSTALLDIR.'/lib/apiauth.php'; class ApiFriendshipsCreateAction extends ApiAuthAction { - - var $format = null; var $user = null; var $other = null; @@ -71,7 +69,6 @@ class ApiFriendshipsCreateAction extends ApiAuthAction } } - $this->format = $this->arg('format'); $this->user = $this->auth_user; $this->other = $this->getTargetUser($id); diff --git a/actions/apifriendshipsdestroy.php b/actions/apifriendshipsdestroy.php index ef864c4db..3ad12156d 100644 --- a/actions/apifriendshipsdestroy.php +++ b/actions/apifriendshipsdestroy.php @@ -47,8 +47,6 @@ require_once INSTALLDIR.'/lib/apiauth.php'; class ApiFriendshipsDestroyAction extends ApiAuthAction { - - var $format = null; var $user = null; var $other = null; @@ -71,7 +69,6 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction } } - $this->format = $this->arg('format'); $this->user = $this->auth_user; $this->other = $this->getTargetUser($id); diff --git a/actions/apifriendshipsexists.php b/actions/apifriendshipsexists.php index d1d5d520f..1ebfc9e8f 100644 --- a/actions/apifriendshipsexists.php +++ b/actions/apifriendshipsexists.php @@ -46,8 +46,6 @@ require_once INSTALLDIR.'/lib/api.php'; class ApiFriendshipsExistsAction extends TwitterApiAction { - - var $format = null; var $user_a = null; var $user_b = null; @@ -64,8 +62,6 @@ 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'); diff --git a/actions/apifriendshipsshow.php b/actions/apifriendshipsshow.php index d35825a43..2f975b121 100644 --- a/actions/apifriendshipsshow.php +++ b/actions/apifriendshipsshow.php @@ -45,8 +45,6 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; class ApiFriendshipsShowAction extends ApiBareAuthAction { - - var $format = null; var $user = null; var $source = null; var $target = null; @@ -70,8 +68,6 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction } } - $this->format = $this->arg('format'); - $source_id = (int)$this->trimmed('source_id'); $source_screen_name = $this->trimmed('source_screen_name'); $target_id = (int)$this->trimmed('target_id'); diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php index a38d50afe..cdaf707aa 100644 --- a/actions/apigroupshow.php +++ b/actions/apigroupshow.php @@ -45,7 +45,6 @@ require_once INSTALLDIR.'/lib/api.php'; class ApiGroupShowAction extends TwitterApiAction { - var $format = null; var $group = null; /** @@ -61,7 +60,6 @@ class ApiGroupShowAction extends TwitterApiAction { parent::prepare($args); - $this->format = $this->arg('format'); $this->group = $this->getTargetGroup($this->arg('id')); return true; diff --git a/actions/apihelptest.php b/actions/apihelptest.php index 2cec46462..ac1bb1a5b 100644 --- a/actions/apihelptest.php +++ b/actions/apihelptest.php @@ -45,7 +45,6 @@ require_once INSTALLDIR . '/lib/api.php'; class ApiHelpTestAction extends TwitterApiAction { - var $format = null; /** * Take arguments for running @@ -59,7 +58,6 @@ class ApiHelpTestAction extends TwitterApiAction function prepare($args) { parent::prepare($args); - $this->format = $this->arg('format'); return true; } diff --git a/actions/apistatusnetconfig.php b/actions/apistatusnetconfig.php index 6847a48fe..6fb65331f 100644 --- a/actions/apistatusnetconfig.php +++ b/actions/apistatusnetconfig.php @@ -49,8 +49,6 @@ require_once INSTALLDIR . '/lib/api.php'; class ApiStatusnetConfigAction extends TwitterApiAction { - var $format = null; - var $keys = array( 'site' => array('name', 'server', 'theme', 'path', 'fancy', 'language', 'email', 'broughtby', 'broughtbyurl', 'closed', @@ -73,7 +71,6 @@ class ApiStatusnetConfigAction extends TwitterApiAction function prepare($args) { parent::prepare($args); - $this->format = $this->arg('format'); return true; } diff --git a/actions/apistatusnetversion.php b/actions/apistatusnetversion.php index e6f35e7d2..2cd99edb7 100644 --- a/actions/apistatusnetversion.php +++ b/actions/apistatusnetversion.php @@ -48,8 +48,6 @@ require_once INSTALLDIR . '/lib/api.php'; class ApiStatusnetVersionAction extends TwitterApiAction { - var $format = null; - /** * Take arguments for running * @@ -62,7 +60,6 @@ class ApiStatusnetVersionAction extends TwitterApiAction function prepare($args) { parent::prepare($args); - $this->format = $this->arg('format'); return true; } diff --git a/actions/apiusershow.php b/actions/apiusershow.php index afcbd3618..1cd0cdfd5 100644 --- a/actions/apiusershow.php +++ b/actions/apiusershow.php @@ -46,8 +46,6 @@ require_once INSTALLDIR.'/lib/api.php'; class ApiUserShowAction extends TwitterApiAction { - - var $format = null; var $user = null; /** @@ -63,8 +61,6 @@ class ApiUserShowAction extends TwitterApiAction { parent::prepare($args); - $this->format = $this->arg('format'); - $email = $this->arg('email'); // XXX: email field deprecated in Twitter's API diff --git a/lib/api.php b/lib/api.php index 93b4a7513..fb51d5260 100644 --- a/lib/api.php +++ b/lib/api.php @@ -43,6 +43,7 @@ if (!defined('STATUSNET')) { class ApiAction extends Action { + var $format = null; /** * Initialization. @@ -55,6 +56,7 @@ class ApiAction extends Action function prepare($args) { parent::prepare($args); + $this->format = $this->arg('format'); return true; } -- cgit v1.2.3-54-g00ecf From 743c844084bae75db02570d76694f4e9b79a9aa9 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 9 Oct 2009 16:57:22 -0700 Subject: Move all basic auth output and processing to base classes --- actions/apiaccountratelimitstatus.php | 21 --------------------- actions/apiaccountverifycredentials.php | 21 --------------------- actions/apiblockcreate.php | 6 ------ actions/apiblockdestroy.php | 6 ------ actions/apidirectmessage.php | 6 ------ actions/apidirectmessagenew.php | 6 ------ actions/apifavoritecreate.php | 6 ------ actions/apifavoritedestroy.php | 6 ------ actions/apifriendshipscreate.php | 6 ------ actions/apifriendshipsdestroy.php | 6 ------ actions/apifriendshipsshow.php | 6 ------ actions/apigroupismember.php | 6 ------ actions/apigroupjoin.php | 6 ------ actions/apigroupleave.php | 6 ------ actions/apigrouplist.php | 6 ------ actions/apistatusesdestroy.php | 6 ------ actions/apistatusesupdate.php | 6 ------ actions/apisubscriptions.php | 6 ------ actions/apitimelinefavorites.php | 6 ------ actions/apitimelinefriends.php | 6 ------ actions/apitimelinementions.php | 6 ------ actions/apitimelineuser.php | 6 ------ lib/apiauth.php | 24 ++++++++++++++++++++++-- lib/apibareauth.php | 16 ++++++++++++++++ 24 files changed, 38 insertions(+), 164 deletions(-) (limited to 'actions/apiaccountverifycredentials.php') diff --git a/actions/apiaccountratelimitstatus.php b/actions/apiaccountratelimitstatus.php index 9eba5c55d..b823e1cd2 100644 --- a/actions/apiaccountratelimitstatus.php +++ b/actions/apiaccountratelimitstatus.php @@ -46,27 +46,6 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; 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 diff --git a/actions/apiaccountverifycredentials.php b/actions/apiaccountverifycredentials.php index 0d4928f6c..104b9867f 100644 --- a/actions/apiaccountverifycredentials.php +++ b/actions/apiaccountverifycredentials.php @@ -47,27 +47,6 @@ require_once INSTALLDIR.'/lib/apiauth.php'; class ApiAccountVerifyCredentialsAction extends ApiAuthAction { - /** - * 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 diff --git a/actions/apiblockcreate.php b/actions/apiblockcreate.php index 642171271..6dd28dd5e 100644 --- a/actions/apiblockcreate.php +++ b/actions/apiblockcreate.php @@ -63,12 +63,6 @@ class ApiBlockCreateAction extends ApiAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->auth_user; $this->other = $this->getTargetUser($this->arg('id')); diff --git a/actions/apiblockdestroy.php b/actions/apiblockdestroy.php index 109e66ac4..a869dfe46 100644 --- a/actions/apiblockdestroy.php +++ b/actions/apiblockdestroy.php @@ -62,12 +62,6 @@ class ApiBlockDestroyAction extends ApiAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->auth_user; $this->other = $this->getTargetUser($this->arg('id')); diff --git a/actions/apidirectmessage.php b/actions/apidirectmessage.php index fa6883311..cede4c072 100644 --- a/actions/apidirectmessage.php +++ b/actions/apidirectmessage.php @@ -70,12 +70,6 @@ class ApiDirectMessageAction extends ApiAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->auth_user; if (empty($this->user)) { diff --git a/actions/apidirectmessagenew.php b/actions/apidirectmessagenew.php index b531d7c5c..6984c8d10 100644 --- a/actions/apidirectmessagenew.php +++ b/actions/apidirectmessagenew.php @@ -64,12 +64,6 @@ class ApiDirectMessageNewAction extends ApiAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->auth_user; if (empty($this->user)) { diff --git a/actions/apifavoritecreate.php b/actions/apifavoritecreate.php index 6ee6960ba..db001561e 100644 --- a/actions/apifavoritecreate.php +++ b/actions/apifavoritecreate.php @@ -62,12 +62,6 @@ class ApiFavoriteCreateAction extends ApiAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->auth_user; $this->notice = Notice::staticGet($this->arg('id')); diff --git a/actions/apifavoritedestroy.php b/actions/apifavoritedestroy.php index 36946fbfb..3640459f9 100644 --- a/actions/apifavoritedestroy.php +++ b/actions/apifavoritedestroy.php @@ -63,12 +63,6 @@ class ApiFavoriteDestroyAction extends ApiAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->auth_user; $this->notice = Notice::staticGet($this->arg('id')); diff --git a/actions/apifriendshipscreate.php b/actions/apifriendshipscreate.php index 27bdbe062..85eaf3a29 100644 --- a/actions/apifriendshipscreate.php +++ b/actions/apifriendshipscreate.php @@ -63,12 +63,6 @@ class ApiFriendshipsCreateAction extends ApiAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->auth_user; $this->other = $this->getTargetUser($id); diff --git a/actions/apifriendshipsdestroy.php b/actions/apifriendshipsdestroy.php index 3ad12156d..274378051 100644 --- a/actions/apifriendshipsdestroy.php +++ b/actions/apifriendshipsdestroy.php @@ -63,12 +63,6 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->auth_user; $this->other = $this->getTargetUser($id); diff --git a/actions/apifriendshipsshow.php b/actions/apifriendshipsshow.php index 2f975b121..0ae6a7b82 100644 --- a/actions/apifriendshipsshow.php +++ b/actions/apifriendshipsshow.php @@ -62,12 +62,6 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $source_id = (int)$this->trimmed('source_id'); $source_screen_name = $this->trimmed('source_screen_name'); $target_id = (int)$this->trimmed('target_id'); diff --git a/actions/apigroupismember.php b/actions/apigroupismember.php index facc58174..02079b6ff 100644 --- a/actions/apigroupismember.php +++ b/actions/apigroupismember.php @@ -62,12 +62,6 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->getTargetUser(null); $this->group = $this->getTargetGroup(null); $this->format = $this->arg('format'); diff --git a/actions/apigroupjoin.php b/actions/apigroupjoin.php index c00d59463..7ab1b7272 100644 --- a/actions/apigroupjoin.php +++ b/actions/apigroupjoin.php @@ -62,12 +62,6 @@ class ApiGroupJoinAction extends ApiAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->auth_user; $this->group = $this->getTargetGroup($this->arg('id')); diff --git a/actions/apigroupleave.php b/actions/apigroupleave.php index 568b04b7c..86b56f5af 100644 --- a/actions/apigroupleave.php +++ b/actions/apigroupleave.php @@ -62,12 +62,6 @@ class ApiGroupLeaveAction extends ApiAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->auth_user; $this->group = $this->getTargetGroup($this->arg('id')); diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php index 84b7fc1c8..69c347de1 100644 --- a/actions/apigrouplist.php +++ b/actions/apigrouplist.php @@ -67,12 +67,6 @@ class ApiGroupListAction extends ApiBareAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->page = (int)$this->arg('page', 1); $this->count = (int)$this->arg('count', 20); $this->max_id = (int)$this->arg('max_id', 0); diff --git a/actions/apistatusesdestroy.php b/actions/apistatusesdestroy.php index ae0f4c453..16a7cc376 100644 --- a/actions/apistatusesdestroy.php +++ b/actions/apistatusesdestroy.php @@ -63,12 +63,6 @@ class ApiStatusesDestroyAction extends ApiAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return false; - } - } - $this->user = $this->auth_user; $this->notice_id = (int)$this->trimmed('id'); diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php index fb1278559..ab33d8a3e 100644 --- a/actions/apistatusesupdate.php +++ b/actions/apistatusesupdate.php @@ -67,12 +67,6 @@ class ApiStatusesUpdateAction extends ApiAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return false; - } - } - $this->user = $this->auth_user; if (empty($this->user)) { diff --git a/actions/apisubscriptions.php b/actions/apisubscriptions.php index 78dcd722d..bdaa0ea39 100644 --- a/actions/apisubscriptions.php +++ b/actions/apisubscriptions.php @@ -84,12 +84,6 @@ class ApiSubscriptionsAction extends ApiBareAuthAction $this->count = isset($this->ids_only) ? 5000 : (int)$this->arg('count', 100); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return false; - } - } - $this->user = $this->getTargetUser($this->arg('id')); if (empty($this->user)) { diff --git a/actions/apitimelinefavorites.php b/actions/apitimelinefavorites.php index 9ccee5cfa..35a996c9c 100644 --- a/actions/apitimelinefavorites.php +++ b/actions/apitimelinefavorites.php @@ -69,12 +69,6 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction { parent::prepare($args); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->page = (int)$this->arg('page', 1); $this->count = (int)$this->arg('count', 20); $this->max_id = (int)$this->arg('max_id', 0); diff --git a/actions/apitimelinefriends.php b/actions/apitimelinefriends.php index 65bbb5a74..92a885293 100644 --- a/actions/apitimelinefriends.php +++ b/actions/apitimelinefriends.php @@ -75,12 +75,6 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction $this->since = $this->arg('since'); $this->format = $this->arg('format'); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->getTargetUser($this->arg('id')); if (empty($this->user)) { diff --git a/actions/apitimelinementions.php b/actions/apitimelinementions.php index 93c6da307..ecead98cc 100644 --- a/actions/apitimelinementions.php +++ b/actions/apitimelinementions.php @@ -68,12 +68,6 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction $this->since_id = (int)$this->arg('since_id', 0); $this->since = $this->arg('since'); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->getTargetUser($this->arg('id')); if (empty($this->user)) { diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php index c4d02bc62..d50648d7c 100644 --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@ -70,12 +70,6 @@ class ApiTimelineUserAction extends ApiBareAuthAction $this->since_id = (int)$this->arg('since_id', 0); $this->since = $this->arg('since'); - if ($this->requiresAuth()) { - if ($this->checkBasicAuthUser() == false) { - return; - } - } - $this->user = $this->getTargetUser($this->arg('id')); if (empty($this->user)) { diff --git a/lib/apiauth.php b/lib/apiauth.php index d7f8017eb..9fc0e5712 100644 --- a/lib/apiauth.php +++ b/lib/apiauth.php @@ -48,6 +48,26 @@ class ApiAuthAction extends ApiAction var $auth_user = null; + /** + * Take arguments for running, and output basic auth header if needed + * + * @param array $args $_REQUEST args + * + * @return boolean success flag + * + */ + + function prepare($args) + { + parent::prepare($args); + + if ($this->requiresAuth()) { + $this->checkBasicAuthUser(); + } + + return true; + } + /** * Does this API resource require authentication? * @@ -76,7 +96,7 @@ class ApiAuthAction extends ApiAction // show error if the user clicks 'cancel' $this->showBasicAuthError(); - return false; + exit; } else { $nickname = $this->auth_user; @@ -94,7 +114,7 @@ class ApiAuthAction extends ApiAction "$nickname, proxy = $proxy, ip = $ip." ); $this->showBasicAuthError(); - return false; + exit; } } return true; diff --git a/lib/apibareauth.php b/lib/apibareauth.php index a99d450ec..0ae477f46 100644 --- a/lib/apibareauth.php +++ b/lib/apibareauth.php @@ -48,6 +48,22 @@ require_once INSTALLDIR.'/lib/apiauth.php'; class ApiBareAuthAction extends ApiAuthAction { + + /** + * Take arguments for running + * + * @param array $args $_REQUEST args + * + * @return boolean success flag + * + */ + + function prepare($args) + { + parent::prepare($args); + return true; + } + /** * Does this API resource require authentication? * -- cgit v1.2.3-54-g00ecf From 57dfad64beae100187dcaf3c205645e89611e115 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 9 Oct 2009 17:21:22 -0700 Subject: Missed some of the references to the old TwitterApiAction - removed --- actions/apiaccountverifycredentials.php | 5 +++-- actions/apifriendshipsexists.php | 2 +- actions/apigrouplistall.php | 2 +- actions/apigroupmembership.php | 2 +- actions/apigroupshow.php | 2 +- actions/apihelptest.php | 2 +- actions/apistatusnetconfig.php | 2 +- actions/apistatusnetversion.php | 2 +- actions/apiusershow.php | 2 +- plugins/Realtime/RealtimePlugin.php | 4 ++-- 10 files changed, 13 insertions(+), 12 deletions(-) (limited to 'actions/apiaccountverifycredentials.php') diff --git a/actions/apiaccountverifycredentials.php b/actions/apiaccountverifycredentials.php index 104b9867f..8b976bbf3 100644 --- a/actions/apiaccountverifycredentials.php +++ b/actions/apiaccountverifycredentials.php @@ -67,8 +67,9 @@ class ApiAccountVerifyCredentialsAction extends ApiAuthAction case 'json': $args['id'] = $this->auth_user->id; $action_obj = new ApiUserShowAction(); - $action_obj->prepare($args); - $action_obj->handle($args); + if ($action_obj->prepare($args)) { + $action_obj->handle($args); + } break; default: header('Content-Type: text/html; charset=utf-8'); diff --git a/actions/apifriendshipsexists.php b/actions/apifriendshipsexists.php index 1ebfc9e8f..df9f0c949 100644 --- a/actions/apifriendshipsexists.php +++ b/actions/apifriendshipsexists.php @@ -44,7 +44,7 @@ require_once INSTALLDIR.'/lib/api.php'; * @link http://status.net/ */ -class ApiFriendshipsExistsAction extends TwitterApiAction +class ApiFriendshipsExistsAction extends ApiAction { var $user_a = null; var $user_b = null; diff --git a/actions/apigrouplistall.php b/actions/apigrouplistall.php index a0f04ed76..070927b1e 100644 --- a/actions/apigrouplistall.php +++ b/actions/apigrouplistall.php @@ -43,7 +43,7 @@ require_once INSTALLDIR . '/lib/api.php'; * @link http://status.net/ */ -class ApiGroupListAllAction extends TwitterApiAction +class ApiGroupListAllAction extends ApiAction { var $page = null; var $count = null; diff --git a/actions/apigroupmembership.php b/actions/apigroupmembership.php index da510ff26..0e9510d71 100644 --- a/actions/apigroupmembership.php +++ b/actions/apigroupmembership.php @@ -43,7 +43,7 @@ require_once INSTALLDIR . '/lib/api.php'; * @link http://status.net/ */ -class ApiGroupMembershipAction extends TwitterApiAction +class ApiGroupMembershipAction extends ApiAction { var $page = null; var $count = null; diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php index cdaf707aa..262fe6718 100644 --- a/actions/apigroupshow.php +++ b/actions/apigroupshow.php @@ -43,7 +43,7 @@ require_once INSTALLDIR.'/lib/api.php'; * @link http://status.net/ */ -class ApiGroupShowAction extends TwitterApiAction +class ApiGroupShowAction extends ApiAction { var $group = null; diff --git a/actions/apihelptest.php b/actions/apihelptest.php index ac1bb1a5b..cd5b86cf9 100644 --- a/actions/apihelptest.php +++ b/actions/apihelptest.php @@ -43,7 +43,7 @@ require_once INSTALLDIR . '/lib/api.php'; * @link http://status.net/ */ -class ApiHelpTestAction extends TwitterApiAction +class ApiHelpTestAction extends ApiAction { /** diff --git a/actions/apistatusnetconfig.php b/actions/apistatusnetconfig.php index 6fb65331f..356942a85 100644 --- a/actions/apistatusnetconfig.php +++ b/actions/apistatusnetconfig.php @@ -47,7 +47,7 @@ require_once INSTALLDIR . '/lib/api.php'; * @link http://status.net/ */ -class ApiStatusnetConfigAction extends TwitterApiAction +class ApiStatusnetConfigAction extends ApiAction { var $keys = array( 'site' => array('name', 'server', 'theme', 'path', 'fancy', 'language', diff --git a/actions/apistatusnetversion.php b/actions/apistatusnetversion.php index 2cd99edb7..fb632fd93 100644 --- a/actions/apistatusnetversion.php +++ b/actions/apistatusnetversion.php @@ -46,7 +46,7 @@ require_once INSTALLDIR . '/lib/api.php'; * @link http://status.net/ */ -class ApiStatusnetVersionAction extends TwitterApiAction +class ApiStatusnetVersionAction extends ApiAction { /** * Take arguments for running diff --git a/actions/apiusershow.php b/actions/apiusershow.php index 1cd0cdfd5..442efc194 100644 --- a/actions/apiusershow.php +++ b/actions/apiusershow.php @@ -44,7 +44,7 @@ require_once INSTALLDIR.'/lib/api.php'; * @link http://status.net/ */ -class ApiUserShowAction extends TwitterApiAction +class ApiUserShowAction extends ApiAction { var $user = null; diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 31e75221b..9a750bbc8 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -240,11 +240,11 @@ class RealtimePlugin extends Plugin // FIXME: this code should be abstracted to a neutral third // party, like Notice::asJson(). I'm not sure of the ethics // of refactoring from within a plugin, so I'm just abusing - // the TwitterApiAction method. Don't do this unless you're me! + // the ApiAction method. Don't do this unless you're me! require_once(INSTALLDIR.'/lib/api.php'); - $act = new TwitterApiAction('/dev/null'); + $act = new ApiAction('/dev/null'); $arr = $act->twitter_status_array($notice, true); $arr['url'] = $notice->bestUrl(); -- cgit v1.2.3-54-g00ecf From 870b091693531ba9aca20a0b0fa64ec326d72725 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 12 Oct 2009 16:36:00 -0700 Subject: Added in credits. --- actions/apiaccountratelimitstatus.php | 8 ++++++-- actions/apiaccountverifycredentials.php | 6 +++++- actions/apiblockcreate.php | 15 ++++++++------- actions/apiblockdestroy.php | 3 ++- actions/apidirectmessage.php | 8 +++++++- actions/apidirectmessagenew.php | 11 ++++++++--- actions/apifavoritecreate.php | 6 +++++- actions/apifavoritedestroy.php | 6 +++++- actions/apifriendshipscreate.php | 6 +++++- actions/apifriendshipsdestroy.php | 6 +++++- actions/apifriendshipsexists.php | 8 ++++++-- actions/apifriendshipsshow.php | 18 +++++++++++------- actions/apigroupcreate.php | 5 +++++ actions/apigroupismember.php | 7 ++++++- actions/apigroupjoin.php | 7 ++++++- actions/apigroupleave.php | 11 ++++++++--- actions/apigrouplist.php | 8 +++++++- actions/apigrouplistall.php | 6 ++++++ actions/apigroupmembership.php | 18 ++++++++++++------ actions/apigroupshow.php | 8 +++++++- actions/apihelptest.php | 2 ++ actions/apistatusesdestroy.php | 16 +++++++++++++--- actions/apistatusesshow.php | 14 +++++++++++++- actions/apistatusesupdate.php | 16 +++++++++++++--- actions/apistatusnetconfig.php | 2 ++ actions/apistatusnetversion.php | 6 ++++-- actions/apisubscriptions.php | 6 +++++- actions/apitimelinefavorites.php | 7 +++++-- actions/apitimelinefriends.php | 14 +++++++++++++- actions/apitimelinegroup.php | 6 ++++++ actions/apitimelinementions.php | 15 +++++++++++++-- actions/apitimelinepublic.php | 14 +++++++++++++- actions/apitimelinetag.php | 8 +++++++- actions/apitimelineuser.php | 15 +++++++++++++-- actions/apiuserfollowers.php | 6 +++++- actions/apiuserfriends.php | 6 +++++- actions/apiusershow.php | 8 +++++++- lib/api.php | 10 ++++++++++ lib/apiauth.php | 9 ++++++++- lib/apibareauth.php | 16 +++++++++++++++- lib/twitterbasicauthclient.php | 10 ++++++++-- 41 files changed, 310 insertions(+), 67 deletions(-) (limited to 'actions/apiaccountverifycredentials.php') diff --git a/actions/apiaccountratelimitstatus.php b/actions/apiaccountratelimitstatus.php index af86dae6a..96179f175 100644 --- a/actions/apiaccountratelimitstatus.php +++ b/actions/apiaccountratelimitstatus.php @@ -21,6 +21,8 @@ * * @category API * @package StatusNet + * @author Evan Prodromou + * @author Robin Millette * @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,14 +33,16 @@ if (!defined('STATUSNET')) { 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 + * @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/ diff --git a/actions/apiaccountverifycredentials.php b/actions/apiaccountverifycredentials.php index 8b976bbf3..08b201dbf 100644 --- a/actions/apiaccountverifycredentials.php +++ b/actions/apiaccountverifycredentials.php @@ -21,6 +21,8 @@ * * @category API * @package StatusNet + * @author Evan Prodromou + * @author Robin Millette * @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,7 +33,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apiauth.php'; +require_once INSTALLDIR . '/lib/apiauth.php'; /** * Check a user's credentials. Returns an HTTP 200 OK response code and a @@ -40,6 +42,8 @@ require_once INSTALLDIR.'/lib/apiauth.php'; * * @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/ diff --git a/actions/apiblockcreate.php b/actions/apiblockcreate.php index e003e5ee9..1cab2df5d 100644 --- a/actions/apiblockcreate.php +++ b/actions/apiblockcreate.php @@ -21,6 +21,7 @@ * * @category API * @package StatusNet + * @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 @@ -34,12 +35,13 @@ if (!defined('STATUSNET')) { require_once INSTALLDIR . '/lib/apiauth.php'; /** - * Blocks the user specified in the ID parameter as the authenticating user. - * Destroys a friendship to the blocked user if it exists. Returns the + * Blocks the user specified in the ID parameter as the authenticating user. + * Destroys a friendship to the blocked user if it exists. Returns the * blocked user in the requested format when successful. * * @category API * @package StatusNet + * @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/ @@ -47,7 +49,6 @@ require_once INSTALLDIR . '/lib/apiauth.php'; class ApiBlockCreateAction extends ApiAuthAction { - var $user = null; var $other = null; /** @@ -91,13 +92,13 @@ class ApiBlockCreateAction extends ApiAuthAction ); return; } - + if (empty($this->user) || empty($this->other)) { $this->clientError(_('No such user!'), 404, $this->format); return; } - - if ($this->user->hasBlocked($this->other) + + if ($this->user->hasBlocked($this->other) || $this->user->block($this->other) ) { $this->initDocument($this->format); @@ -106,7 +107,7 @@ class ApiBlockCreateAction extends ApiAuthAction } else { $this->serverError(_('Block user failed.'), 500, $this->format); } - + } } diff --git a/actions/apiblockdestroy.php b/actions/apiblockdestroy.php index 470b60ea5..16dbf94ca 100644 --- a/actions/apiblockdestroy.php +++ b/actions/apiblockdestroy.php @@ -21,6 +21,7 @@ * * @category API * @package StatusNet + * @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 @@ -39,6 +40,7 @@ require_once INSTALLDIR . '/lib/apiauth.php'; * * @category API * @package StatusNet + * @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/ @@ -46,7 +48,6 @@ require_once INSTALLDIR . '/lib/apiauth.php'; class ApiBlockDestroyAction extends ApiAuthAction { - var $user = null; var $other = null; /** diff --git a/actions/apidirectmessage.php b/actions/apidirectmessage.php index 4e55886d9..a21fe86d2 100644 --- a/actions/apidirectmessage.php +++ b/actions/apidirectmessage.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Adrian Lang + * @author Evan Prodromou + * @author Robin Millette * @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,13 +34,16 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apiauth.php'; +require_once INSTALLDIR . '/lib/apiauth.php'; /** * Show a list of direct messages from or to the authenticating user * * @category API * @package StatusNet + * @author Adrian Lang + * @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/ diff --git a/actions/apidirectmessagenew.php b/actions/apidirectmessagenew.php index 6984c8d10..fa6cafbe8 100644 --- a/actions/apidirectmessagenew.php +++ b/actions/apidirectmessagenew.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Adrian Lang + * @author Evan Prodromou + * @author Robin Millette * @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,7 +34,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apiauth.php'; +require_once INSTALLDIR . '/lib/apiauth.php'; /** * Creates a new direct message from the authenticating user to @@ -39,6 +42,9 @@ require_once INSTALLDIR.'/lib/apiauth.php'; * * @category API * @package StatusNet + * @author Adrian Lang + * @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/ @@ -47,7 +53,6 @@ require_once INSTALLDIR.'/lib/apiauth.php'; class ApiDirectMessageNewAction extends ApiAuthAction { var $source = null; - var $user = null; var $other = null; var $content = null; @@ -151,7 +156,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction // Note: sending msgs to yourself is allowed by Twitter - $errmsg = 'Don\'t send a message to yourself; ' . + $errmsg = 'Don\'t send a message to yourself; ' . 'just say it to yourself quietly instead.' $this->clientError(_($errmsg), 403, $this->format); diff --git a/actions/apifavoritecreate.php b/actions/apifavoritecreate.php index 2a185f607..a80a6492e 100644 --- a/actions/apifavoritecreate.php +++ b/actions/apifavoritecreate.php @@ -21,6 +21,8 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @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,7 +33,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apiauth.php'; +require_once INSTALLDIR . '/lib/apiauth.php'; /** * Favorites the status specified in the ID parameter as the authenticating user. @@ -39,6 +41,8 @@ require_once INSTALLDIR.'/lib/apiauth.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @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/ diff --git a/actions/apifavoritedestroy.php b/actions/apifavoritedestroy.php index f954a5076..f131d1c7f 100644 --- a/actions/apifavoritedestroy.php +++ b/actions/apifavoritedestroy.php @@ -21,6 +21,8 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @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,7 +33,7 @@ if (!defined('STATUSNET')) { 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. @@ -39,6 +41,8 @@ require_once INSTALLDIR.'/lib/apiauth.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @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/ diff --git a/actions/apifriendshipscreate.php b/actions/apifriendshipscreate.php index fe4e9e9a2..a824e734b 100644 --- a/actions/apifriendshipscreate.php +++ b/actions/apifriendshipscreate.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,7 +33,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apiauth.php'; +require_once INSTALLDIR . '/lib/apiauth.php'; /** * Allows the authenticating users to follow (subscribe) the user specified in @@ -40,6 +42,8 @@ require_once INSTALLDIR.'/lib/apiauth.php'; * * @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/ diff --git a/actions/apifriendshipsdestroy.php b/actions/apifriendshipsdestroy.php index f0f6c062b..3d9b7e001 100644 --- a/actions/apifriendshipsdestroy.php +++ b/actions/apifriendshipsdestroy.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,7 +33,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apiauth.php'; +require_once INSTALLDIR . '/lib/apiauth.php'; /** * Allows the authenticating users to unfollow (unsubscribe) the user specified in @@ -40,6 +42,8 @@ require_once INSTALLDIR.'/lib/apiauth.php'; * * @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/ diff --git a/actions/apifriendshipsexists.php b/actions/apifriendshipsexists.php index 93be5f84e..ae50c512c 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,14 +33,16 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/api.php'; +require_once INSTALLDIR . '/lib/api.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/ diff --git a/actions/apifriendshipsshow.php b/actions/apifriendshipsshow.php index c5aed238f..8fc436738 100644 --- a/actions/apifriendshipsshow.php +++ b/actions/apifriendshipsshow.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,13 +33,15 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apibareauth.php'; +require_once INSTALLDIR . '/lib/apibareauth.php'; /** * Outputs detailed information about the relationship between two users * * @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/ @@ -65,7 +69,7 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction $source_screen_name = $this->trimmed('source_screen_name'); $target_id = (int)$this->trimmed('target_id'); $target_screen_name = $this->trimmed('target_screen_name'); - + if (!empty($source_id)) { $this->source = User::staticGet($source_id); } elseif (!empty($source_screen_name)) { @@ -90,7 +94,7 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction * * @return boolean true or false */ - + function requiresAuth() { if (common_config('site', 'private')) { @@ -125,7 +129,7 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction $this->clientError(_('API method not found!'), 404); return; } - + if (empty($this->source)) { $this->clientError( _('Could not determine source user.'), @@ -133,7 +137,7 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction ); return; } - + if (empty($this->target)) { $this->clientError( _('Could not find target user.'), @@ -141,7 +145,7 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction ); return; } - + $result = $this->twitterRelationshipArray($this->source, $this->target); switch ($this->format) { @@ -158,7 +162,7 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction default: break; } - + } } diff --git a/actions/apigroupcreate.php b/actions/apigroupcreate.php index aeae1c2b2..cdb2afb5b 100644 --- a/actions/apigroupcreate.php +++ b/actions/apigroupcreate.php @@ -22,6 +22,8 @@ * @category API * @package StatusNet * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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 @@ -39,6 +41,9 @@ require_once INSTALLDIR . '/lib/apiauth.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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/ diff --git a/actions/apigroupismember.php b/actions/apigroupismember.php index 6cf327012..a8a40a6b3 100644 --- a/actions/apigroupismember.php +++ b/actions/apigroupismember.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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 @@ -38,6 +41,9 @@ require_once INSTALLDIR . '/lib/apibareauth.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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/ @@ -45,7 +51,6 @@ require_once INSTALLDIR . '/lib/apibareauth.php'; class ApiGroupIsMemberAction extends ApiBareAuthAction { - var $user = null; var $group = null; /** diff --git a/actions/apigroupjoin.php b/actions/apigroupjoin.php index f930aa519..071cd9290 100644 --- a/actions/apigroupjoin.php +++ b/actions/apigroupjoin.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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 @@ -38,6 +41,9 @@ require_once INSTALLDIR . '/lib/apiauth.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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/ @@ -45,7 +51,6 @@ require_once INSTALLDIR . '/lib/apiauth.php'; class ApiGroupJoinAction extends ApiAuthAction { - var $user = null; var $group = null; /** diff --git a/actions/apigroupleave.php b/actions/apigroupleave.php index 4e3192ac0..0d4bb9e4d 100644 --- a/actions/apigroupleave.php +++ b/actions/apigroupleave.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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 @@ -38,6 +41,9 @@ require_once INSTALLDIR . '/lib/apiauth.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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/ @@ -45,7 +51,6 @@ require_once INSTALLDIR . '/lib/apiauth.php'; class ApiGroupLeaveAction extends ApiAuthAction { - var $user = null; var $group = null; /** @@ -117,13 +122,13 @@ class ApiGroupLeaveAction extends ApiAuthAction $this->serverError( sprintf( _('Could not remove user %s to group %s.'), - $this->user->nickname, + $this->user->nickname, $this->$group->nickname ) ); return; } - + switch($this->format) { case 'xml': $this->show_single_xml_group($this->group); diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php index 1fc31831a..c529c1e40 100644 --- a/actions/apigrouplist.php +++ b/actions/apigrouplist.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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 @@ -38,6 +41,9 @@ require_once INSTALLDIR . '/lib/apibareauth.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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/ @@ -59,7 +65,7 @@ class ApiGroupListAction extends ApiBareAuthAction function prepare($args) { parent::prepare($args); - + $this->user = $this->getTargetUser($id); $this->groups = $this->getGroups(); diff --git a/actions/apigrouplistall.php b/actions/apigrouplistall.php index ef96a08bd..89469f36f 100644 --- a/actions/apigrouplistall.php +++ b/actions/apigrouplistall.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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 @@ -38,6 +41,9 @@ require_once INSTALLDIR . '/lib/api.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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/ diff --git a/actions/apigroupmembership.php b/actions/apigroupmembership.php index 27f77029e..b31e47b39 100644 --- a/actions/apigroupmembership.php +++ b/actions/apigroupmembership.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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 @@ -34,10 +37,13 @@ if (!defined('STATUSNET')) { require_once INSTALLDIR . '/lib/api.php'; /** - * List 20 newest members of the group specified by name or ID. + * List 20 newest members of the group specified by name or ID. * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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/ @@ -103,7 +109,7 @@ class ApiGroupMembershipAction extends ApiAction /** * Fetch the members of a group * - * @return array $profiles list of profiles + * @return array $profiles list of profiles */ function getProfiles() @@ -112,9 +118,9 @@ class ApiGroupMembershipAction extends ApiAction $profile = $this->group->getMembers( ($this->page - 1) * $this->count, - $this->count, - $this->since_id, - $this->max_id, + $this->count, + $this->since_id, + $this->max_id, $this->since ); @@ -157,7 +163,7 @@ class ApiGroupMembershipAction extends ApiAction * An entity tag for this list of groups * * Returns an Etag based on the action name, language - * the group id, and timestamps of the first and last + * the group id, and timestamps of the first and last * user who has joined the group * * @return string etag diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php index 8969ae194..2bdb22bc4 100644 --- a/actions/apigroupshow.php +++ b/actions/apigroupshow.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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,13 +34,16 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/api.php'; +require_once INSTALLDIR . '/lib/api.php'; /** * Outputs detailed information about the group specified by ID * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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/ diff --git a/actions/apihelptest.php b/actions/apihelptest.php index 4691cbf99..e4ef55f2e 100644 --- a/actions/apihelptest.php +++ b/actions/apihelptest.php @@ -21,6 +21,7 @@ * * @category API * @package StatusNet + * @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 @@ -38,6 +39,7 @@ require_once INSTALLDIR . '/lib/api.php'; * * @category API * @package StatusNet + * @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/ diff --git a/actions/apistatusesdestroy.php b/actions/apistatusesdestroy.php index 74a1310a2..8dc8793b5 100644 --- a/actions/apistatusesdestroy.php +++ b/actions/apistatusesdestroy.php @@ -21,6 +21,12 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author Tom Blankenship + * @author Mike Cochrane + * @author Robin Millette * @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,13 +37,19 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apiauth.php'; +require_once INSTALLDIR . '/lib/apiauth.php'; /** * Deletes one of the authenticating user's statuses (notices). * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author Tom Blankenship + * @author Mike Cochrane + * @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/ @@ -45,8 +57,6 @@ require_once INSTALLDIR.'/lib/apiauth.php'; class ApiStatusesDestroyAction extends ApiAuthAction { - - var $user = null; var $status = null; /** diff --git a/actions/apistatusesshow.php b/actions/apistatusesshow.php index 5d32a0bfc..3be22ca59 100644 --- a/actions/apistatusesshow.php +++ b/actions/apistatusesshow.php @@ -21,6 +21,12 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author Tom Blankenship + * @author Mike Cochrane + * @author Robin Millette * @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,13 +37,19 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/api.php'; +require_once INSTALLDIR . '/lib/api.php'; /** * Returns the notice specified by id as a Twitter-style status and inline user * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author Tom Blankenship + * @author Mike Cochrane + * @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/ diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php index 479654be8..0d71e1512 100644 --- a/actions/apistatusesupdate.php +++ b/actions/apistatusesupdate.php @@ -21,6 +21,12 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author Tom Blankenship + * @author Mike Cochrane + * @author Robin Millette * @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,13 +37,19 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apiauth.php'; +require_once INSTALLDIR . '/lib/apiauth.php'; /** * Updates the authenticating user's status (posts a notice). * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author Tom Blankenship + * @author Mike Cochrane + * @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/ @@ -45,8 +57,6 @@ require_once INSTALLDIR.'/lib/apiauth.php'; class ApiStatusesUpdateAction extends ApiAuthAction { - - var $user = null; var $source = null; var $status = null; var $in_reply_to_status_id = null; diff --git a/actions/apistatusnetconfig.php b/actions/apistatusnetconfig.php index a93570698..ed1d151bf 100644 --- a/actions/apistatusnetconfig.php +++ b/actions/apistatusnetconfig.php @@ -21,6 +21,7 @@ * * @category API * @package StatusNet + * @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 @@ -42,6 +43,7 @@ require_once INSTALLDIR . '/lib/api.php'; * * @category API * @package StatusNet + * @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/ diff --git a/actions/apistatusnetversion.php b/actions/apistatusnetversion.php index 6af9bdd1a..e73ab983b 100644 --- a/actions/apistatusnetversion.php +++ b/actions/apistatusnetversion.php @@ -21,6 +21,7 @@ * * @category API * @package StatusNet + * @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 @@ -41,6 +42,7 @@ require_once INSTALLDIR . '/lib/api.php'; * * @category API * @package StatusNet + * @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/ @@ -88,8 +90,8 @@ class ApiStatusnetVersionAction extends ApiAction break; default: $this->clientError( - _('API method not found!'), - 404, + _('API method not found!'), + 404, $this->format ); break; diff --git a/actions/apisubscriptions.php b/actions/apisubscriptions.php index a952e20b8..bc68dd192 100644 --- a/actions/apisubscriptions.php +++ b/actions/apisubscriptions.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,7 +33,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apibareauth.php'; +require_once INSTALLDIR . '/lib/apibareauth.php'; /** * This class outputs a list of profiles as Twitter-style user and status objects. @@ -40,6 +42,8 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; * * @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/ diff --git a/actions/apitimelinefavorites.php b/actions/apitimelinefavorites.php index c85e56264..b8ae74f13 100644 --- a/actions/apitimelinefavorites.php +++ b/actions/apitimelinefavorites.php @@ -21,8 +21,9 @@ * * @category API * @package StatusNet - * @author Zach Copley - * @copyright 2009 StatusNet, Inc. + * @author Craig Andrews + * @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 * @link http://status.net/ */ @@ -39,6 +40,8 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @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/ diff --git a/actions/apitimelinefriends.php b/actions/apitimelinefriends.php index 90f3b3c06..1ea35866e 100644 --- a/actions/apitimelinefriends.php +++ b/actions/apitimelinefriends.php @@ -21,6 +21,12 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author mac65 + * @author Mike Cochrane + * @author Robin Millette * @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,7 +37,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apibareauth.php'; +require_once INSTALLDIR . '/lib/apibareauth.php'; /** * Returns the most recent notices (default 20) posted by the target user. @@ -39,6 +45,12 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author mac65 + * @author Mike Cochrane + * @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/ diff --git a/actions/apitimelinegroup.php b/actions/apitimelinegroup.php index 2a6f35d72..5d0542918 100644 --- a/actions/apitimelinegroup.php +++ b/actions/apitimelinegroup.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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 @@ -38,6 +41,9 @@ require_once INSTALLDIR . '/lib/api.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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/ diff --git a/actions/apitimelinementions.php b/actions/apitimelinementions.php index c25fb0a0e..fe5ff0f28 100644 --- a/actions/apitimelinementions.php +++ b/actions/apitimelinementions.php @@ -21,6 +21,12 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author mac65 + * @author Mike Cochrane + * @author Robin Millette * @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,13 +37,19 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apibareauth.php'; +require_once INSTALLDIR . '/lib/apibareauth.php'; /** * Returns the most recent (default 20) mentions (status containing @nickname) * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author mac65 + * @author Mike Cochrane + * @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/ @@ -46,7 +58,6 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; class ApiTimelineMentionsAction extends ApiBareAuthAction { - var $user = null; var $notices = null; /** diff --git a/actions/apitimelinepublic.php b/actions/apitimelinepublic.php index 4bff4adb6..58e267734 100644 --- a/actions/apitimelinepublic.php +++ b/actions/apitimelinepublic.php @@ -21,6 +21,12 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author mac65 + * @author Mike Cochrane + * @author Robin Millette * @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,13 +37,19 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/api.php'; +require_once INSTALLDIR . '/lib/api.php'; /** * Returns the most recent notices (default 20) posted by everybody * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author mac65 + * @author Mike Cochrane + * @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/ diff --git a/actions/apitimelinetag.php b/actions/apitimelinetag.php index cf211b173..a274daac0 100644 --- a/actions/apitimelinetag.php +++ b/actions/apitimelinetag.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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,13 +34,16 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/api.php'; +require_once INSTALLDIR . '/lib/api.php'; /** * Returns the 20 most recent notices tagged by a given tag * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @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/ diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php index e7fac3e7a..285735fd1 100644 --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@ -21,6 +21,12 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author mac65 + * @author Mike Cochrane + * @author Robin Millette * @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,7 +37,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apibareauth.php'; +require_once INSTALLDIR . '/lib/apibareauth.php'; /** * Returns the most recent notices (default 20) posted by the authenticating @@ -40,6 +46,12 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author mac65 + * @author Mike Cochrane + * @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/ @@ -48,7 +60,6 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; class ApiTimelineUserAction extends ApiBareAuthAction { - var $user = null; var $notices = null; /** diff --git a/actions/apiuserfollowers.php b/actions/apiuserfollowers.php index 5c0243449..e8d92a773 100644 --- a/actions/apiuserfollowers.php +++ b/actions/apiuserfollowers.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,7 +33,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apibareauth.php'; +require_once INSTALLDIR . '/lib/apibareauth.php'; /** * Ouputs the authenticating user's followers (subscribers), each with @@ -40,6 +42,8 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; * * @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/ diff --git a/actions/apiuserfriends.php b/actions/apiuserfriends.php index 8a42e36b9..741a26e58 100644 --- a/actions/apiuserfriends.php +++ b/actions/apiuserfriends.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,7 +33,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apibareauth.php'; +require_once INSTALLDIR . '/lib/apibareauth.php'; /** * Ouputs the authenticating user's friends (subscriptions), each with @@ -40,6 +42,8 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; * * @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/ diff --git a/actions/apiusershow.php b/actions/apiusershow.php index db942d1a5..b3a939b43 100644 --- a/actions/apiusershow.php +++ b/actions/apiusershow.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Dan Moore + * @author Evan Prodromou + * @author mac65 * @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,7 +34,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/api.php'; +require_once INSTALLDIR . '/lib/api.php'; /** * Ouputs information for a user, specified by ID or screen name. @@ -39,6 +42,9 @@ require_once INSTALLDIR.'/lib/api.php'; * * @category API * @package StatusNet + * @author Dan Moore + * @author Evan Prodromou + * @author mac65 * @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/ diff --git a/lib/api.php b/lib/api.php index db2d24fbd..7a63a4a78 100644 --- a/lib/api.php +++ b/lib/api.php @@ -21,6 +21,11 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Dan Moore + * @author Evan Prodromou + * @author Jeffery To + * @author Toby Inkster * @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 @@ -36,6 +41,11 @@ if (!defined('STATUSNET')) { * * @category API * @package StatusNet + * @author Craig Andrews + * @author Dan Moore + * @author Evan Prodromou + * @author Jeffery To + * @author Toby Inkster * @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/ diff --git a/lib/apiauth.php b/lib/apiauth.php index 4e5e0ccd9..2f2e44a26 100644 --- a/lib/apiauth.php +++ b/lib/apiauth.php @@ -21,7 +21,14 @@ * * @category API * @package StatusNet - * @author Zach Copley + * @author Adrian Lang + * @author Brenda Wallace + * @author Craig Andrews + * @author Dan Moore + * @author Evan Prodromou + * @author mEDI + * @author Sarven Capadisli + * @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/ diff --git a/lib/apibareauth.php b/lib/apibareauth.php index 0ae477f46..2d29c1ddd 100644 --- a/lib/apibareauth.php +++ b/lib/apibareauth.php @@ -23,7 +23,14 @@ * * @category API * @package StatusNet - * @author Zach Copley + * @author Adrian Lang + * @author Brenda Wallace + * @author Craig Andrews + * @author Dan Moore + * @author Evan Prodromou + * @author mEDI + * @author Sarven Capadisli + * @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/ @@ -41,6 +48,13 @@ require_once INSTALLDIR.'/lib/apiauth.php'; * * @category API * @package StatusNet + * @author Adrian Lang + * @author Brenda Wallace + * @author Craig Andrews + * @author Dan Moore + * @author Evan Prodromou + * @author mEDI + * @author Sarven Capadisli * @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/ diff --git a/lib/twitterbasicauthclient.php b/lib/twitterbasicauthclient.php index fd331fbdc..1040d72fb 100644 --- a/lib/twitterbasicauthclient.php +++ b/lib/twitterbasicauthclient.php @@ -36,8 +36,14 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * * @category Integration * @package StatusNet - * @author Zach Copley - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @author Adrian Lang + * @author Brenda Wallace + * @author Craig Andrews + * @author Dan Moore + * @author Evan Prodromou + * @author mEDI + * @author Sarven Capadisli + * @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/ * */ -- cgit v1.2.3-54-g00ecf