From 0d7d4dfe5d258d2018f601f8116d629577105864 Mon Sep 17 00:00:00 2001 From: mEDI Date: Thu, 3 Sep 2009 19:32:27 +0200 Subject: [PATCH 01/57] add basic auth support for cgi servers on the api (trac #1832) --- actions/api.php | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/actions/api.php b/actions/api.php index f425a8dcd7..f624d6b693 100644 --- a/actions/api.php +++ b/actions/api.php @@ -27,6 +27,8 @@ class ApiAction extends Action var $api_arg; var $api_method; var $api_action; + var $auth_user; + var $auth_pw; function handle($args) { @@ -35,6 +37,7 @@ class ApiAction extends Action $this->api_action = $this->arg('apiaction'); $method = $this->arg('method'); $argument = $this->arg('argument'); + $this->basic_auth_process_header(); if (isset($argument)) { $cmdext = explode('.', $argument); @@ -50,7 +53,7 @@ class ApiAction extends Action } if ($this->requires_auth()) { - if (!isset($_SERVER['PHP_AUTH_USER'])) { + if (!isset($this->auth_user)) { # This header makes basic auth go header('WWW-Authenticate: Basic realm="StatusNet API"'); @@ -58,8 +61,8 @@ class ApiAction extends Action # If the user hits cancel -- bam! $this->show_basic_auth_error(); } else { - $nickname = $_SERVER['PHP_AUTH_USER']; - $password = $_SERVER['PHP_AUTH_PW']; + $nickname = $this->auth_user; + $password = $this->auth_pw; $user = common_check_user($nickname, $password); if ($user) { @@ -76,8 +79,8 @@ class ApiAction extends Action } else { // Caller might give us a username even if not required - if (isset($_SERVER['PHP_AUTH_USER'])) { - $user = User::staticGet('nickname', $_SERVER['PHP_AUTH_USER']); + if (isset($this->auth_user)) { + $user = User::staticGet('nickname', $this->auth_user); if ($user) { $this->user = $user; } @@ -203,6 +206,39 @@ class ApiAction extends Action } } + function basic_auth_process_header() + { + 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') ) + { + // decode the HTTP_AUTHORIZATION header on php-cgi server self + // on fcgid server is the header name AUTHORIZATION + + $auth_hash = base64_decode( substr($authorization_header, 6) ); + list($this->auth_user, $this->auth_pw) = explode(':', $auth_hash); + + // set all to NULL on a emty basic auth request + if($this->auth_user == "") { + $this->auth_user = NULL; + $this->auth_pw = NULL; + } + } + else + { + $this->auth_user = NULL; + $this->auth_pw = NULL; + } + } + function show_basic_auth_error() { header('HTTP/1.1 401 Unauthorized'); From ebcbd3820e10e70ab2ed1bff9839a03f2948ee8f Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Thu, 3 Sep 2009 15:30:19 -0400 Subject: [PATCH 02/57] Fix spelling --- actions/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/api.php b/actions/api.php index f624d6b693..c236378bcb 100644 --- a/actions/api.php +++ b/actions/api.php @@ -221,12 +221,12 @@ class ApiAction extends Action elseif ( isset($authorization_header) && strstr(substr($authorization_header, 0,5),'Basic') ) { // decode the HTTP_AUTHORIZATION header on php-cgi server self - // on fcgid server is the header name AUTHORIZATION + // on fcgid server the header name is AUTHORIZATION $auth_hash = base64_decode( substr($authorization_header, 6) ); list($this->auth_user, $this->auth_pw) = explode(':', $auth_hash); - // set all to NULL on a emty basic auth request + // set all to NULL on a empty basic auth request if($this->auth_user == "") { $this->auth_user = NULL; $this->auth_pw = NULL; From 277b464054b24f8d680ddbe762c9e438f6679592 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 3 Sep 2009 19:42:50 +0000 Subject: [PATCH 03/57] Created autofocus method to give focus to an element (primarily a form control) on page onload. Updated some of the pages to use autofocus. --- actions/avatarsettings.php | 2 ++ actions/editgroup.php | 6 ++++++ actions/emailsettings.php | 6 ++++++ actions/grouplogo.php | 2 ++ actions/groupsearch.php | 6 ++++++ actions/invite.php | 6 ++++++ actions/login.php | 8 ++++++++ actions/noticesearch.php | 6 ++++++ actions/openidlogin.php | 6 ++++++ actions/openidsettings.php | 6 ++++++ actions/othersettings.php | 6 ++++++ actions/passwordsettings.php | 6 ++++++ actions/peoplesearch.php | 6 ++++++ actions/profilesettings.php | 8 ++++++++ actions/register.php | 6 ++++++ actions/smssettings.php | 6 ++++++ actions/subscriptions.php | 6 ++++++ lib/designsettings.php | 2 ++ lib/htmloutputter.php | 25 +++++++++++++++++++++++++ 19 files changed, 125 insertions(+) diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php index 0bc439ff12..02a684b38f 100644 --- a/actions/avatarsettings.php +++ b/actions/avatarsettings.php @@ -399,5 +399,7 @@ class AvatarsettingsAction extends AccountSettingsAction $this->script('js/jcrop/jquery.Jcrop.min.js'); $this->script('js/jcrop/jquery.Jcrop.go.js'); } + + $this->autofocus('avatarfile'); } } diff --git a/actions/editgroup.php b/actions/editgroup.php index cac910e9bc..e7ba836a01 100644 --- a/actions/editgroup.php +++ b/actions/editgroup.php @@ -160,6 +160,12 @@ class EditgroupAction extends GroupDesignAction } } + function showScripts() + { + parent::showScripts(); + $this->autofocus('nickname'); + } + function trySave() { $cur = common_current_user(); diff --git a/actions/emailsettings.php b/actions/emailsettings.php index af528a892e..6eff06c0d6 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -71,6 +71,12 @@ class EmailsettingsAction extends AccountSettingsAction return _('Manage how you get email from %%site.name%%.'); } + function showScripts() + { + parent::showScripts(); + $this->autofocus('email'); + } + /** * Content area of the page * diff --git a/actions/grouplogo.php b/actions/grouplogo.php index c6f376915e..63ba769c7a 100644 --- a/actions/grouplogo.php +++ b/actions/grouplogo.php @@ -445,6 +445,8 @@ class GrouplogoAction extends GroupDesignAction $this->script('js/jcrop/jquery.Jcrop.min.js'); $this->script('js/jcrop/jquery.Jcrop.go.js'); } + + $this->autofocus('avatarfile'); } function showLocalNav() diff --git a/actions/groupsearch.php b/actions/groupsearch.php index bbd4c3a74a..be15efc47c 100644 --- a/actions/groupsearch.php +++ b/actions/groupsearch.php @@ -91,6 +91,12 @@ class GroupsearchAction extends SearchAction $user_group->free(); } } + + function showScripts() + { + parent::showScripts(); + $this->autofocus('q'); + } } class GroupSearchResults extends GroupList diff --git a/actions/invite.php b/actions/invite.php index ab43a2491d..9fa6a76f67 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -98,6 +98,12 @@ class InviteAction extends CurrentUserDesignAction $this->showPage(); } + function showScripts() + { + parent::showScripts(); + $this->autofocus('addresses'); + } + function title() { if ($this->mode == 'sent') { diff --git a/actions/login.php b/actions/login.php index 37f3c54ffb..ac8c40c3e5 100644 --- a/actions/login.php +++ b/actions/login.php @@ -22,6 +22,7 @@ * @category Login * @package StatusNet * @author Evan Prodromou + * @author Sarven Capadisli * @copyright 2008-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/ @@ -37,6 +38,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * @category Personal * @package StatusNet * @author Evan Prodromou + * @author Sarven Capadisli * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ @@ -162,6 +164,12 @@ class LoginAction extends Action $this->showPage(); } + function showScripts() + { + parent::showScripts(); + $this->autofocus('nickname'); + } + /** * Title of the page * diff --git a/actions/noticesearch.php b/actions/noticesearch.php index 1188e7e10f..1cd987df39 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -137,6 +137,12 @@ class NoticesearchAction extends SearchAction $this->pagination($page > 1, $cnt > NOTICES_PER_PAGE, $page, 'noticesearch', array('q' => $q)); } + + function showScripts() + { + parent::showScripts(); + $this->autofocus('q'); + } } class SearchNoticeList extends NoticeList { diff --git a/actions/openidlogin.php b/actions/openidlogin.php index 4b53386943..9b7deefb63 100644 --- a/actions/openidlogin.php +++ b/actions/openidlogin.php @@ -86,6 +86,12 @@ class OpenidloginAction extends Action } } + function showScripts() + { + parent::showScripts(); + $this->autofocus('openid_url'); + } + function title() { return _('OpenID Login'); diff --git a/actions/openidsettings.php b/actions/openidsettings.php index 13da64a4f6..30725fc1bf 100644 --- a/actions/openidsettings.php +++ b/actions/openidsettings.php @@ -72,6 +72,12 @@ class OpenidsettingsAction extends AccountSettingsAction ' Manage your associated OpenIDs from here.'); } + function showScripts() + { + parent::showScripts(); + $this->autofocus('openid_url'); + } + /** * Show the form for OpenID management * diff --git a/actions/othersettings.php b/actions/othersettings.php index 8b674161a8..f898e22079 100644 --- a/actions/othersettings.php +++ b/actions/othersettings.php @@ -71,6 +71,12 @@ class OthersettingsAction extends AccountSettingsAction return _('Manage various other options.'); } + function showScripts() + { + parent::showScripts(); + $this->autofocus('urlshorteningservice'); + } + /** * Content area of the page * diff --git a/actions/passwordsettings.php b/actions/passwordsettings.php index ec842600f6..cd4beac3f2 100644 --- a/actions/passwordsettings.php +++ b/actions/passwordsettings.php @@ -69,6 +69,12 @@ class PasswordsettingsAction extends AccountSettingsAction return _('Change your password.'); } + function showScripts() + { + parent::showScripts(); + $this->autofocus('oldpassword'); + } + /** * Content area of the page * diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index ba0f71e392..38135ecbde 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -85,6 +85,12 @@ class PeoplesearchAction extends SearchAction $profile->free(); } } + + function showScripts() + { + parent::showScripts(); + $this->autofocus('q'); + } } /** diff --git a/actions/profilesettings.php b/actions/profilesettings.php index f9c16351d3..2d66e99469 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -23,6 +23,7 @@ * @package StatusNet * @author Evan Prodromou * @author Zach Copley + * @author Sarven Capadisli * @copyright 2008-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 +42,7 @@ require_once INSTALLDIR.'/lib/accountsettingsaction.php'; * @package StatusNet * @author Evan Prodromou * @author Zach Copley + * @author Sarven Capadisli * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ @@ -70,6 +72,12 @@ class ProfilesettingsAction extends AccountSettingsAction 'so people know more about you.'); } + function showScripts() + { + parent::showScripts(); + $this->autofocus('nickname'); + } + /** * Content area of the page * diff --git a/actions/register.php b/actions/register.php index c431aeee3e..eefbc340a1 100644 --- a/actions/register.php +++ b/actions/register.php @@ -140,6 +140,12 @@ class RegisterAction extends Action } } + function showScripts() + { + parent::showScripts(); + $this->autofocus('nickname'); + } + /** * Try to register a user * diff --git a/actions/smssettings.php b/actions/smssettings.php index b956ccebaa..672abcef8c 100644 --- a/actions/smssettings.php +++ b/actions/smssettings.php @@ -69,6 +69,12 @@ class SmssettingsAction extends ConnectSettingsAction return _('You can receive SMS messages through email from %%site.name%%.'); } + function showScripts() + { + parent::showScripts(); + $this->autofocus('sms'); + } + /** * Content area of the page * diff --git a/actions/subscriptions.php b/actions/subscriptions.php index b1c6682283..cc7b38ee46 100644 --- a/actions/subscriptions.php +++ b/actions/subscriptions.php @@ -107,6 +107,12 @@ class SubscriptionsAction extends GalleryAction array('nickname' => $this->user->nickname)); } + function showScripts() + { + parent::showScripts(); + $this->autofocus('tag'); + } + function showEmptyListMessage() { if (common_logged_in()) { diff --git a/lib/designsettings.php b/lib/designsettings.php index fe42225974..fdc05562e0 100644 --- a/lib/designsettings.php +++ b/lib/designsettings.php @@ -327,6 +327,8 @@ class DesignSettingsAction extends AccountSettingsAction $this->script('js/farbtastic/farbtastic.js'); $this->script('js/farbtastic/farbtastic.go.js'); $this->script('js/userdesign.go.js'); + + $this->autofocus('design_background-image_file'); } /** diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 8ad7dc20fa..aa01f6b1d9 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -412,4 +412,29 @@ class HTMLOutputter extends XMLOutputter $this->element('p', 'form_guide', $instructions); } } + + + /** + * Internal script to autofocus the given element on page onload. + * + * @param string $id element ID, must refer to an existing element + * + * @return void + * + */ + function autofocus($id) + { + $this->elementStart('script', array('type' => 'text/javascript')); + $this->raw(' + + '); + $this->elementEnd('script'); + } } From 5974871b7b00bd8e3f28dc5f5a9465a9eec0d3d3 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Thu, 3 Sep 2009 18:34:30 -0400 Subject: [PATCH 04/57] Improve OAuth CGI compatibility Fixes http://status.net/trac/ticket/1822 Reported upstream at http://code.google.com/p/oauth/issues/detail?id=118 --- extlib/OAuth.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extlib/OAuth.php b/extlib/OAuth.php index 029166175c..fd48535545 100644 --- a/extlib/OAuth.php +++ b/extlib/OAuth.php @@ -199,7 +199,8 @@ class OAuthRequest {/*{{{*/ } else { // collect request parameters from query string (GET) and post-data (POST) if appropriate (note: POST vars have priority) $req_parameters = $_GET; - if ($http_method == "POST" && @strstr($request_headers["Content-Type"], "application/x-www-form-urlencoded") ) { + if ($http_method == "POST" && + ( @strstr($request_headers["Content-Type"], "application/x-www-form-urlencoded") || @strstr($_ENV["CONTENT_TYPE"], "application/x-www-form-urlencoded") )) { $req_parameters = array_merge($req_parameters, $_POST); } From 80b7e54ca2cebcfd7c2c5e63b4ef604106a42aca Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Fri, 4 Sep 2009 11:30:29 -0400 Subject: [PATCH 05/57] Added additional characters as allowed in URLs. --- lib/util.php | 6 +++--- tests/URLDetectionTest.php | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/util.php b/lib/util.php index f4ba3a6c21..79611af2c4 100644 --- a/lib/util.php +++ b/lib/util.php @@ -442,9 +442,9 @@ function common_replace_urls_callback($text, $callback, $notice_id = null) { ')'. '(?:'. '(?:\:\d+)?'. //:port - '(?:/[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~]*)?'. // /path - '(?:\?[\pN\pL\$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\/]*)?'. // ?query string - '(?:\#[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\/\?\#]*)?'. // #fragment + '(?:/[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"]*)?'. // /path + '(?:\?[\pN\pL\$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"\/]*)?'. // ?query string + '(?:\#[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"\/\?\#]*)?'. // #fragment ')(?127.0.0.1/Name:test.php'), array('127.0.0.1/~test', '127.0.0.1/~test'), + array('127.0.0.1/+test', + '127.0.0.1/+test'), + array('127.0.0.1/$test', + '127.0.0.1/$test'), + array('127.0.0.1/\'test', + '127.0.0.1/\'test'), + array('127.0.0.1/"test', + '127.0.0.1/"test'), + array('127.0.0.1/-test', + '127.0.0.1/-test'), + array('127.0.0.1/_test', + '127.0.0.1/_test'), + array('127.0.0.1/!test', + '127.0.0.1/!test'), + array('127.0.0.1/*test', + '127.0.0.1/*test'), array('127.0.0.1/test%20stuff', '127.0.0.1/test%20stuff'), array('http://[::1]:99/test.php', From b237dc21ba672957d38daeb0ce1ddf501a3ede3f Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 4 Sep 2009 15:59:27 +0000 Subject: [PATCH 06/57] Updated layout for filter by tag form --- lib/galleryaction.php | 5 ++++- theme/base/css/display.css | 24 +++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lib/galleryaction.php b/lib/galleryaction.php index 18cc7b9295..31e36803a7 100644 --- a/lib/galleryaction.php +++ b/lib/galleryaction.php @@ -132,13 +132,16 @@ class GalleryAction extends OwnerDesignAction $this->elementEnd('li'); $this->elementStart('li', array('id'=>'filter_tags_item')); $this->elementStart('form', array('name' => 'bytag', - 'id' => 'bytag', + 'id' => 'form_filter_bytag', 'action' => common_path('?action=' . $this->trimmed('action')), 'method' => 'post')); + $this->elementStart('fieldset'); + $this->element('legend', null, _('Select tag to filter')); $this->dropdown('tag', _('Tag'), $content, _('Choose a tag to narrow list'), false, $tag); $this->hidden('nickname', $this->user->nickname); $this->submit('submit', _('Go')); + $this->elementEnd('fieldset'); $this->elementEnd('form'); $this->elementEnd('li'); $this->elementEnd('ul'); diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 6f1a29f4aa..d770f38682 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -156,7 +156,8 @@ font-weight:bold; #form_notice_delete legend, #form_password_recover legend, #form_password_change legend, -.form_entity_block legend { +.form_entity_block legend, +#form_filter_bytag legend { display:none; } @@ -1049,36 +1050,37 @@ display:none; #filter_tags ul { list-style-type:none; } -#filter_tags ul li { +#filter_tags li { float:left; margin-left:7px; padding-left:7px; border-left-width:1px; border-left-style:solid; } -#filter_tags ul li.child_1 { +#filter_tags #filter_tags_all { margin-left:0; border-left:0; padding-left:0; } -#filter_tags ul li#filter_tags_all a { +#filter_tags_all a { font-weight:bold; margin-top:7px; float:left; } -#filter_tags ul li#filter_tags_item label { +#filter_tags_item label { margin-right:7px; } -#filter_tags ul li#filter_tags_item label, -#filter_tags ul li#filter_tags_item select { -display:inline; -} -#filter_tags ul li#filter_tags_item p { +#filter_tags_item label, +#filter_tags_item select { float:left; +} +#filter_tags_item p { +float:left; +clear:both; margin-left:38px; } -#filter_tags ul li#filter_tags_item input { +#filter_tags_item .submit { position:relative; top:3px; left:3px; From f218d7fd588660fb6d4def782c64abd8b991e4a7 Mon Sep 17 00:00:00 2001 From: brenda Date: Sat, 5 Sep 2009 16:11:38 +1200 Subject: [PATCH 07/57] more info in error message, to help next person who has to debug locales --- lib/util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index 79611af2c4..3dcd077a73 100644 --- a/lib/util.php +++ b/lib/util.php @@ -59,7 +59,7 @@ function common_init_language() textdomain("statusnet"); setlocale(LC_CTYPE, 'C'); if(!$locale_set) { - common_log(LOG_INFO,'Language requested:'.$language.' - locale could not be set:',__FILE__); + common_log(LOG_INFO, 'Language requested:' . $language . ' - locale could not be set. Perhaps that system locale is not installed.', __FILE__); } } From 8438724296dadf9e5b26e4a2220403d494de62d0 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 7 Sep 2009 14:51:10 +0000 Subject: [PATCH 08/57] Updated identica and default theme to use processing indicator --- theme/default/css/display.css | 7 ++----- theme/identica/css/display.css | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/theme/default/css/display.css b/theme/default/css/display.css index a1c4a2171d..86369cb993 100644 --- a/theme/default/css/display.css +++ b/theme/default/css/display.css @@ -94,10 +94,11 @@ background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no opacity:0; } -#form_notice.processing #notice_action-submit { +#wrap form.processing input.submit { background:#FFFFFF url(../../base/images/icons/icon_processing.gif) no-repeat 47% 47%; cursor:wait; text-indent:-9999px; +outline:none; } #content { @@ -223,10 +224,6 @@ background:transparent url(../../base/images/icons/twotone/green/favourite.gif) .notice-options form.form_disfavor input.submit { background:transparent url(../../base/images/icons/twotone/green/disfavourite.gif) no-repeat 0 45%; } -.notice-options form.form_favor.processing input.submit, -.notice-options form.form_disfavor.processing input.submit { -background:transparent url(../../base/images/icons/icon_processing.gif) no-repeat 0 45%; -} .notice-options .notice_delete { background:transparent url(../../base/images/icons/twotone/green/trash.gif) no-repeat 0 45%; } diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css index 51286657ec..9fc97180d4 100644 --- a/theme/identica/css/display.css +++ b/theme/identica/css/display.css @@ -94,10 +94,11 @@ background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no opacity:0; } -#form_notice.processing #notice_action-submit { +#wrap form.processing input.submit { background:#FFFFFF url(../../base/images/icons/icon_processing.gif) no-repeat 47% 47%; cursor:wait; text-indent:-9999px; +outline:none; } #content { From c77c0d88cea4b26c9ede432eea728c2af72d2821 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 7 Sep 2009 15:14:05 +0000 Subject: [PATCH 09/57] Setting max width limit to select form control on inbox and outbox pages --- theme/base/css/display.css | 1 + 1 file changed, 1 insertion(+) diff --git a/theme/base/css/display.css b/theme/base/css/display.css index d770f38682..1f37a7637b 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -511,6 +511,7 @@ margin-top:7px; margin-bottom:7px; margin-left:18px; float:left; +max-width:322px; } #form_notice .error, #form_notice .success { From 6020d85191bdd838acbeb40ab17035e378b0aee1 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 7 Sep 2009 22:36:01 -0400 Subject: [PATCH 10/57] Don't "hightlight" search terms (by surrounding them in $term) when the term appears in an HTML attribute Fixes http://status.net/trac/ticket/1852 --- actions/noticesearch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/noticesearch.php b/actions/noticesearch.php index 1cd987df39..69dcd1a46c 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -198,7 +198,7 @@ class SearchNoticeListItem extends NoticeListItem { $result = preg_replace($pattern, '\\1', $text); /* Remove highlighting from inside links, loop incase multiple highlights in links */ - $pattern = '/(href="[^"]*)('.$options.')<\/strong>([^"]*")/iU'; + $pattern = '/(\w+="[^"]*)('.$options.')<\/strong>([^"]*")/iU'; do { $result = preg_replace($pattern, '\\1\\2\\3', $result, -1, $count); } while ($count); From afe1b8ec3df8d231ae9c6699da3a3947da285c00 Mon Sep 17 00:00:00 2001 From: CiaranG Date: Tue, 8 Sep 2009 11:27:37 +0100 Subject: [PATCH 11/57] Use a non-error-generating array key check to a) improve performance and b) not fill the log file with crud --- lib/omb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/omb.php b/lib/omb.php index 0d62445991..7dca760c69 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -135,7 +135,7 @@ function omb_broadcast_remote_subscribers($notice) $posted = array(); while ($rp->fetch()) { - if (!$posted[$rp->postnoticeurl]) { + if (!array_key_exists($rp->postnoticeurl, $posted)) { common_log(LOG_DEBUG, 'Posting to ' . $rp->postnoticeurl); if (omb_post_notice_keys($notice, $rp->postnoticeurl, $rp->token, $rp->secret)) { common_log(LOG_DEBUG, 'Finished to ' . $rp->postnoticeurl); From 52a197b235c4347e0fe6b14609098c0a0e444319 Mon Sep 17 00:00:00 2001 From: CiaranG Date: Tue, 8 Sep 2009 13:25:59 +0100 Subject: [PATCH 12/57] Linkback Plugin: check result properly so failures are not reported as a success in the log. Also logs (debug only) when an attempt is being made --- plugins/LinkbackPlugin.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/LinkbackPlugin.php b/plugins/LinkbackPlugin.php index c49f70de0d..60f7a60c79 100644 --- a/plugins/LinkbackPlugin.php +++ b/plugins/LinkbackPlugin.php @@ -75,6 +75,8 @@ class LinkbackPlugin extends Plugin function linkbackUrl($url) { + common_log(LOG_DEBUG,"Attempting linkback for " . $url); + $orig = $url; $url = htmlspecialchars_decode($orig); $scheme = parse_url($url, PHP_URL_SCHEME); @@ -134,15 +136,20 @@ class LinkbackPlugin extends Plugin "User-Agent: " . $this->userAgent(), 'content' => $request))); $file = file_get_contents($endpoint, false, $context); - $response = xmlrpc_decode($file); - if (xmlrpc_is_fault($response)) { + if (!$file) { common_log(LOG_WARNING, + "Pingback request failed for '$url' ($endpoint)"); + } else { + $response = xmlrpc_decode($file); + if (xmlrpc_is_fault($response)) { + common_log(LOG_WARNING, "Pingback error for '$url' ($endpoint): ". "$response[faultString] ($response[faultCode])"); - } else { - common_log(LOG_INFO, + } else { + common_log(LOG_INFO, "Pingback success for '$url' ($endpoint): ". "'$response'"); + } } } From 3e1dc0e0b95ee106311bc19b0d867d8c98882f91 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 8 Sep 2009 13:06:13 -0700 Subject: [PATCH 13/57] flip exe bit on Config.php --- classes/Config.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 classes/Config.php diff --git a/classes/Config.php b/classes/Config.php old mode 100755 new mode 100644 From 1e707008c247d9d6c3c81bf1b1a6fef41f2049ba Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 8 Sep 2009 13:06:46 -0700 Subject: [PATCH 14/57] flip exe bit on Deleted_notice.php --- classes/Deleted_notice.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 classes/Deleted_notice.php diff --git a/classes/Deleted_notice.php b/classes/Deleted_notice.php old mode 100755 new mode 100644 From e559f82e86c495abdc4cf5fff3d8c6279a808354 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 8 Sep 2009 13:07:21 -0700 Subject: [PATCH 15/57] flip exe bit on statusnet.ini --- classes/statusnet.ini | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 classes/statusnet.ini diff --git a/classes/statusnet.ini b/classes/statusnet.ini old mode 100755 new mode 100644 From 153b647f0b06b8053141589aa42c1231c20f6c61 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 9 Sep 2009 12:57:27 +0200 Subject: [PATCH 16/57] Updated biz theme. --- theme/biz/css/base.css | 25 +++------ theme/biz/css/display.css | 110 ++++++++++++++++++++++++-------------- 2 files changed, 78 insertions(+), 57 deletions(-) diff --git a/theme/biz/css/base.css b/theme/biz/css/base.css index 5245ea5d2f..6357e55b4e 100644 --- a/theme/biz/css/base.css +++ b/theme/biz/css/base.css @@ -849,6 +849,10 @@ float:left; font-size:1.025em; } +.notice div.entry-content .timestamp { +display:inline-block; +} + .notice div.entry-content dl, .notice div.entry-content dt, .notice div.entry-content dd { @@ -866,15 +870,12 @@ display:inline-block; text-transform:lowercase; } - .notice-options { -padding-left:2%; -float:left; -width:50%; position:relative; font-size:0.95em; -width:12.5%; +width:90px; float:right; +margin-right:11px; } .notice-options a { @@ -897,38 +898,28 @@ left:29px; .notice-options .notice_delete { right:0; } -.notice-options .notice_reply dt { -display:none; -} - .notice-options input, .notice-options a { text-indent:-9999px; outline:none; } - -.notice-options .notice_reply a, .notice-options input.submit { display:block; border:0; } -.notice-options .notice_reply a, -.notice-options .notice_delete a { +.notice-options .notice_reply, +.notice-options .notice_delete { text-decoration:none; padding-left:16px; } - .notice-options form input.submit { width:16px; padding:2px 0; } - -.notice-options .notice_delete dt, .notice-options .form_favor legend, .notice-options .form_disfavor legend { display:none; } -.notice-options .notice_delete fieldset, .notice-options .form_favor fieldset, .notice-options .form_disfavor fieldset { border:0; diff --git a/theme/biz/css/display.css b/theme/biz/css/display.css index 240060b104..7ea4515769 100644 --- a/theme/biz/css/display.css +++ b/theme/biz/css/display.css @@ -30,10 +30,10 @@ font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; } input, textarea, select, .entity_remote_subscribe { -border-color:#aaa; +border-color:#AAAAAA; } #filter_tags ul li { -border-color:#ddd; +border-color:#DDDDDD; } .form_settings input.form_action-primary { @@ -50,11 +50,14 @@ background-color:#9BB43E; input:focus, textarea:focus, select:focus, #form_notice.warning #notice_data-text { border-color:#9BB43E; +box-shadow:3px 3px 3px rgba(194, 194, 194, 0.3); +-moz-box-shadow:3px 3px 3px rgba(194, 194, 194, 0.3); +-webkit-box-shadow:3px 3px 3px rgba(194, 194, 194, 0.3); } input.submit, .entity_remote_subscribe, #site_nav_local_views a { -color:#fff; +color:#FFFFFF; } a, @@ -62,10 +65,13 @@ a, div.notice-options input, .form_user_block input.submit, .form_user_unblock input.submit, +.form_group_block input.submit, +.form_group_unblock input.submit, .entity_send-a-message a, .form_user_nudge input.submit, .entity_nudge p, -.form_settings input.form_action-primary { +.form_settings input.form_action-primary, +.form_make_admin input.submit { color:#002E6E; } @@ -82,13 +88,6 @@ border-top-color:#CEE1E9; border-top-color:#87B4C8; } -#content .notice p.entry-content a:visited { -background-color:#fcfcfc; -} -#content .notice p.entry-content .vcard a { -background-color:#fcfffc; -} - .aside .section { background-color:#F1F5F8; background-position:100% 0; @@ -97,10 +96,10 @@ background-repeat:no-repeat; } #notice_text-count { -color:#333; +color:#333333; } #form_notice.warning #notice_text-count { -color:#000; +color:#000000; } #form_notice label[for=notice_data-attach] { background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no-repeat 0 45%; @@ -109,28 +108,43 @@ background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no opacity:0; } -#form_notice.processing #notice_action-submit { -background:#fff url(../../base/images/icons/icon_processing.gif) no-repeat 47% 47%; +#wrap form.processing input.submit { +background:#FFFFFF url(../../base/images/icons/icon_processing.gif) no-repeat 47% 47%; cursor:wait; text-indent:-9999px; +outline:none; } +#content { +box-shadow:5px 7px 7px rgba(194, 194, 194, 0.3); +-moz-box-shadow:5px 7px 7px rgba(194, 194, 194, 0.3); +-webkit-box-shadow:5px 7px 7px rgba(194, 194, 194, 0.3); +} #content, #site_nav_local_views a, .aside .section { -border-color:#fff; +border-color:#FFFFFF; } #content, #site_nav_local_views .current a { -background-color:#fff; +background-color:#FFFFFF; } +#site_nav_local_views li { +box-shadow:3px 7px 5px rgba(194, 194, 194, 0.5); +-moz-box-shadow:3px 7px 5px rgba(194, 194, 194, 0.5); +-webkit-box-shadow:3px 7px 5px rgba(194, 194, 194, 0.5); +} #site_nav_local_views a { -background-color:rgba(135, 180, 200, 0.3); +background-color:rgba(194, 194, 194, 0.5); } #site_nav_local_views a:hover { background-color:rgba(255, 255, 255, 0.7); } +#site_nav_local_views .current a { +text-shadow: rgba(194,194,194,0.5) 1px 1px 1px; +} + .error { background-color:#F7E8E8; @@ -140,10 +154,7 @@ background-color:#EFF3DC; } #anon_notice { -color:#fff; -} - -#showstream #anon_notice { +color:#FFFFFF; } #export_data li a { @@ -165,7 +176,10 @@ background-image:url(../../base/images/icons/icon_foaf.gif); .form_user_nudge input.submit, .form_user_block input.submit, .form_user_unblock input.submit, -.entity_nudge p { +.form_group_block input.submit, +.form_group_unblock input.submit, +.entity_nudge p, +.form_make_admin input.submit { background-position: 0 40%; background-repeat: no-repeat; background-color:transparent; @@ -175,7 +189,7 @@ background-color:transparent; .form_user_subscribe input.submit, .form_user_unsubscribe input.submit { background-color:#9BB43E; -color:#fff; +color:#FFFFFF; } .form_user_unsubscribe input.submit, .form_group_leave input.submit, @@ -194,20 +208,23 @@ background-image:url(../../base/images/icons/twotone/green/quote.gif); background-image:url(../../base/images/icons/twotone/green/mail.gif); } .form_user_block input.submit, -.form_user_unblock input.submit { +.form_user_unblock input.submit, +.form_group_block input.submit, +.form_group_unblock input.submit { background-image:url(../../base/images/icons/twotone/green/shield.gif); } +.form_make_admin input.submit { +background-image:url(../../base/images/icons/twotone/green/admin.gif); +} /* NOTICES */ -.notices li.over { -background-color:#fcfcfc; +.notice .attachment { +background:transparent url(../../base/images/icons/twotone/green/clip-02.gif) no-repeat 0 45%; } - -.notice-options .notice_reply a, -.notice-options form input.submit { -background-color:transparent; +#attachments .attachment { +background:none; } -.notice-options .notice_reply a { +.notice-options .notice_reply { background:transparent url(../../base/images/icons/twotone/green/reply.gif) no-repeat 0 45%; } .notice-options form.form_favor input.submit { @@ -216,7 +233,7 @@ background:transparent url(../../base/images/icons/twotone/green/favourite.gif) .notice-options form.form_disfavor input.submit { background:transparent url(../../base/images/icons/twotone/green/disfavourite.gif) no-repeat 0 45%; } -.notice-options .notice_delete a { +.notice-options .notice_delete { background:transparent url(../../base/images/icons/twotone/green/trash.gif) no-repeat 0 45%; } @@ -224,19 +241,32 @@ background:transparent url(../../base/images/icons/twotone/green/trash.gif) no-r .notices div.notice-options { opacity:0.4; } -.notices li.hover div.entry-content, -.notices li.hover div.notice-options { +.notices li:hover div.entry-content, +.notices li:hover div.notice-options { opacity:1; } -div.entry-content { -color:#333; -} div.notice-options a, div.notice-options input { font-family:sans-serif; } -.notices li.hover { -background-color:#fcfcfc; +#content .notices li:hover { +background-color:rgba(240, 240, 240, 0.2); +} +#conversation .notices li:hover { +background-color:transparent; +} + +.notices .notices { +background-color:rgba(200, 200, 200, 0.050); +} +.notices .notices .notices { +background-color:rgba(200, 200, 200, 0.100); +} +.notices .notices .notices .notices { +background-color:rgba(200, 200, 200, 0.150); +} +.notices .notices .notices .notices .notices { +background-color:rgba(200, 200, 200, 0.300); } /*END: NOTICES */ From 7a910961b6e2b5f1fe21a4a9d0b66f5a7d911250 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 9 Sep 2009 13:04:05 +0200 Subject: [PATCH 17/57] Updated biz, cloudy, h4ck3r, pigeonthoughts themes default logos --- theme/biz/logo.png | Bin 2228 -> 6389 bytes theme/cloudy/logo.png | Bin 2228 -> 6389 bytes theme/h4ck3r/logo.png | Bin 2228 -> 6389 bytes theme/pigeonthoughts/logo.png | Bin 2228 -> 6389 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/theme/biz/logo.png b/theme/biz/logo.png index fdead6c4a0a23614552329ee68bb0860b0200a0c..550d373fef4005342c4e1daa7cb2c115db54f46c 100644 GIT binary patch literal 6389 zcmVEX>4Tx0C?J+Q)g6D=@vcr-tj1^HV42lZa2jn55j)S9!ipu-pd!uXCy!YnK{> z2n?1;Gf_2w45>mM5#WQz#Kz&|EGkvK~TfD`~gdX7S-06<0ofSs5oQvjd@0AR~wV&ec% zEdXFAf9BHwfSvf6djSAjlpz%XppgI|6J>}*0BAb^tj|`8MF3bZ02F3R#5n-iEdVe{ zS7t~6u(trf&JYW-00;~KFj0twDF6g}0AR=?BX|IWnE(_<@>e|ZE3OddDgXd@nX){& zBsoQaTL>+22Uk}v9w^R97b_GtVFF>AKrX_0nHe&HG!NkO%m4tOkrff(gY*4(&JM25 z&Nhy=4qq+mzXtyzVq)X|<DpKGaQJ>aJVl|9x!Kv}EM4F8AGNmGkLXs)P zCDQ+7;@>R$13uq10I+I40eg`xs9j?N_Dd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O*4+);&HB+mlT1n~2B8iM`+0000 Date: Wed, 9 Sep 2009 16:57:11 -0400 Subject: [PATCH 18/57] :: isn't a valid IPv6 address for our purposes --- lib/util.php | 4 ++-- tests/URLDetectionTest.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/util.php b/lib/util.php index 3dcd077a73..256acf1993 100644 --- a/lib/util.php +++ b/lib/util.php @@ -432,7 +432,7 @@ function common_replace_urls_callback($text, $callback, $notice_id = null) { ')'. '|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'. //IPv4 '|(?:'. //IPv6 - '\[?(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}(?:(?:[0-9A-Fa-f]{1,4})|:))|(?:(?:[0-9A-Fa-f]{1,4}:){6}(?::|(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})|(?::[0-9A-Fa-f]{1,4})))|(?:(?:[0-9A-Fa-f]{1,4}:){5}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?:(?:[0-9A-Fa-f]{1,4}:){4}(?::[0-9A-Fa-f]{1,4}){0,1}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?:(?:[0-9A-Fa-f]{1,4}:){3}(?::[0-9A-Fa-f]{1,4}){0,2}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?:(?:[0-9A-Fa-f]{1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{1,4}:){3}(?::[0-9A-Fa-f]{1,4}){0,2}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?:(?:[0-9A-Fa-f]{1,4}:){2}(?::[0-9A-Fa-f]{1,4}){0,3}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?:(?:[0-9A-Fa-f]{1,4}:)(?::[0-9A-Fa-f]{1,4}){0,4}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?::(?::[0-9A-Fa-f]{1,4}){0,5}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?:(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))\]?(?http://127.0.0.1'), array('127.0.0.1', From e2848eb8621dd645fa68cb1641c0af1df5530408 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 9 Sep 2009 22:57:15 -0400 Subject: [PATCH 19/57] If a shortened URL begins with http://, don't include it in the shortened url. Saves 7 characters, which is pretty awesome for 140 character max length notices. --- lib/util.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/util.php b/lib/util.php index 256acf1993..3e95d2bea3 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1414,6 +1414,9 @@ function common_shorten_url($long_url) curl_close($curlh); + if(substr($short_url,0,7)=='http://'){ + $short_url = substr($short_url,7); + } return $short_url; } From 4181c6f04ad6a2321b2957d8784abc7dfef5779f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 13 Sep 2009 17:53:15 -0700 Subject: [PATCH 20/57] bug 1814: installer now only offers DB types which are available. Abstracted a couple of hardcoded lists of mysql/pgsql checks and radio button creation to use a nice little array of names, installer funcs, and modules to check. Only those DB types whose modules are present will be presented in the installer; if all are missing, we throw an error and list out all the possibilities we were looking for. --- install.php | 52 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/install.php b/install.php index e828fa814b..092172d35f 100644 --- a/install.php +++ b/install.php @@ -181,6 +181,18 @@ $external_libraries=array( 'check_class'=>'Validate' ) ); +$dbModules = array( + 'mysql' => array( + 'name' => 'MySQL', + 'check_module' => 'mysql', // mysqli? + 'installer' => 'mysql_db_installer', + ), + 'pgsql' => array( + 'name' => 'PostgreSQL', + 'check_module' => 'pgsql', + 'installer' => 'pgsql_db_installer', + ), +); function main() { @@ -238,8 +250,18 @@ function checkPrereqs() $pass = false; } } - if (!checkExtension('pgsql') && !checkExtension('mysql')) { - ?>

Cannot find mysql or pgsql extension. You need one or the other:

$info) { + if (!checkExtension($info['check_module'])) { + $missingExtensions[] = $info['check_module']; + } + } + if (count($missingExtensions) == count($dbModules)) { + $req = implode(', ', $missingExtensions); + ?>

Cannot find database support. You need at least one of these PHP extensions installed:

$info) { + if (checkExtension($info['check_module'])) { + $dbRadios .= " $info[name]
\n"; + $checked = ''; + } + } echo<< @@ -376,8 +407,7 @@ function showForm()
  • - MySQL
    - PostgreSQL
    + $dbRadios

    Database type

  • @@ -465,17 +495,9 @@ function handlePost() return; } - // FIXME: use PEAR::DB or PDO instead of our own switch - - switch($dbtype) { - case 'mysql': - $db = mysql_db_installer($host, $database, $username, $password); - break; - case 'pgsql': - $db = pgsql_db_installer($host, $database, $username, $password); - break; - default: - } + global $dbModules; + $db = call_user_func($dbModules[$dbtype]['installer'], + $host, $database, $username, $password); if (!$db) { // database connection failed, do not move on to create config file. From 222ef4d1869485426e893f85caf8a3014f814faa Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Sep 2009 17:43:02 +1200 Subject: [PATCH 21/57] added doxygen tags --- install.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install.php b/install.php index 092172d35f..5754c717a1 100644 --- a/install.php +++ b/install.php @@ -1,5 +1,5 @@ . + * + * @category Installation + * @package Installation + * @license GNU Affero General Public License http://www.gnu.org/licenses/ + * */ + + define('INSTALLDIR', dirname(__FILE__)); From 711fe39700e868ad2cea595b109d2958752d4aa6 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Sep 2009 17:43:48 +1200 Subject: [PATCH 22/57] changed curly bracks on if, else, foreach to match pear code styles --- install.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/install.php b/install.php index 5754c717a1..75646c8526 100644 --- a/install.php +++ b/install.php @@ -203,14 +203,13 @@ $dbModules = array( function main() { - if (!checkPrereqs()) - { + if (!checkPrereqs()) { return; } - if( $_GET['checklibs'] ){ + if ($_GET['checklibs']) { showLibs(); - }else{ + } else { if ($_SERVER['REQUEST_METHOD'] == 'POST') { handlePost(); } else { @@ -221,13 +220,13 @@ function main() function haveExternalLibrary($external_library) { - if(isset($external_library['include']) && ! include_once($external_library['include'])){ + if (isset($external_library['include']) && ! include_once $external_library['include'] ) { return false; } - if(isset($external_library['check_function']) && ! function_exists($external_library['check_function'])){ + if (isset($external_library['check_function']) && ! function_exists($external_library['check_function'])) { return false; } - if(isset($external_library['check_class']) && ! class_exists($external_library['check_class'])){ + if (isset($external_library['check_class']) && ! class_exists($external_library['check_class'])) { return false; } return true; @@ -309,10 +308,10 @@ function showLibs() global $external_libraries; $present_libraries=array(); $absent_libraries=array(); - foreach($external_libraries as $external_library){ - if(haveExternalLibrary($external_library)){ + foreach ($external_libraries as $external_library){ + if (haveExternalLibrary($external_library)) { $present_libraries[]=$external_library; - }else{ + } else { $absent_libraries[]=$external_library; } } From c2e156dc492925d6aa94b91d5cee9ceb615bc2ab Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Sep 2009 17:44:22 +1200 Subject: [PATCH 23/57] added doxygen for main() --- install.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install.php b/install.php index 75646c8526..221e4746fe 100644 --- a/install.php +++ b/install.php @@ -201,6 +201,12 @@ $dbModules = array( ), ); +/** + * the actual installation. + * If call libraries are present, then install + * + * @return void + */ function main() { if (!checkPrereqs()) { From 20764dc08b0231e4be07c4e181c8603b005c20b5 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 14 Sep 2009 19:05:14 +1200 Subject: [PATCH 24/57] removed most of the that was making this hard to read Conflicts: install.php --- install.php | 56 +++++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/install.php b/install.php index 221e4746fe..6f8bff91ec 100644 --- a/install.php +++ b/install.php @@ -240,17 +240,16 @@ function haveExternalLibrary($external_library) function checkPrereqs() { - $pass = true; + $pass = true; if (file_exists(INSTALLDIR.'/config.php')) { - ?>

    Config file "config.php" already exists.

    - Config file "config.php" already exists.

    '); $pass = false; } if (version_compare(PHP_VERSION, '5.2.3', '<')) { - ?>

    Require PHP version 5.2.3 or greater.

    Require PHP version 5.2.3 or greater.

    '); + $pass = false; } $reqs = array('gd', 'curl', @@ -258,11 +257,10 @@ function checkPrereqs() foreach ($reqs as $req) { if (!checkExtension($req)) { - ?>

    Cannot load required extension:

    Cannot load required extension: %s

    ', $req); + $pass = false; } - } - + } // Make sure we have at least one database module available global $dbModules; $missingExtensions = array(); @@ -273,30 +271,28 @@ function checkPrereqs() } if (count($missingExtensions) == count($dbModules)) { $req = implode(', ', $missingExtensions); - ?>

    Cannot find database support. You need at least one of these PHP extensions installed:

    Cannot find mysql or pgsql extension. You need one or the other: %s

    ', $req); + $pass = false; + } + + if (!is_writable(INSTALLDIR)) { + printf('

    Cannot write config file to: %s

    ', INSTALLDIR); + printf('

    On your server, try this command: chmod a+w %s', INSTALLDIR); + $pass = false; } - if (!is_writable(INSTALLDIR)) { - ?>

    Cannot write config file to:

    -

    On your server, try this command: chmod a+w - Cannot write to %s directory: %s

    ', $fileSubdir, $fileFullPath); + printf('

    On your server, try this command: chmod a+w %s

    ', $fileFullPath); + $pass = false; + } + } - // Check the subdirs used for file uploads - $fileSubdirs = array('avatar', 'background', 'file'); - foreach ($fileSubdirs as $fileSubdir) { - $fileFullPath = INSTALLDIR."/$fileSubdir/"; - if (!is_writable($fileFullPath)) { - ?>

    Cannot write directory:

    -

    On your server, try this command: chmod a+w

    - Date: Sun, 13 Sep 2009 17:59:42 +1200 Subject: [PATCH 25/57] fixed missing semisolon --- install.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/install.php b/install.php index 6f8bff91ec..64c8fd9b14 100644 --- a/install.php +++ b/install.php @@ -444,10 +444,8 @@ E_O_T; function updateStatus($status, $error=false) { -?> -
  • >
  • - -$status"; } function handlePost() From 61d5d51cf55909e8fa2b4a362b47741a9cde25ae Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Sep 2009 18:22:32 +1200 Subject: [PATCH 26/57] lotsa tabulation changed to 4 spaces --- install.php | 185 +++++++++++++++++++++++++++------------------------- 1 file changed, 95 insertions(+), 90 deletions(-) diff --git a/install.php b/install.php index 64c8fd9b14..9d59f25b9d 100644 --- a/install.php +++ b/install.php @@ -450,9 +450,6 @@ function updateStatus($status, $error=false) function handlePost() { -?> - - + echo <<
    Page notice
      -server_encoding != 'UTF8') { - updateStatus("StatusNet requires UTF8 character encoding. Your database is ". htmlentities($record->server_encoding)); - showForm(); - return false; - } + //ensure database encoding is UTF8 + $record = pg_fetch_object(pg_query($conn, 'SHOW server_encoding')); + if ($record->server_encoding != 'UTF8') { + updateStatus("StatusNet requires UTF8 character encoding. Your database is ". htmlentities($record->server_encoding)); + showForm(); + return false; + } - updateStatus("Running database script..."); - //wrap in transaction; - pg_query($conn, 'BEGIN'); - $res = runDbScript(INSTALLDIR.'/db/statusnet_pg.sql', $conn, 'pgsql'); + updateStatus("Running database script..."); + //wrap in transaction; + pg_query($conn, 'BEGIN'); + $res = runDbScript(INSTALLDIR.'/db/statusnet_pg.sql', $conn, 'pgsql'); - if ($res === false) { - updateStatus("Can't run database script.", true); - showForm(); - return false; - } - foreach (array('sms_carrier' => 'SMS carrier', + if ($res === false) { + updateStatus("Can't run database script.", true); + showForm(); + return false; + } + foreach (array('sms_carrier' => 'SMS carrier', 'notice_source' => 'notice source', 'foreign_services' => 'foreign service') as $scr => $name) { - updateStatus(sprintf("Adding %s data to database...", $name)); - $res = runDbScript(INSTALLDIR.'/db/'.$scr.'.sql', $conn, 'pgsql'); - if ($res === false) { - updateStatus(sprintf("Can't run %d script.", $name), true); - showForm(); - return false; - } - } - pg_query($conn, 'COMMIT'); + updateStatus(sprintf("Adding %s data to database...", $name)); + $res = runDbScript(INSTALLDIR.'/db/'.$scr.'.sql', $conn, 'pgsql'); + if ($res === false) { + updateStatus(sprintf("Can't run %d script.", $name), true); + showForm(); + return false; + } + } + pg_query($conn, 'COMMIT'); - if (empty($password)) { - $sqlUrl = "pgsql://$username@$host/$database"; - } - else { - $sqlUrl = "pgsql://$username:$password@$host/$database"; - } + if (empty($password)) { + $sqlUrl = "pgsql://$username@$host/$database"; + } + else { + $sqlUrl = "pgsql://$username:$password@$host/$database"; + } - $db = array('type' => 'pgsql', 'database' => $sqlUrl); + $db = array('type' => 'pgsql', 'database' => $sqlUrl); - return $db; + return $db; } function mysql_db_installer($host, $database, $username, $password) { - updateStatus("Starting installation..."); - updateStatus("Checking database..."); + updateStatus("Starting installation..."); + updateStatus("Checking database..."); - $conn = mysql_connect($host, $username, $password); - if (!$conn) { - updateStatus("Can't connect to server '$host' as '$username'.", true); - showForm(); - return false; - } - updateStatus("Changing to database..."); - $res = mysql_select_db($database, $conn); - if (!$res) { - updateStatus("Can't change to database.", true); - showForm(); - return false; - } - updateStatus("Running database script..."); - $res = runDbScript(INSTALLDIR.'/db/statusnet.sql', $conn); - if ($res === false) { - updateStatus("Can't run database script.", true); - showForm(); - return false; - } - foreach (array('sms_carrier' => 'SMS carrier', + $conn = mysql_connect($host, $username, $password); + if (!$conn) { + updateStatus("Can't connect to server '$host' as '$username'.", true); + showForm(); + return false; + } + updateStatus("Changing to database..."); + $res = mysql_select_db($database, $conn); + if (!$res) { + updateStatus("Can't change to database.", true); + showForm(); + return false; + } + updateStatus("Running database script..."); + $res = runDbScript(INSTALLDIR.'/db/statusnet.sql', $conn); + if ($res === false) { + updateStatus("Can't run database script.", true); + showForm(); + return false; + } + foreach (array('sms_carrier' => 'SMS carrier', 'notice_source' => 'notice source', 'foreign_services' => 'foreign service') as $scr => $name) { - updateStatus(sprintf("Adding %s data to database...", $name)); - $res = runDbScript(INSTALLDIR.'/db/'.$scr.'.sql', $conn); - if ($res === false) { - updateStatus(sprintf("Can't run %d script.", $name), true); - showForm(); - return false; - } - } + updateStatus(sprintf("Adding %s data to database...", $name)); + $res = runDbScript(INSTALLDIR.'/db/'.$scr.'.sql', $conn); + if ($res === false) { + updateStatus(sprintf("Can't run %d script.", $name), true); + showForm(); + return false; + } + } - $sqlUrl = "mysqli://$username:$password@$host/$database"; - $db = array('type' => 'mysql', 'database' => $sqlUrl); - return $db; + $sqlUrl = "mysqli://$username:$password@$host/$database"; + $db = array('type' => 'mysql', 'database' => $sqlUrl); + return $db; } function writeConf($sitename, $server, $path, $fancy, $db) @@ -662,6 +659,14 @@ function writeConf($sitename, $server, $path, $fancy, $db) return $res; } +/** + * Install schema into the database + * + * @param filename $filename location of database schema file + * @param conn $conn connection to database + * @param type $type type of database, currently mysql or pgsql + * @return boolean - indicating success or failure + */ function runDbScript($filename, $conn, $type = 'mysql') { $sql = trim(file_get_contents($filename)); From 36aa89d6959d0d03f3fe3c769f867f314aba8bf9 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Sep 2009 18:29:10 +1200 Subject: [PATCH 27/57] many doxygen comments added --- install.php | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/install.php b/install.php index 9d59f25b9d..787edb20f0 100644 --- a/install.php +++ b/install.php @@ -224,6 +224,13 @@ function main() } } +/** + * checks if an external libary is present + * + * @param string $external_library Name of library + * + * @return boolean indicates if library present + */ function haveExternalLibrary($external_library) { if (isset($external_library['include']) && ! include_once $external_library['include'] ) { @@ -238,6 +245,11 @@ function haveExternalLibrary($external_library) return true; } +/** + * Check if all is ready for installation + * + * @return void + */ function checkPrereqs() { $pass = true; @@ -295,6 +307,13 @@ function checkPrereqs() return $pass; } +/** + * Checks if a php extension is both installed and loaded + * + * @param string $name of extension to check + * + * @return boolean whether extension is installed and loaded + */ function checkExtension($name) { if (!extension_loaded($name)) { @@ -305,6 +324,11 @@ function checkExtension($name) return true; } +/** + * Show list of libraries + * + * @return void + */ function showLibs() { global $external_libraries; @@ -356,9 +380,9 @@ E_O_T; foreach($present_libraries as $library) { echo '
    • '; - if($library['url']){ + if ($library['url']) { echo ''.htmlentities($library['name']).''; - }else{ + } else { echo htmlentities($library['name']); } echo '
    • '; From f5b7ea739660cf15abb92f534b30fc1cfd5e07c6 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Sep 2009 18:31:44 +1200 Subject: [PATCH 28/57] fixed up curly brackets and spaces around for, if, else --- install.php | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/install.php b/install.php index 787edb20f0..30c6780abc 100644 --- a/install.php +++ b/install.php @@ -334,7 +334,7 @@ function showLibs() global $external_libraries; $present_libraries=array(); $absent_libraries=array(); - foreach ($external_libraries as $external_library){ + foreach ($external_libraries as $external_library) { if (haveExternalLibrary($external_library)) { $present_libraries[]=$external_library; } else { @@ -352,22 +352,21 @@ function showLibs()

      Absent Libraries

        E_O_T; - foreach($absent_libraries as $library) - { + foreach ($absent_libraries as $library) { echo '
      • '; - if($library['url']){ + if ($library['url']) { echo ''.htmlentities($library['name']).''; - }else{ + } else { echo htmlentities($library['name']); } echo '
          '; - if($library['deb']){ + if ($library['deb']) { echo '
        • deb: ' . htmlentities($library['deb']) . '
        • '; } - if($library['rpm']){ + if ($library['rpm']) { echo '
        • rpm: ' . htmlentities($library['rpm']) . '
        • '; } - if($library['pear']){ + if ($library['pear']) { echo '
        • pear: ' . htmlentities($library['pear']) . '
        • '; } echo '
        '; @@ -377,8 +376,7 @@ E_O_T;

        Installed Libraries

          E_O_T; - foreach($present_libraries as $library) - { + foreach ($present_libraries as $library) { echo '
        • '; if ($library['url']) { echo ''.htmlentities($library['name']).''; @@ -514,11 +512,11 @@ STR; if (empty($sitename)) { updateStatus("No sitename specified.", true); - $fail = true; + $fail = true; } - if($fail){ - showForm(); + if ($fail) { + showForm(); return; } @@ -603,8 +601,7 @@ function pgsql_db_installer($host, $database, $username, $password) { if (empty($password)) { $sqlUrl = "pgsql://$username@$host/$database"; - } - else { + } else { $sqlUrl = "pgsql://$username:$password@$host/$database"; } From 93605dce99832868c3fdbb8af42db507a8005e97 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Sep 2009 18:32:59 +1200 Subject: [PATCH 29/57] removed commented out code we no longer want --- install.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/install.php b/install.php index 30c6780abc..6e7e833a30 100644 --- a/install.php +++ b/install.php @@ -505,11 +505,6 @@ STR; $fail = true; } -// if (empty($password)) { -// updateStatus("No password specified.", true); -// $fail = true; -// } - if (empty($sitename)) { updateStatus("No sitename specified.", true); $fail = true; From dbc08ef0a09e481e0884a38ee704f4d193edef6a Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 14 Sep 2009 19:08:05 +1200 Subject: [PATCH 30/57] most of code style errors gone Conflicts: install.php --- install.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/install.php b/install.php index 6e7e833a30..dea03fc5ec 100644 --- a/install.php +++ b/install.php @@ -516,8 +516,7 @@ STR; } global $dbModules; - $db = call_user_func($dbModules[$dbtype]['installer'], - $host, $database, $username, $password); + $db = call_user_func($dbModules[$dbtype]['installer'], $host, $database, $username, $password); if (!$db) { // database connection failed, do not move on to create config file. @@ -540,12 +539,10 @@ STR; updateStatus("StatusNet has been installed at $link"); updateStatus("You can visit your new StatusNet site."); -?> - - Date: Sun, 13 Sep 2009 20:15:21 +1200 Subject: [PATCH 31/57] added most of the required doxygen --- index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.php b/index.php index e2296549f3..83c14c4955 100644 --- a/index.php +++ b/index.php @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . + * + * @category StatusNet + * @package StatusNet + * @license GNU Affero General Public License http://www.gnu.org/licenses/ */ define('INSTALLDIR', dirname(__FILE__)); From a2f4fe7fc80fa851dd9293d64c4727d4bb233b90 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Sep 2009 20:16:07 +1200 Subject: [PATCH 32/57] fixed up if statements --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 83c14c4955..8f2a7cf7f8 100644 --- a/index.php +++ b/index.php @@ -49,11 +49,11 @@ function handleError($error) } $logmsg = "PEAR error: " . $error->getMessage(); - if(common_config('site', 'logdebug')) { + if (common_config('site', 'logdebug')) { $logmsg .= " : ". $error->getDebugInfo(); } common_log(LOG_ERR, $logmsg); - if(common_config('site', 'logdebug')) { + if (common_config('site', 'logdebug')) { $bt = $error->getBacktrace(); foreach ($bt as $line) { common_log(LOG_ERR, $line); From 738b6d1690ad595b85657fa282132459865fed93 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Sep 2009 20:31:19 +1200 Subject: [PATCH 33/57] lotsa of multiline if statements and function calls changed style to meat pear code style --- index.php | 54 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/index.php b/index.php index 8f2a7cf7f8..71de393246 100644 --- a/index.php +++ b/index.php @@ -33,7 +33,8 @@ $action = null; function getPath($req) { if ((common_config('site', 'fancy') || !array_key_exists('PATH_INFO', $_SERVER)) - && array_key_exists('p', $req)) { + && array_key_exists('p', $req) + ) { return $req['p']; } else if (array_key_exists('PATH_INFO', $_SERVER)) { return $_SERVER['PATH_INFO']; @@ -59,18 +60,25 @@ function handleError($error) common_log(LOG_ERR, $line); } } - if ($error instanceof DB_DataObject_Error || - $error instanceof DB_Error) { - $msg = sprintf(_('The database for %s isn\'t responding correctly, '. - 'so the site won\'t work properly. '. - 'The site admins probably know about the problem, '. - 'but you can contact them at %s to make sure. '. - 'Otherwise, wait a few minutes and try again.'), - common_config('site', 'name'), - common_config('site', 'email')); + if ($error instanceof DB_DataObject_Error + || $error instanceof DB_Error + ) { + $msg = sprintf( + _( + 'The database for %s isn\'t responding correctly, '. + 'so the site won\'t work properly. '. + 'The site admins probably know about the problem, '. + 'but you can contact them at %s to make sure. '. + 'Otherwise, wait a few minutes and try again.' + ), + common_config('site', 'name'), + common_config('site', 'email') + ); } else { - $msg = _('An important error occured, probably related to email setup. '. - 'Check logfiles for more info..'); + $msg = _( + 'An important error occured, probably related to email setup. '. + 'Check logfiles for more info..' + ); } $dac = new DBErrorAction($msg, 500); @@ -131,10 +139,11 @@ function main() $_lighty_url = @parse_url($_lighty_url); if ($_lighty_url['path'] != '/index.php' && $_lighty_url['path'] != '/') { - $_lighty_path = preg_replace('/^'.preg_quote(common_config('site','path')).'\//', '', substr($_lighty_url['path'], 1)); + $_lighty_path = preg_replace('/^'.preg_quote(common_config('site', 'path')).'\//', '', substr($_lighty_url['path'], 1)); $_SERVER['QUERY_STRING'] = 'p='.$_lighty_path; - if ($_lighty_url['query']) + if ($_lighty_url['query']) { $_SERVER['QUERY_STRING'] .= '&'.$_lighty_url['query']; + } parse_str($_lighty_url['query'], $_lighty_query); foreach ($_lighty_query as $key => $val) { $_GET[$key] = $_REQUEST[$key] = $val; @@ -145,7 +154,7 @@ function main() $_SERVER['REDIRECT_URL'] = preg_replace("/\?.+$/", "", $_SERVER['REQUEST_URI']); // quick check for fancy URL auto-detection support in installer. - if (isset($_SERVER['REDIRECT_URL']) && (preg_replace("/^\/$/","",(dirname($_SERVER['REQUEST_URI']))) . '/check-fancy') === $_SERVER['REDIRECT_URL']) { + if (isset($_SERVER['REDIRECT_URL']) && (preg_replace("/^\/$/", "", (dirname($_SERVER['REQUEST_URI']))) . '/check-fancy') === $_SERVER['REDIRECT_URL']) { die("Fancy URL support detection succeeded. We suggest you enable this to get fancy (pretty) URLs."); } global $user, $action; @@ -153,8 +162,12 @@ function main() Snapshot::check(); if (!_have_config()) { - $msg = sprintf(_("No configuration file found. Try running ". - "the installation program first.")); + $msg = sprintf( + _( + "No configuration file found. Try running ". + "the installation program first." + ) + ); $sac = new ServerErrorAction($msg); $sac->showPage(); return; @@ -200,9 +213,10 @@ function main() // If the site is private, and they're not on one of the "public" // parts of the site, redirect to login - if (!$user && common_config('site', 'private') && - !isLoginAction($action) && - !preg_match('/rss$/', $action)) { + if (!$user && common_config('site', 'private') + && !isLoginAction($action) + && !preg_match('/rss$/', $action) + ) { common_redirect(common_local_url('login')); return; } From 87c59fe8734479046c8433f74787f615484b3df7 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Sep 2009 20:32:58 +1200 Subject: [PATCH 34/57] fixed indentation for the pear code styles --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 71de393246..b8d9c7c69d 100644 --- a/index.php +++ b/index.php @@ -34,7 +34,7 @@ function getPath($req) { if ((common_config('site', 'fancy') || !array_key_exists('PATH_INFO', $_SERVER)) && array_key_exists('p', $req) - ) { + ) { return $req['p']; } else if (array_key_exists('PATH_INFO', $_SERVER)) { return $_SERVER['PATH_INFO']; From 5ca90e2c8cbc76693cf0f2278d14f2a35da7e34e Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 14 Sep 2009 19:19:11 +1200 Subject: [PATCH 35/57] pulled @author from git logs Conflicts: install.php --- index.php | 14 ++++++++++++++ install.php | 21 ++++++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index b8d9c7c69d..a1d983dce7 100644 --- a/index.php +++ b/index.php @@ -19,6 +19,20 @@ * @category StatusNet * @package StatusNet * @license GNU Affero General Public License http://www.gnu.org/licenses/ + * @author Brenda Wallace + * @author Christopher Vollick + * @author CiaranG + * @author Craig Andrews + * @author Evan Prodromou + * @author Evan Prodromou + * @author Evan Prodromou + * @author Evan Prodromou + * @author Gina Haeussge + * @author Jeffery To + * @author Mike Cochrane + * @author Robin Millette + * @author Sarven Capadisli + * @author Tom Adams */ define('INSTALLDIR', dirname(__FILE__)); diff --git a/install.php b/install.php index dea03fc5ec..07a7bfaaf7 100644 --- a/install.php +++ b/install.php @@ -18,12 +18,22 @@ * * @category Installation * @package Installation - * @license GNU Affero General Public License http://www.gnu.org/licenses/ * + * @author Adrian Lang + * @author Brenda Wallace + * @author Brett Taylor + * @author Brion Vibber + * @author CiaranG + * @author Craig Andrews + * @author Eric Helgeson + * @author Evan Prodromou + * @author Evan Prodromou + * @author Robin Millette + * @author Sarven Capadisli + * @author Tom Adams + * @license GNU Affero General Public License http://www.gnu.org/licenses/ */ - - define('INSTALLDIR', dirname(__FILE__)); $external_libraries=array( @@ -281,6 +291,7 @@ function checkPrereqs() $missingExtensions[] = $info['check_module']; } } + if (count($missingExtensions) == count($dbModules)) { $req = implode(', ', $missingExtensions); printf('

          Cannot find mysql or pgsql extension. You need one or the other: %s

          ', $req); @@ -682,7 +693,7 @@ function writeConf($sitename, $server, $path, $fancy, $db) * * @return boolean - indicating success or failure */ -function runDbScript($filename, $conn, $type = 'mysql') +function runDbScript($filename, $conn, $type = 'mysqli') { $sql = trim(file_get_contents($filename)); $stmts = explode(';', $sql); @@ -693,7 +704,7 @@ function runDbScript($filename, $conn, $type = 'mysql') } // FIXME: use PEAR::DB or PDO instead of our own switch switch ($type) { - case 'mysql': + case 'mysqli': $res = mysql_query($stmt, $conn); if ($res === false) { $error = mysql_error(); From 84da24aba41b459ad8b2735328e257275c0f6136 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Sep 2009 21:27:34 +1200 Subject: [PATCH 36/57] cleaned up code style --- actions/all.php | 82 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 24 deletions(-) diff --git a/actions/all.php b/actions/all.php index 29a19afb6b..e56e10c21f 100644 --- a/actions/all.php +++ b/actions/all.php @@ -1,5 +1,5 @@ . + * + * @category Actions + * @package Actions + * @author Evan Prodromou + * @author Evan Prodromou + * @author Mike Cochrane + * @author Robin Millette + * @author Adrian Lang + * @author Meitar Moscovitz + * @author Sarven Capadisli + * @author Craig Andrews + * @author Evan Prodromou + * @author Evan Prodromou + * @author Jeffery To + * @author Zach Copley + * @author csarven + * @license GNU Affero General Public License http://www.gnu.org/licenses/ + * @link http://status.net */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { + exit(1); +} require_once INSTALLDIR.'/lib/personalgroupnav.php'; require_once INSTALLDIR.'/lib/noticelist.php'; @@ -43,8 +63,8 @@ class AllAction extends ProfileAction $this->notice = $this->user->noticesWithFriends(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); } - if($this->page > 1 && $this->notice->N == 0){ - $this->serverError(_('No such page'),$code=404); + if ($this->page > 1 && $this->notice->N == 0) { + $this->serverError(_('No such page'), $code = 404); } return true; @@ -73,20 +93,33 @@ class AllAction extends ProfileAction function getFeeds() { - return array(new Feed(Feed::RSS1, - common_local_url('allrss', array('nickname' => - $this->user->nickname)), - sprintf(_('Feed for friends of %s (RSS 1.0)'), $this->user->nickname)), - new Feed(Feed::RSS2, - common_local_url('api', array('apiaction' => 'statuses', - 'method' => 'friends_timeline', - 'argument' => $this->user->nickname.'.rss')), - sprintf(_('Feed for friends of %s (RSS 2.0)'), $this->user->nickname)), - new Feed(Feed::ATOM, - common_local_url('api', array('apiaction' => 'statuses', - 'method' => 'friends_timeline', - 'argument' => $this->user->nickname.'.atom')), - sprintf(_('Feed for friends of %s (Atom)'), $this->user->nickname))); + return array( + new Feed(Feed::RSS1, + common_local_url( + 'allrss', array( + 'nickname' => + $this->user->nickname) + ), + sprintf(_('Feed for friends of %s (RSS 1.0)'), $this->user->nickname)), + new Feed(Feed::RSS2, + common_local_url( + 'api', array( + 'apiaction' => 'statuses', + 'method' => 'friends_timeline', + 'argument' => $this->user->nickname.'.rss' + ) + ), + sprintf(_('Feed for friends of %s (RSS 2.0)'), $this->user->nickname)), + new Feed(Feed::ATOM, + common_local_url( + 'api', array( + 'apiaction' => 'statuses', + 'method' => 'friends_timeline', + 'argument' => $this->user->nickname.'.atom' + ) + ), + sprintf(_('Feed for friends of %s (Atom)'), $this->user->nickname)) + ); } function showLocalNav() @@ -106,8 +139,7 @@ class AllAction extends ProfileAction } else { $message .= sprintf(_('You can try to [nudge %s](../%s) from his profile or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname); } - } - else { + } else { $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname); } @@ -126,17 +158,19 @@ class AllAction extends ProfileAction $this->showEmptyListMessage(); } - $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, - $this->page, 'all', array('nickname' => $this->user->nickname)); + $this->pagination( + $this->page > 1, $cnt > NOTICES_PER_PAGE, + $this->page, 'all', array('nickname' => $this->user->nickname) + ); } function showPageTitle() { $user =& common_current_user(); if ($user && ($user->id == $this->user->id)) { - $this->element('h1', NULL, _("You and friends")); + $this->element('h1', null, _("You and friends")); } else { - $this->element('h1', NULL, sprintf(_('%s and friends'), $this->user->nickname)); + $this->element('h1', null, sprintf(_('%s and friends'), $this->user->nickname)); } } From fcff85bb3610a0f2a77bfa72cf26ce8019ec0378 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Sep 2009 21:55:45 +1200 Subject: [PATCH 37/57] code style cleanup --- actions/api.php | 100 ++++++++++++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 42 deletions(-) diff --git a/actions/api.php b/actions/api.php index c236378bcb..9b5f548074 100644 --- a/actions/api.php +++ b/actions/api.php @@ -1,5 +1,5 @@ . + * + * @category Actions + * @package Actions + * @author Evan Prodromou + * @author Evan Prodromou + * @author Brenda Wallace + * @author Jeffery To + * @author Robin Millette + * @author Tom Adams + * @author Christopher Vollick + * @author CiaranG + * @author Craig Andrews + * @author Evan Prodromou + * @author Evan Prodromou + * @author Gina Haeussge + * @author Mike Cochrane + * @author Sarven Capadisli + * @license GNU Affero General Public License http://www.gnu.org/licenses/ + * @link http://status.net */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { + exit(1); +} class ApiAction extends Action { @@ -37,7 +58,7 @@ class ApiAction extends Action $this->api_action = $this->arg('apiaction'); $method = $this->arg('method'); $argument = $this->arg('argument'); - $this->basic_auth_process_header(); + $this->basic_auth_process_header(); if (isset($argument)) { $cmdext = explode('.', $argument); @@ -46,7 +67,7 @@ class ApiAction extends Action $this->content_type = strtolower($cmdext[1]); } else { - # Requested format / content-type will be an extension on the method + //Requested format / content-type will be an extension on the method $cmdext = explode('.', $method); $this->api_method = $cmdext[0]; $this->content_type = strtolower($cmdext[1]); @@ -55,10 +76,10 @@ class ApiAction extends Action if ($this->requires_auth()) { if (!isset($this->auth_user)) { - # This header makes basic auth go + //This header makes basic auth go header('WWW-Authenticate: Basic realm="StatusNet API"'); - # If the user hits cancel -- bam! + //If the user hits cancel -- bam! $this->show_basic_auth_error(); } else { $nickname = $this->auth_user; @@ -69,7 +90,7 @@ class ApiAction extends Action $this->user = $user; $this->process_command(); } else { - # basic authentication failed + //basic authentication failed list($proxy, $ip) = common_client_ip(); common_log(LOG_WARNING, "Failed API auth attempt, nickname = $nickname, proxy = $proxy, ip = $ip."); @@ -84,7 +105,7 @@ class ApiAction extends Action if ($user) { $this->user = $user; } - # Twitter doesn't throw an error if the user isn't found + //Twitter doesn't throw an error if the user isn't found } $this->process_command(); @@ -97,7 +118,7 @@ class ApiAction extends Action $actionfile = INSTALLDIR."/actions/$action.php"; if (file_exists($actionfile)) { - require_once($actionfile); + include_once $actionfile; $action_class = ucfirst($action)."Action"; $action_obj = new $action_class(); @@ -113,10 +134,10 @@ class ApiAction extends Action call_user_func(array($action_obj, $this->api_method), $_REQUEST, $apidata); } else { - $this->clientError("API method not found!", $code=404); + $this->clientError("API method not found!", $code = 404); } } else { - $this->clientError("API method not found!", $code=404); + $this->clientError("API method not found!", $code = 404); } } @@ -184,10 +205,11 @@ class ApiAction extends Action $user_id = $this->arg('user_id'); $screen_name = $this->arg('screen_name'); - if (empty($this->api_arg) && - empty($id) && - empty($user_id) && - empty($screen_name)) { + if (empty($this->api_arg) + && empty($id) + && empty($user_id) + && empty($screen_name) + ) { return true; } else { return false; @@ -208,35 +230,29 @@ class ApiAction extends Action function basic_auth_process_header() { - 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') ) - { - // decode the HTTP_AUTHORIZATION header on php-cgi server self - // on fcgid server the header name is 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')) { + // decode the HTTP_AUTHORIZATION header on php-cgi server self + // on fcgid server the header name is AUTHORIZATION - $auth_hash = base64_decode( substr($authorization_header, 6) ); - list($this->auth_user, $this->auth_pw) = explode(':', $auth_hash); + $auth_hash = base64_decode(substr($authorization_header, 6)); + 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; - } - } - else - { - $this->auth_user = NULL; - $this->auth_pw = NULL; - } + // set all to null on a empty basic auth request + if ($this->auth_user == "") { + $this->auth_user = null; + $this->auth_pw = null; + } + } else { + $this->auth_user = null; + $this->auth_pw = null; + } } function show_basic_auth_error() @@ -252,7 +268,7 @@ class ApiAction extends Action $this->element('request', null, $_SERVER['REQUEST_URI']); $this->elementEnd('hash'); $this->endXML(); - } else if ($this->content_type == 'json') { + } else if ($this->content_type == 'json') { header('Content-Type: application/json; charset=utf-8'); $error_array = array('error' => $msg, 'request' => $_SERVER['REQUEST_URI']); print(json_encode($error_array)); From 5bad7040b14bf61d84cc33c8b4cf2af3b5861d3b Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Mon, 14 Sep 2009 22:08:17 +0200 Subject: [PATCH 38/57] Fix bad merge d7ae0ed4fd755ebad0788a17d0f2fb6a6ca9d63b --- lib/omb.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/omb.php b/lib/omb.php index 9133af7a05..0566701ff1 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -80,14 +80,9 @@ function omb_broadcast_notice($notice) $posted = array(); while ($rp->fetch()) { - if (!array_key_exists($rp->postnoticeurl, $posted)) { - common_log(LOG_DEBUG, 'Posting to ' . $rp->postnoticeurl); - if (omb_post_notice_keys($notice, $rp->postnoticeurl, $rp->token, $rp->secret)) { - common_log(LOG_DEBUG, 'Finished to ' . $rp->postnoticeurl); - $posted[$rp->postnoticeurl] = true; - } else { - common_log(LOG_DEBUG, 'Failed posting to ' . $rp->postnoticeurl); - } + if (isset($posted[$rp->postnoticeurl])) { + /* We already posted to this url. */ + continue; } common_debug('Posting to ' . $rp->postnoticeurl, __FILE__); From 4081ed79b02fd06f7c347803478e1f835311c2ab Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 15 Sep 2009 12:59:32 -0700 Subject: [PATCH 39/57] Make it impossible to delete self-subscriptions via the API --- actions/twitapifriendships.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index f2ea46910e..eea8945c39 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -99,6 +99,12 @@ class TwitapifriendshipsAction extends TwitterapiAction $other = $this->get_profile($id); $user = $apidata['user']; // Alwyas the auth user + if ($user->id == $other->id) { + $this->clientError(_("You cannot unfollow yourself!"), + 403, $apidata['content-type']); + return; + } + $sub = new Subscription(); $sub->subscriber = $user->id; $sub->subscribed = $other->id; From 38409f1683351ae2b9bc932d441c6021a8b2aae7 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 15 Sep 2009 14:37:11 -0700 Subject: [PATCH 40/57] Add Jiminy to notice sources --- db/notice_source.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/notice_source.sql b/db/notice_source.sql index f590d1b97a..2657763f44 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -21,6 +21,7 @@ VALUES ('identichat','identichat','http://identichat.prosody.im/', now()), ('IdentiFox','IdentiFox','http://www.bitbucket.org/uncryptic/identifox/', now()), ('identitwitch','IdentiTwitch','http://richfish.org/identitwitch/', now()), + ('Jiminy','Jiminy','http://code.google.com/p/jiminy/', now()), ('LaTwit','LaTwit','http://latwit.mac65.com/', now()), ('LiveTweeter', 'LiveTweeter', 'http://addons.songbirdnest.com/addon/1204', now()), ('livetweeter', 'livetweeter', 'http://addons.songbirdnest.com/addon/1204', now()), From 94466da35afcb0b1680a478964b58fbc7970f4ec Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 15 Sep 2009 16:31:09 -0700 Subject: [PATCH 41/57] Got rid of a bunch of ugly warnings --- install.php | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/install.php b/install.php index 07a7bfaaf7..a8f1ef4e24 100644 --- a/install.php +++ b/install.php @@ -1,5 +1,5 @@ . - * + * * @category Installation * @package Installation - * + * * @author Adrian Lang * @author Brenda Wallace * @author Brett Taylor @@ -33,7 +33,7 @@ * @author Tom Adams * @license GNU Affero General Public License http://www.gnu.org/licenses/ */ - + define('INSTALLDIR', dirname(__FILE__)); $external_libraries=array( @@ -211,10 +211,10 @@ $dbModules = array( ), ); -/** +/** * the actual installation. * If call libraries are present, then install - * + * * @return void */ function main() @@ -222,8 +222,8 @@ function main() if (!checkPrereqs()) { return; } - - if ($_GET['checklibs']) { + + if (!empty($_GET['checklibs'])) { showLibs(); } else { if ($_SERVER['REQUEST_METHOD'] == 'POST') { @@ -243,7 +243,7 @@ function main() */ function haveExternalLibrary($external_library) { - if (isset($external_library['include']) && ! include_once $external_library['include'] ) { + if (isset($external_library['include']) && ! @include_once $external_library['include'] ) { return false; } if (isset($external_library['check_function']) && ! function_exists($external_library['check_function'])) { @@ -282,7 +282,7 @@ function checkPrereqs() printf('

          Cannot load required extension: %s

          ', $req); $pass = false; } - } + } // Make sure we have at least one database module available global $dbModules; $missingExtensions = array(); @@ -291,13 +291,13 @@ function checkPrereqs() $missingExtensions[] = $info['check_module']; } } - + if (count($missingExtensions) == count($dbModules)) { $req = implode(', ', $missingExtensions); - printf('

          Cannot find mysql or pgsql extension. You need one or the other: %s

          ', $req); + printf('

          Cannot find mysql or pgsql extension. You need one or the other.'); $pass = false; } - + if (!is_writable(INSTALLDIR)) { printf('

          Cannot write config file to: %s

          ', INSTALLDIR); printf('

          On your server, try this command: chmod a+w %s', INSTALLDIR); @@ -365,19 +365,19 @@ function showLibs() E_O_T; foreach ($absent_libraries as $library) { echo '

        • '; - if ($library['url']) { + if (isset($library['url'])) { echo ''.htmlentities($library['name']).''; } else { echo htmlentities($library['name']); } echo '
            '; - if ($library['deb']) { + if (isset($library['deb'])) { echo '
          • deb: ' . htmlentities($library['deb']) . '
          • '; } - if ($library['rpm']) { + if (isset($library['rpm'])) { echo '
          • rpm: ' . htmlentities($library['rpm']) . '
          • '; } - if ($library['pear']) { + if (isset($library['pear'])) { echo '
          • pear: ' . htmlentities($library['pear']) . '
          • '; } echo '
          '; @@ -552,7 +552,7 @@ STR; updateStatus("You can visit your new StatusNet site."); } -function Pgsql_Db_installer($host, $database, $username, $password) +function Pgsql_Db_installer($host, $database, $username, $password) { $connstring = "dbname=$database host=$host user=$username"; @@ -613,7 +613,7 @@ function Pgsql_Db_installer($host, $database, $username, $password) return $db; } -function Mysql_Db_installer($host, $database, $username, $password) +function Mysql_Db_installer($host, $database, $username, $password) { updateStatus("Starting installation..."); updateStatus("Checking database..."); @@ -690,7 +690,7 @@ function writeConf($sitename, $server, $path, $fancy, $db) * @param string $filename location of database schema file * @param dbconn $conn connection to database * @param string $type type of database, currently mysql or pgsql - * + * * @return boolean - indicating success or failure */ function runDbScript($filename, $conn, $type = 'mysqli') From e29046b3a121db6aa95f94d4114467d0e747c6a7 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 15 Sep 2009 16:46:18 -0700 Subject: [PATCH 42/57] Fixed broken list items in installer output --- install.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install.php b/install.php index a8f1ef4e24..54ae0cd5e1 100644 --- a/install.php +++ b/install.php @@ -477,7 +477,11 @@ E_O_T; function updateStatus($status, $error=false) { - echo '
        • $status
        • "; } From 46ece1178ce87697e95e5c90daafced142486e56 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 21:12:44 -0400 Subject: [PATCH 43/57] check correct define (not backwards compatible) --- classes/Config.php | 4 +++- classes/Deleted_notice.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/classes/Config.php b/classes/Config.php index 5bec13fdc8..92f237d7f2 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -17,7 +17,9 @@ * along with this program. If not, see . */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET')) { + exit(1); +} /** * Table Definition for config diff --git a/classes/Deleted_notice.php b/classes/Deleted_notice.php index 474d0b6f41..64dc85da65 100644 --- a/classes/Deleted_notice.php +++ b/classes/Deleted_notice.php @@ -17,7 +17,9 @@ * along with this program. If not, see . */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET')) { + exit(1); +} /** * Table Definition for notice From d44bc16ee989af7f5ebbd6a40edcc7a4d90902a0 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 26 Mar 2009 15:26:19 -0400 Subject: [PATCH 44/57] Start a common library for HTTP client stuff --- lib/httputil.php | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 lib/httputil.php diff --git a/lib/httputil.php b/lib/httputil.php new file mode 100644 index 0000000000..5c1f4f3e11 --- /dev/null +++ b/lib/httputil.php @@ -0,0 +1,80 @@ +. + * + * @category Action + * @package Laconica + * @author Evan Prodromou + * @copyright 2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Utility class for doing HTTP-related stuff + * + * We make HTTP calls in several places, and we have several different + * ways of doing them. This class hides the specifics of what underlying + * library (curl or PHP-HTTP or whatever) that's used. + * + * @category HTTP + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +class HTTPResponse +{ + var $code = null; + var $headers = null; + var $body = null; +} + +class HTTPClientUtil +{ + function __construct() + { + } + + function head($url, $headers) + { + } + + function get($url, $headers) + { + } + + function post($url, $headers, $body) + { + } + + function put($url, $headers, $body) + { + } + + function delete($url, $headers) + { + } +} From 20dd0db7049209a5f43697d8bba8eadb63736bce Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 20:29:41 -0400 Subject: [PATCH 45/57] move httputil to httpclient --- lib/{httputil.php => httpclient.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{httputil.php => httpclient.php} (100%) diff --git a/lib/httputil.php b/lib/httpclient.php similarity index 100% rename from lib/httputil.php rename to lib/httpclient.php From ae20d073ce8cb393417be6f05cdf54289ecd5bad Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 20:40:03 -0400 Subject: [PATCH 46/57] update httpclient class --- lib/httpclient.php | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/lib/httpclient.php b/lib/httpclient.php index 5c1f4f3e11..145409f509 100644 --- a/lib/httpclient.php +++ b/lib/httpclient.php @@ -32,7 +32,7 @@ if (!defined('LACONICA')) { } /** - * Utility class for doing HTTP-related stuff + * Useful structure for HTTP responses * * We make HTTP calls in several places, and we have several different * ways of doing them. This class hides the specifics of what underlying @@ -52,29 +52,66 @@ class HTTPResponse var $body = null; } -class HTTPClientUtil +/** + * Utility class for doing HTTP client stuff + * + * We make HTTP calls in several places, and we have several different + * ways of doing them. This class hides the specifics of what underlying + * library (curl or PHP-HTTP or whatever) that's used. + * + * @category HTTP + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +class HTTPClient { - function __construct() + static $_client = null; + + static function start() { + if (!is_null(self::$_client)) { + return self::$_client; + } + + $type = common_config('http', 'client'); + + switch ($type) { + case 'curl': + self::$_client = new CurlClient(); + break; + default: + throw new Exception("Unknown HTTP client type '$type'"); + break; + } + + return self::$_client; } function head($url, $headers) { + throw new Exception("HEAD method unimplemented"); } function get($url, $headers) { + throw new Exception("GET method unimplemented"); } function post($url, $headers, $body) { + throw new Exception("POST method unimplemented"); } function put($url, $headers, $body) { + throw new Exception("PUT method unimplemented"); } function delete($url, $headers) { + throw new Exception("DELETE method unimplemented"); } } From 3380b49aecb773ebadfe4a8e563f75ce4855e1a2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 20:40:18 -0400 Subject: [PATCH 47/57] add http client config value --- lib/common.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/common.php b/lib/common.php index 3b21b548cf..194eb568f7 100644 --- a/lib/common.php +++ b/lib/common.php @@ -284,6 +284,8 @@ $config = array('contentlimit' => null), 'message' => array('contentlimit' => null), + 'http' => + array('client' => 'curl'), // XXX: should this be the default? ); $config['db'] = &PEAR::getStaticProperty('DB_DataObject','options'); From 99c74f2cc4b2a2c62d4188c862fec96caec44c06 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 21:22:15 -0400 Subject: [PATCH 48/57] statusize OpenID plugin --- plugins/OpenID/OpenIDPlugin.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php index eb450fc5e5..91bddf381f 100644 --- a/plugins/OpenID/OpenIDPlugin.php +++ b/plugins/OpenID/OpenIDPlugin.php @@ -1,6 +1,6 @@ . * * @category Plugin - * @package Laconica - * @author Evan Prodromou - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @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://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } @@ -36,10 +36,10 @@ if (!defined('LACONICA')) { * and identity system. * * @category Plugin - * @package Laconica - * @author Evan Prodromou + * @package StatusNet + * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * @link http://openid.net/ */ From 8ceb4196f323295742fd1113ff014ebee9ad7ae3 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 21:22:47 -0400 Subject: [PATCH 49/57] add user agent and correct version check to httpclient --- lib/httpclient.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/httpclient.php b/lib/httpclient.php index 145409f509..d606f5a6e9 100644 --- a/lib/httpclient.php +++ b/lib/httpclient.php @@ -27,7 +27,7 @@ * @link http://laconi.ca/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } @@ -114,4 +114,9 @@ class HTTPClient { throw new Exception("DELETE method unimplemented"); } + + function userAgent() + { + return "StatusNet/".STATUSNET_VERSION." (".STATUSNET_CODENAME.")"; + } } From 9a9a0ae56f5ae65144e6da5014859b1e30044f8b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 21:50:19 -0400 Subject: [PATCH 50/57] add cURL client with HEAD method --- lib/curlclient.php | 134 +++++++++++++++++++++++++++++++++++++++++++++ lib/httpclient.php | 6 +- 2 files changed, 137 insertions(+), 3 deletions(-) create mode 100644 lib/curlclient.php diff --git a/lib/curlclient.php b/lib/curlclient.php new file mode 100644 index 0000000000..e027102e36 --- /dev/null +++ b/lib/curlclient.php @@ -0,0 +1,134 @@ +n. + * + * @category HTTP + * @package Laconica + * @author Evan Prodromou + * @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://laconi.ca/ + */ + +if (!defined('STATUSNET')) { + exit(1); +} + +define(CURLCLIENT_VERSION, "0.1"); + +/** + * Wrapper for Curl + * + * Makes Curl HTTP client calls within our HTTPClient framework + * + * @category HTTP + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +class CurlClient extends HTTPClient +{ + function __construct() + { + } + + function head($url, $headers=null) + { + $ch = curl_init($url); + + $this->setup($ch); + + curl_setopt_array($ch, + array(CURLOPT_NOBODY => true)); + + $result = curl_exec($ch); + + return $this->parseResults($result); + } + + function setup($ch) + { + curl_setopt_array($ch, + array(CURLOPT_USERAGENT, $this->userAgent(), + CURLOPT_HEADER => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_HTTPHEADER => $headers)); + } + + function userAgent() + { + $version = curl_version(); + return parent::userAgent() . " CurlClient/".CURLCLIENT_VERSION . " cURL/" . $version['version']; + } + + function parseResults($results) + { + $resp = new HTTPResponse(); + + $lines = explode("\r\n", $results); + + if (preg_match("#^HTTP/1.[01] (\d\d\d) .+$#", $lines[0], $match)) { + $resp->code = $match[1]; + } else { + throw Exception("Bad format: initial line is not HTTP status line"); + } + + $lastk = null; + + for ($i = 1; $i < count($lines); $i++) { + $l =& $lines[$i]; + if (mb_strlen($l) == 0) { + $resp->body = implode("\r\n", array_slice($lines, $i + 1)); + break; + } + if (preg_match("#^(\S+):\s+(.*)$#", $l, $match)) { + $k = $match[1]; + $v = $match[2]; + + if (array_key_exists($k, $resp->headers)) { + if (is_array($resp->headers[$k])) { + $resp->headers[$k][] = $v; + } else { + $resp->headers[$k] = array($resp->headers[$k], $v); + } + } else { + $resp->headers[$k] = $v; + } + $lastk = $k; + } else if (preg_match("#^\s+(.*)$#", $l, $match)) { + // continuation line + if (is_null($lastk)) { + throw Exception("Bad format: initial whitespace in headers"); + } + $h =& $resp->headers[$lastk]; + if (is_array($h)) { + $n = count($h); + $h[$n-1] .= $match[1]; + } else { + $h .= $match[1]; + } + } + } + + return $resp; + } +} diff --git a/lib/httpclient.php b/lib/httpclient.php index d606f5a6e9..9b0bb6f3a5 100644 --- a/lib/httpclient.php +++ b/lib/httpclient.php @@ -47,9 +47,9 @@ if (!defined('STATUSNET')) { class HTTPResponse { - var $code = null; - var $headers = null; - var $body = null; + public $code = null; + public $headers = null; + public $body = null; } /** From 6b7f09eba675679d5ea84ed33e85fa9d5c62a30d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 21:55:36 -0400 Subject: [PATCH 51/57] add get to curl client --- lib/curlclient.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/curlclient.php b/lib/curlclient.php index e027102e36..f45c3c2f4a 100644 --- a/lib/curlclient.php +++ b/lib/curlclient.php @@ -60,8 +60,31 @@ class CurlClient extends HTTPClient curl_setopt_array($ch, array(CURLOPT_NOBODY => true)); + if (!is_null($headers)) { + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + } + $result = curl_exec($ch); + curl_close($ch); + + return $this->parseResults($result); + } + + function get($url, $headers=null) + { + $ch = curl_init($url); + + $this->setup($ch); + + if (!is_null($headers)) { + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + } + + $result = curl_exec($ch); + + curl_close($ch); + return $this->parseResults($result); } @@ -70,8 +93,7 @@ class CurlClient extends HTTPClient curl_setopt_array($ch, array(CURLOPT_USERAGENT, $this->userAgent(), CURLOPT_HEADER => true, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => $headers)); + CURLOPT_RETURNTRANSFER => true)); } function userAgent() From f8a8c14b550a3ac3a4b3a17c53559056f70409b2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 22:05:57 -0400 Subject: [PATCH 52/57] fix user-agent for curlclient --- lib/curlclient.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/curlclient.php b/lib/curlclient.php index f45c3c2f4a..99c3b6aa41 100644 --- a/lib/curlclient.php +++ b/lib/curlclient.php @@ -88,10 +88,14 @@ class CurlClient extends HTTPClient return $this->parseResults($result); } + function post($url, $headers=null) + { + } + function setup($ch) { curl_setopt_array($ch, - array(CURLOPT_USERAGENT, $this->userAgent(), + array(CURLOPT_USERAGENT => $this->userAgent(), CURLOPT_HEADER => true, CURLOPT_RETURNTRANSFER => true)); } From 2f97531a49c042a0a900edb31f067a3c9f32967f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 22:14:15 -0400 Subject: [PATCH 53/57] add post to curlclient --- lib/curlclient.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/curlclient.php b/lib/curlclient.php index 99c3b6aa41..c43bfb57f7 100644 --- a/lib/curlclient.php +++ b/lib/curlclient.php @@ -88,8 +88,27 @@ class CurlClient extends HTTPClient return $this->parseResults($result); } - function post($url, $headers=null) + function post($url, $headers=null, $body=null) { + $ch = curl_init($url); + + $this->setup($ch); + + curl_setopt($ch, CURLOPT_POST, true); + + if (!is_null($body)) { + curl_setopt($ch, CURLOPT_POSTFIELDS, $body); + } + + if (!is_null($headers)) { + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + } + + $result = curl_exec($ch); + + curl_close($ch); + + return $this->parseResults($result); } function setup($ch) From 6f531745ca21e7b5460be90890c55b1934a45f15 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 22:28:59 -0400 Subject: [PATCH 54/57] change all evans to evan@status.net --- actions/all.php | 6 +++--- actions/api.php | 6 +++--- actions/finishremotesubscribe.php | 2 +- actions/updateprofile.php | 2 +- index.php | 6 +++--- install.php | 2 +- lib/httpclient.php | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/actions/all.php b/actions/all.php index e56e10c21f..5ffc7e9bd1 100644 --- a/actions/all.php +++ b/actions/all.php @@ -18,15 +18,15 @@ * * @category Actions * @package Actions - * @author Evan Prodromou - * @author Evan Prodromou + * @author Evan Prodromou + * @author Evan Prodromou * @author Mike Cochrane * @author Robin Millette * @author Adrian Lang * @author Meitar Moscovitz * @author Sarven Capadisli * @author Craig Andrews - * @author Evan Prodromou + * @author Evan Prodromou * @author Evan Prodromou * @author Jeffery To * @author Zach Copley diff --git a/actions/api.php b/actions/api.php index 9b5f548074..06fdbfb44c 100644 --- a/actions/api.php +++ b/actions/api.php @@ -18,8 +18,8 @@ * * @category Actions * @package Actions - * @author Evan Prodromou - * @author Evan Prodromou + * @author Evan Prodromou + * @author Evan Prodromou * @author Brenda Wallace * @author Jeffery To * @author Robin Millette @@ -27,7 +27,7 @@ * @author Christopher Vollick * @author CiaranG * @author Craig Andrews - * @author Evan Prodromou + * @author Evan Prodromou * @author Evan Prodromou * @author Gina Haeussge * @author Mike Cochrane diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php index 44abbfceb7..5f6807d10a 100644 --- a/actions/finishremotesubscribe.php +++ b/actions/finishremotesubscribe.php @@ -41,7 +41,7 @@ require_once INSTALLDIR.'/lib/omb.php'; * * @category Action * @package Laconica - * @author Evan Prodromou + * @author Evan Prodromou * @author Robin Millette * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://laconi.ca/ diff --git a/actions/updateprofile.php b/actions/updateprofile.php index 7f7dd75fef..d9cc7f7f3c 100644 --- a/actions/updateprofile.php +++ b/actions/updateprofile.php @@ -38,7 +38,7 @@ require_once INSTALLDIR.'/extlib/libomb/service_provider.php'; * * @category Action * @package Laconica - * @author Evan Prodromou + * @author Evan Prodromou * @author Robin Millette * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://laconi.ca/ diff --git a/index.php b/index.php index a1d983dce7..4e6c093792 100644 --- a/index.php +++ b/index.php @@ -23,9 +23,9 @@ * @author Christopher Vollick * @author CiaranG * @author Craig Andrews - * @author Evan Prodromou - * @author Evan Prodromou - * @author Evan Prodromou + * @author Evan Prodromou + * @author Evan Prodromou + * @author Evan Prodromou * @author Evan Prodromou * @author Gina Haeussge * @author Jeffery To diff --git a/install.php b/install.php index 54ae0cd5e1..24ad3eb246 100644 --- a/install.php +++ b/install.php @@ -26,7 +26,7 @@ * @author CiaranG * @author Craig Andrews * @author Eric Helgeson - * @author Evan Prodromou + * @author Evan Prodromou * @author Evan Prodromou * @author Robin Millette * @author Sarven Capadisli diff --git a/lib/httpclient.php b/lib/httpclient.php index 9b0bb6f3a5..0059711534 100644 --- a/lib/httpclient.php +++ b/lib/httpclient.php @@ -21,7 +21,7 @@ * * @category Action * @package Laconica - * @author Evan Prodromou + * @author Evan Prodromou * @copyright 2009 Control Yourself, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://laconi.ca/ @@ -40,7 +40,7 @@ if (!defined('STATUSNET')) { * * @category HTTP * @package Laconica - * @author Evan Prodromou + * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://laconi.ca/ */ @@ -61,7 +61,7 @@ class HTTPResponse * * @category HTTP * @package Laconica - * @author Evan Prodromou + * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://laconi.ca/ */ From 1618d515e6d96c8c0458295282de89dfae790e00 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 22:30:52 -0400 Subject: [PATCH 55/57] dedupe evans --- actions/all.php | 9 +++------ actions/api.php | 15 ++++++--------- index.php | 21 +++++++++------------ install.php | 1 - 4 files changed, 18 insertions(+), 28 deletions(-) diff --git a/actions/all.php b/actions/all.php index 5ffc7e9bd1..22da3cd681 100644 --- a/actions/all.php +++ b/actions/all.php @@ -15,19 +15,16 @@ * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . - * + * * @category Actions * @package Actions * @author Evan Prodromou - * @author Evan Prodromou * @author Mike Cochrane * @author Robin Millette * @author Adrian Lang * @author Meitar Moscovitz * @author Sarven Capadisli * @author Craig Andrews - * @author Evan Prodromou - * @author Evan Prodromou * @author Jeffery To * @author Zach Copley * @author csarven @@ -35,8 +32,8 @@ * @link http://status.net */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); +if (!defined('STATUSNET') && !defined('LACONICA')) { + exit(1); } require_once INSTALLDIR.'/lib/personalgroupnav.php'; diff --git a/actions/api.php b/actions/api.php index 06fdbfb44c..243ae4c629 100644 --- a/actions/api.php +++ b/actions/api.php @@ -15,11 +15,10 @@ * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . - * + * * @category Actions * @package Actions * @author Evan Prodromou - * @author Evan Prodromou * @author Brenda Wallace * @author Jeffery To * @author Robin Millette @@ -27,8 +26,6 @@ * @author Christopher Vollick * @author CiaranG * @author Craig Andrews - * @author Evan Prodromou - * @author Evan Prodromou * @author Gina Haeussge * @author Mike Cochrane * @author Sarven Capadisli @@ -36,8 +33,8 @@ * @link http://status.net */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); +if (!defined('STATUSNET') && !defined('LACONICA')) { + exit(1); } class ApiAction extends Action @@ -205,9 +202,9 @@ class ApiAction extends Action $user_id = $this->arg('user_id'); $screen_name = $this->arg('screen_name'); - if (empty($this->api_arg) - && empty($id) - && empty($user_id) + if (empty($this->api_arg) + && empty($id) + && empty($user_id) && empty($screen_name) ) { return true; diff --git a/index.php b/index.php index 4e6c093792..fb37585908 100644 --- a/index.php +++ b/index.php @@ -15,23 +15,20 @@ * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . - * + * * @category StatusNet * @package StatusNet * @license GNU Affero General Public License http://www.gnu.org/licenses/ - * @author Brenda Wallace - * @author Christopher Vollick + * @author Brenda Wallace + * @author Christopher Vollick * @author CiaranG - * @author Craig Andrews + * @author Craig Andrews * @author Evan Prodromou - * @author Evan Prodromou - * @author Evan Prodromou - * @author Evan Prodromou - * @author Gina Haeussge + * @author Gina Haeussge * @author Jeffery To * @author Mike Cochrane * @author Robin Millette - * @author Sarven Capadisli + * @author Sarven Capadisli * @author Tom Adams */ @@ -74,7 +71,7 @@ function handleError($error) common_log(LOG_ERR, $line); } } - if ($error instanceof DB_DataObject_Error + if ($error instanceof DB_DataObject_Error || $error instanceof DB_Error ) { $msg = sprintf( @@ -227,8 +224,8 @@ function main() // If the site is private, and they're not on one of the "public" // parts of the site, redirect to login - if (!$user && common_config('site', 'private') - && !isLoginAction($action) + if (!$user && common_config('site', 'private') + && !isLoginAction($action) && !preg_match('/rss$/', $action) ) { common_redirect(common_local_url('login')); diff --git a/install.php b/install.php index 24ad3eb246..4398757dea 100644 --- a/install.php +++ b/install.php @@ -27,7 +27,6 @@ * @author Craig Andrews * @author Eric Helgeson * @author Evan Prodromou - * @author Evan Prodromou * @author Robin Millette * @author Sarven Capadisli * @author Tom Adams From 15a2b69777479f1544a681ed1bff76aa066cf95c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 15 Sep 2009 22:31:52 -0400 Subject: [PATCH 56/57] statusize new HTTP classes --- lib/curlclient.php | 10 +++++----- lib/httpclient.php | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/curlclient.php b/lib/curlclient.php index c43bfb57f7..36fc7d157e 100644 --- a/lib/curlclient.php +++ b/lib/curlclient.php @@ -1,6 +1,6 @@ n. * * @category HTTP - * @package Laconica + * @package StatusNet * @author Evan Prodromou * @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://laconi.ca/ + * @link http://status.net/ */ if (!defined('STATUSNET')) { @@ -39,10 +39,10 @@ define(CURLCLIENT_VERSION, "0.1"); * Makes Curl HTTP client calls within our HTTPClient framework * * @category HTTP - * @package Laconica + * @package StatusNet * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class CurlClient extends HTTPClient diff --git a/lib/httpclient.php b/lib/httpclient.php index 0059711534..c8c8ae5b26 100644 --- a/lib/httpclient.php +++ b/lib/httpclient.php @@ -1,6 +1,6 @@ . * * @category Action - * @package Laconica + * @package StatusNet * @author Evan Prodromou - * @copyright 2009 Control Yourself, Inc. + * @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://laconi.ca/ + * @link http://status.net/ */ if (!defined('STATUSNET')) { @@ -39,10 +39,10 @@ if (!defined('STATUSNET')) { * library (curl or PHP-HTTP or whatever) that's used. * * @category HTTP - * @package Laconica + * @package StatusNet * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class HTTPResponse @@ -60,10 +60,10 @@ class HTTPResponse * library (curl or PHP-HTTP or whatever) that's used. * * @category HTTP - * @package Laconica + * @package StatusNet * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class HTTPClient From 83b09164573ede90d87a7038a56f651a5f82b9f1 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 16 Sep 2009 11:14:26 +0200 Subject: [PATCH 57/57] Updated csarven emails to csarven@status.net and removed dupes --- actions/all.php | 3 +-- actions/api.php | 2 +- index.php | 2 +- install.php | 2 +- theme/readme.txt | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/actions/all.php b/actions/all.php index 22da3cd681..f1786462e1 100644 --- a/actions/all.php +++ b/actions/all.php @@ -23,11 +23,10 @@ * @author Robin Millette * @author Adrian Lang * @author Meitar Moscovitz - * @author Sarven Capadisli + * @author Sarven Capadisli * @author Craig Andrews * @author Jeffery To * @author Zach Copley - * @author csarven * @license GNU Affero General Public License http://www.gnu.org/licenses/ * @link http://status.net */ diff --git a/actions/api.php b/actions/api.php index 243ae4c629..d570bb0174 100644 --- a/actions/api.php +++ b/actions/api.php @@ -28,7 +28,7 @@ * @author Craig Andrews * @author Gina Haeussge * @author Mike Cochrane - * @author Sarven Capadisli + * @author Sarven Capadisli * @license GNU Affero General Public License http://www.gnu.org/licenses/ * @link http://status.net */ diff --git a/index.php b/index.php index fb37585908..d5174c2b7e 100644 --- a/index.php +++ b/index.php @@ -28,7 +28,7 @@ * @author Jeffery To * @author Mike Cochrane * @author Robin Millette - * @author Sarven Capadisli + * @author Sarven Capadisli * @author Tom Adams */ diff --git a/install.php b/install.php index 4398757dea..81241315e1 100644 --- a/install.php +++ b/install.php @@ -28,7 +28,7 @@ * @author Eric Helgeson * @author Evan Prodromou * @author Robin Millette - * @author Sarven Capadisli + * @author Sarven Capadisli * @author Tom Adams * @license GNU Affero General Public License http://www.gnu.org/licenses/ */ diff --git a/theme/readme.txt b/theme/readme.txt index 151b1fb71c..d030f2db4d 100644 --- a/theme/readme.txt +++ b/theme/readme.txt @@ -1,7 +1,7 @@ /** Howto: create a statusnet theme * * @package StatusNet - * @author Sarven Capadisli + * @author Sarven Capadisli * @copyright 2009 Control Yourself, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://laconi.ca/