From de5ff19713a990af197330dd8e4314de465ffe76 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 25 Sep 2009 16:58:35 -0700 Subject: Moved basic auth stuff into its own classes --- lib/apibareauth.php | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 lib/apibareauth.php (limited to 'lib/apibareauth.php') diff --git a/lib/apibareauth.php b/lib/apibareauth.php new file mode 100644 index 000000000..8921cddca --- /dev/null +++ b/lib/apibareauth.php @@ -0,0 +1,68 @@ +. + * + * @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'; + +class ApiBareAuthAction extends ApiAuthAction +{ + /** + * Does this API resource require authentication? + * + * @return boolean true or false + */ + + function requiresAuth() + { + // If the site is "private", all API methods except statusnet/config + // need authentication + + if (common_config('site', 'private')) { + return true; + } + + // check whether a user has been specified somehow + + $id = $this->arg('id'); + $user_id = $this->arg('user_id'); + $screen_name = $this->arg('screen_name'); + + if (empty($id) && empty($user_id) && empty($screen_name)) { + return true; + } + + return false; + } + +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 37bdc060c521203ff4e14a1a2b1d7fc59d1c2d4d Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sun, 27 Sep 2009 15:33:46 -0700 Subject: phpcs on apifriendstimeline.php, apiauth.php and apibareauth.php --- actions/apifriendstimeline.php | 114 +++++++++++++++++++++++++---------------- lib/apiauth.php | 56 +++++++++++++++++--- lib/apibareauth.php | 11 ++++ 3 files changed, 130 insertions(+), 51 deletions(-) (limited to 'lib/apibareauth.php') diff --git a/actions/apifriendstimeline.php b/actions/apifriendstimeline.php index dd89f44fe..dc280b3f3 100644 --- a/actions/apifriendstimeline.php +++ b/actions/apifriendstimeline.php @@ -19,7 +19,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * - * @category Personal + * @category API * @package StatusNet * @author Zach Copley * @copyright 2009 StatusNet, Inc. @@ -33,6 +33,17 @@ if (!defined('STATUSNET')) { require_once INSTALLDIR.'/lib/apibareauth.php'; +/** + * Returns the most recent notices (default 20) posted by the target user. + * This is the equivalent of 'You and friends' page accessed via Web. + * + * @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 ApiFriendsTimelineAction extends ApiBareAuthAction { @@ -86,7 +97,8 @@ class ApiFriendsTimelineAction extends ApiBareAuthAction * @return void */ - function handle($args) { + function handle($args) + { parent::handle($args); $this->showTimeline(); } @@ -104,39 +116,45 @@ class ApiFriendsTimelineAction extends ApiBareAuthAction $title = sprintf(_("%s and friends"), $user->nickname); $taguribase = common_config('integration', 'taguri'); $id = "tag:$taguribase:FriendsTimeline:" . $user->id; - $link = common_local_url('all', - array('nickname' => $user->nickname)); - $subtitle = sprintf(_('Updates from %1$s and friends on %2$s!'), - $user->nickname, $sitename); + $link = common_local_url( + 'all', array('nickname' => $user->nickname) + ); + $subtitle = sprintf( + _('Updates from %1$s and friends on %2$s!'), + $user->nickname, $sitename + ); switch($this->arg('format')) { - case 'xml': - $this->show_xml_timeline($this->notices); - break; - case 'rss': - $this->show_rss_timeline($this->notices, $title, $link, $subtitle); - break; - case 'atom': - - $target_id = $this->arg('id'); - - if (isset($target_id)) { - $selfuri = common_root_url() . - 'api/statuses/friends_timeline/' . - $target_id . '.atom'; - } else { - $selfuri = common_root_url() . - 'api/statuses/friends_timeline.atom'; - } - $this->show_atom_timeline($this->notices, $title, $id, $link, - $subtitle, null, $selfuri); - break; - case 'json': - $this->show_json_timeline($this->notices); - break; - default: - $this->clientError(_('API method not found!'), $code = 404); - break; + case 'xml': + $this->show_xml_timeline($this->notices); + break; + case 'rss': + $this->show_rss_timeline($this->notices, $title, $link, $subtitle); + break; + case 'atom': + + $target_id = $this->arg('id'); + + if (isset($target_id)) { + $selfuri = common_root_url() . + 'api/statuses/friends_timeline/' . + $target_id . '.atom'; + } else { + $selfuri = common_root_url() . + 'api/statuses/friends_timeline.atom'; + } + + $this->show_atom_timeline( + $this->notices, $title, $id, $link, + $subtitle, null, $selfuri + ); + break; + case 'json': + $this->show_json_timeline($this->notices); + break; + default: + $this->clientError(_('API method not found!'), $code = 404); + break; } } @@ -151,13 +169,17 @@ class ApiFriendsTimelineAction extends ApiBareAuthAction $notices = array(); if (!empty($this->auth_user) && $this->auth_user->id == $this->user->id) { - $notice = $this->user->noticeInbox(($this->page-1) * $this->count, - $this->count, $this->since_id, - $this->max_id, $this->since); + $notice = $this->user->noticeInbox( + ($this->page-1) * $this->count, + $this->count, $this->since_id, + $this->max_id, $this->since + ); } else { - $notice = $this->user->noticesWithFriends(($this->page-1) * $this->count, - $this->count, $this->since_id, - $this->max_id, $this->since); + $notice = $this->user->noticesWithFriends( + ($this->page-1) * $this->count, + $this->count, $this->since_id, + $this->max_id, $this->since + ); } while ($notice->fetch()) { @@ -168,7 +190,9 @@ class ApiFriendsTimelineAction extends ApiBareAuthAction } /** - * Is this page read-only? + * Is this action read only? + * + * @param array $args other arguments * * @return boolean true */ @@ -181,6 +205,7 @@ class ApiFriendsTimelineAction extends ApiBareAuthAction /** * When was this feed last modified? * + * @return string datestamp of the latest notice in the stream */ function lastModified() @@ -193,7 +218,7 @@ class ApiFriendsTimelineAction extends ApiBareAuthAction } /** - * An entity tag for this page + * An entity tag for this stream * * Returns an Etag based on the action name, language, user ID, and * timestamps of the first and last notice in the timeline @@ -207,12 +232,15 @@ class ApiFriendsTimelineAction extends ApiBareAuthAction $last = count($this->notices) - 1; - return implode(':', + return implode( + ':', array($this->arg('action'), common_language(), $this->user->id, strtotime($this->notices[0]->created), - strtotime($this->notices[$last]->created))) . '"'; + strtotime($this->notices[$last]->created)) + ) + . '"'; } return null; diff --git a/lib/apiauth.php b/lib/apiauth.php index 501d3de10..c1976f964 100644 --- a/lib/apiauth.php +++ b/lib/apiauth.php @@ -33,6 +33,16 @@ if (!defined('STATUSNET')) { require_once INSTALLDIR.'/lib/twitterapi.php'; +/** + * Actions extending this class will require auth + * + * @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 ApiAuthAction extends TwitterapiAction { /** @@ -46,6 +56,13 @@ class ApiAuthAction extends TwitterapiAction return true; } + /** + * Check for a user specified via HTTP basic auth. If there isn't + * one, try to get one by outputting the basic auth header. + * + * @return boolean true or false + */ + function checkBasicAuthUser() { $this->basicAuthProcessHeader(); @@ -68,8 +85,11 @@ class ApiAuthAction extends TwitterapiAction // basic authentication failed list($proxy, $ip) = common_client_ip(); - common_log(LOG_WARNING, - "Failed API auth attempt, nickname = $nickname, proxy = $proxy, ip = $ip."); + common_log( + LOG_WARNING, + 'Failed API auth attempt, nickname = ' . + "$nickname, proxy = $proxy, ip = $ip." + ); $this->showBasicAuthError(); return false; } @@ -77,16 +97,28 @@ class ApiAuthAction extends TwitterapiAction return true; } + /** + * Read the HTTP headers and set the auth user. Decodes HTTP_AUTHORIZATION + * param to support basic auth when PHP is running in CGI mode. + * + * @return void + */ + function basicAuthProcessHeader() { - if (isset($_SERVER['AUTHORIZATION']) || isset($_SERVER['HTTP_AUTHORIZATION'])) { - $authorization_header = isset($_SERVER['HTTP_AUTHORIZATION'])? $_SERVER['HTTP_AUTHORIZATION'] : $_SERVER['AUTHORIZATION']; + if (isset($_SERVER['AUTHORIZATION']) + || isset($_SERVER['HTTP_AUTHORIZATION']) + ) { + $authorization_header = isset($_SERVER['HTTP_AUTHORIZATION']) + ? $_SERVER['HTTP_AUTHORIZATION'] : $_SERVER['AUTHORIZATION']; } if (isset($_SERVER['PHP_AUTH_USER'])) { $this->auth_user = $_SERVER['PHP_AUTH_USER']; $this->auth_pw = $_SERVER['PHP_AUTH_PW']; - } elseif (isset($authorization_header) && strstr(substr($authorization_header, 0, 5), 'Basic')) { + } elseif (isset($authorization_header) + && strstr(substr($authorization_header, 0, 5), 'Basic')) { + // decode the HTTP_AUTHORIZATION header on php-cgi server self // on fcgid server the header name is AUTHORIZATION @@ -94,6 +126,7 @@ class ApiAuthAction extends TwitterapiAction list($this->auth_user, $this->auth_pw) = explode(':', $auth_hash); // set all to null on a empty basic auth request + if ($this->auth_user == "") { $this->auth_user = null; $this->auth_pw = null; @@ -104,6 +137,13 @@ class ApiAuthAction extends TwitterapiAction } } + /** + * Output an authentication error message. Use XML or JSON if one + * of those formats is specified, otherwise output plain text + * + * @return void + */ + function showBasicAuthError() { header('HTTP/1.1 401 Unauthorized'); @@ -119,7 +159,8 @@ class ApiAuthAction extends TwitterapiAction $this->endXML(); } elseif ($this->arg('format') == 'json') { header('Content-Type: application/json; charset=utf-8'); - $error_array = array('error' => $msg, 'request' => $_SERVER['REQUEST_URI']); + $error_array = array('error' => $msg, + 'request' => $_SERVER['REQUEST_URI']); print(json_encode($error_array)); } else { header('Content-type: text/plain'); @@ -127,5 +168,4 @@ class ApiAuthAction extends TwitterapiAction } } - -} \ No newline at end of file +} diff --git a/lib/apibareauth.php b/lib/apibareauth.php index 8921cddca..a99d450ec 100644 --- a/lib/apibareauth.php +++ b/lib/apibareauth.php @@ -35,6 +35,17 @@ if (!defined('STATUSNET')) { require_once INSTALLDIR.'/lib/apiauth.php'; +/** + * Actions extending this class will require auth unless a target + * user ID has been specified + * + * @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 ApiBareAuthAction extends ApiAuthAction { /** -- 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 'lib/apibareauth.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 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 'lib/apibareauth.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