From 088081675fb7d5250a9b9dfe5015de0822cb5ac2 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 9 Nov 2009 20:01:46 +0100 Subject: [PATCH 1/9] Revert "Remove more contractions" This reverts commit 5ab709b73977131813884558bf56d97172a7aa26. Missed this one yesterday... --- actions/allrss.php | 2 +- actions/apiaccountratelimitstatus.php | 2 +- actions/apifriendshipsdestroy.php | 2 +- actions/attachment.php | 4 ++-- actions/avatarbynickname.php | 2 +- actions/groupblock.php | 2 +- actions/login.php | 2 +- actions/logout.php | 2 +- actions/newmessage.php | 2 +- actions/newnotice.php | 2 +- actions/opensearch.php | 2 +- actions/passwordsettings.php | 2 +- actions/register.php | 2 +- actions/showgroup.php | 2 +- actions/showmessage.php | 8 ++++---- actions/shownotice.php | 6 +++--- actions/showstream.php | 2 +- actions/sup.php | 2 +- actions/twitapisearchatom.php | 2 +- actions/twitapitrends.php | 2 +- classes/File_redirection.php | 8 ++++---- classes/Notice.php | 6 +++--- classes/Profile.php | 4 ++-- classes/User.php | 6 +++--- lib/api.php | 14 +++++++------- lib/apiauth.php | 2 +- lib/dberroraction.php | 6 +++--- lib/error.php | 4 ++-- lib/htmloutputter.php | 2 +- lib/imagefile.php | 2 +- lib/jabber.php | 2 +- lib/mail.php | 6 +++--- lib/noticelist.php | 4 ++-- lib/queuehandler.php | 12 ++++++------ lib/rssaction.php | 2 +- lib/search_engines.php | 2 +- lib/util.php | 12 ++++++------ lib/xmloutputter.php | 2 +- lib/xmppqueuehandler.php | 2 +- plugins/Autocomplete/autocomplete.php | 2 +- plugins/BlogspamNetPlugin.php | 2 +- plugins/Facebook/FBConnectAuth.php | 4 ++-- plugins/Facebook/FacebookPlugin.php | 4 ++-- plugins/Facebook/facebook/facebook.php | 8 ++++---- plugins/Facebook/facebook/facebook_desktop.php | 2 +- .../Facebook/facebook/facebookapi_php5_restlib.php | 6 +++--- .../Facebook/facebook/jsonwrapper/jsonwrapper.php | 2 +- plugins/Facebook/facebookaction.php | 6 +++--- plugins/GeonamesPlugin.php | 8 ++++---- plugins/OpenID/finishopenidlogin.php | 4 ++-- plugins/OpenID/openid.php | 2 +- plugins/PiwikAnalyticsPlugin.php | 2 +- plugins/Realtime/RealtimePlugin.php | 2 +- .../TwitterBridge/daemons/synctwitterfriends.php | 2 +- .../TwitterBridge/daemons/twitterstatusfetcher.php | 4 ++-- plugins/TwitterBridge/twitter.php | 2 +- scripts/console.php | 4 ++-- scripts/maildaemon.php | 2 +- scripts/xmppconfirmhandler.php | 2 +- 59 files changed, 110 insertions(+), 110 deletions(-) diff --git a/actions/allrss.php b/actions/allrss.php index 4a5d15c7b7..28b1be27d8 100644 --- a/actions/allrss.php +++ b/actions/allrss.php @@ -56,7 +56,7 @@ class AllrssAction extends Rss10Action * * @param array $args Web and URL arguments * - * @return boolean false if user does not exist + * @return boolean false if user doesn't exist */ function prepare($args) { diff --git a/actions/apiaccountratelimitstatus.php b/actions/apiaccountratelimitstatus.php index c7c0e7c001..96179f175b 100644 --- a/actions/apiaccountratelimitstatus.php +++ b/actions/apiaccountratelimitstatus.php @@ -36,7 +36,7 @@ if (!defined('STATUSNET')) { require_once INSTALLDIR . '/lib/apibareauth.php'; /** - * We do not have a rate limit, but some clients check this method. + * We don't have a rate limit, but some clients check this method. * It always returns the same thing: 150 hits left. * * @category API diff --git a/actions/apifriendshipsdestroy.php b/actions/apifriendshipsdestroy.php index fb73624c9a..3d9b7e001c 100644 --- a/actions/apifriendshipsdestroy.php +++ b/actions/apifriendshipsdestroy.php @@ -113,7 +113,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction return; } - // Do not allow unsubscribing from yourself! + // Don't allow unsubscribing from yourself! if ($this->user->id == $this->other->id) { $this->clientError( diff --git a/actions/attachment.php b/actions/attachment.php index ca9e578457..6981354d10 100644 --- a/actions/attachment.php +++ b/actions/attachment.php @@ -146,7 +146,7 @@ class AttachmentAction extends Action } /** - * Do not show local navigation + * Don't show local navigation * * @return void */ @@ -170,7 +170,7 @@ class AttachmentAction extends Action } /** - * Do not show page notice + * Don't show page notice * * @return void */ diff --git a/actions/avatarbynickname.php b/actions/avatarbynickname.php index 1a6925e119..537950792f 100644 --- a/actions/avatarbynickname.php +++ b/actions/avatarbynickname.php @@ -49,7 +49,7 @@ class AvatarbynicknameAction extends Action * * @param array $args query arguments * - * @return boolean false if nickname or user is not found + * @return boolean false if nickname or user isn't found */ function handle($args) { diff --git a/actions/groupblock.php b/actions/groupblock.php index 133101eb7a..979a56a81d 100644 --- a/actions/groupblock.php +++ b/actions/groupblock.php @@ -95,7 +95,7 @@ class GroupblockAction extends Action $this->clientError(_('User is already blocked from group.')); return false; } - // XXX: could have proactive blocks, but we do not have UI for it. + // XXX: could have proactive blocks, but we don't have UI for it. if (!$this->profile->isMember($this->group)) { $this->clientError(_('User is not a member of group.')); return false; diff --git a/actions/login.php b/actions/login.php index 679817520f..ad57dd6678 100644 --- a/actions/login.php +++ b/actions/login.php @@ -159,7 +159,7 @@ class LoginAction extends Action $url = common_get_returnto(); if ($url) { - // We do not have to return to it again + // We don't have to return to it again common_set_returnto(null); } else { $url = common_local_url('all', diff --git a/actions/logout.php b/actions/logout.php index 7e768fca63..1e0adae575 100644 --- a/actions/logout.php +++ b/actions/logout.php @@ -81,7 +81,7 @@ class LogoutAction extends Action { common_set_user(null); common_real_login(false); // not logged in - common_forgetme(); // do not log back in! + common_forgetme(); // don't log back in! } } diff --git a/actions/newmessage.php b/actions/newmessage.php index 73307fdfc5..0db2e7181c 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -61,7 +61,7 @@ class NewmessageAction extends Action /** * Title of the page * - * Note that this usually does not get called unless something went wrong + * Note that this usually doesn't get called unless something went wrong * * @return string page title */ diff --git a/actions/newnotice.php b/actions/newnotice.php index fc06e5c986..fbd7ab6bce 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -59,7 +59,7 @@ class NewnoticeAction extends Action /** * Title of the page * - * Note that this usually does not get called unless something went wrong + * Note that this usually doesn't get called unless something went wrong * * @return string page title */ diff --git a/actions/opensearch.php b/actions/opensearch.php index b205d2fe27..861b53d7d8 100644 --- a/actions/opensearch.php +++ b/actions/opensearch.php @@ -52,7 +52,7 @@ class OpensearchAction extends Action * * @param array $args query arguments * - * @return boolean false if user does not exist + * @return boolean false if user doesn't exist */ function handle($args) { diff --git a/actions/passwordsettings.php b/actions/passwordsettings.php index 6658d279f2..87eb45a7d0 100644 --- a/actions/passwordsettings.php +++ b/actions/passwordsettings.php @@ -97,7 +97,7 @@ class PasswordsettingsAction extends AccountSettingsAction $this->elementStart('ul', 'form_data'); - // Users who logged in with OpenID will not have a pwd + // Users who logged in with OpenID won't have a pwd if ($user->password) { $this->elementStart('li'); $this->password('oldpassword', _('Old password')); diff --git a/actions/register.php b/actions/register.php index c4f6760aa9..57f8e7bdf0 100644 --- a/actions/register.php +++ b/actions/register.php @@ -174,7 +174,7 @@ class RegisterAction extends Action $bio = $this->trimmed('bio'); $location = $this->trimmed('location'); - // We do not trim these... whitespace is OK in a password! + // We don't trim these... whitespace is OK in a password! $password = $this->arg('password'); $confirm = $this->arg('confirm'); diff --git a/actions/showgroup.php b/actions/showgroup.php index ae956befa3..a4af29391d 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -418,7 +418,7 @@ class ShowgroupAction extends GroupDesignAction // XXX: WORM cache this $members = $this->group->getMembers(); $members_count = 0; - /** $member->count() does not work. */ + /** $member->count() doesn't work. */ while ($members->fetch()) { $members_count++; } diff --git a/actions/showmessage.php b/actions/showmessage.php index cf3a819c11..db757948ba 100644 --- a/actions/showmessage.php +++ b/actions/showmessage.php @@ -137,7 +137,7 @@ class ShowmessageAction extends MailboxAction } /** - * Do not show local navigation + * Don't show local navigation * * @return void */ @@ -147,7 +147,7 @@ class ShowmessageAction extends MailboxAction } /** - * Do not show page notice + * Don't show page notice * * @return void */ @@ -157,7 +157,7 @@ class ShowmessageAction extends MailboxAction } /** - * Do not show aside + * Don't show aside * * @return void */ @@ -167,7 +167,7 @@ class ShowmessageAction extends MailboxAction } /** - * Do not show any instructions + * Don't show any instructions * * @return string */ diff --git a/actions/shownotice.php b/actions/shownotice.php index 688089f027..5d16fdad9e 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -208,7 +208,7 @@ class ShownoticeAction extends OwnerDesignAction } /** - * Do not show local navigation + * Don't show local navigation * * @return void */ @@ -234,7 +234,7 @@ class ShownoticeAction extends OwnerDesignAction } /** - * Do not show page notice + * Don't show page notice * * @return void */ @@ -244,7 +244,7 @@ class ShownoticeAction extends OwnerDesignAction } /** - * Do not show aside + * Don't show aside * * @return void */ diff --git a/actions/showstream.php b/actions/showstream.php index 4952ebdb7e..663638c18a 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -253,7 +253,7 @@ class ShowstreamAction extends ProfileAction } } -// We do not show the author for a profile, since we already know who it is! +// We don't show the author for a profile, since we already know who it is! class ProfileNoticeList extends NoticeList { diff --git a/actions/sup.php b/actions/sup.php index a199f247eb..5daf0a1c1d 100644 --- a/actions/sup.php +++ b/actions/sup.php @@ -61,7 +61,7 @@ class SupAction extends Action $notice = new Notice(); # XXX: cache this. Depends on how big this protocol becomes; - # Re-doing this query every 15 seconds is not the end of the world. + # Re-doing this query every 15 seconds isn't the end of the world. $divider = common_sql_date(time() - $seconds); diff --git a/actions/twitapisearchatom.php b/actions/twitapisearchatom.php index 511d7cdc66..7d618c471f 100644 --- a/actions/twitapisearchatom.php +++ b/actions/twitapisearchatom.php @@ -250,7 +250,7 @@ class TwitapisearchatomAction extends ApiAction } // FIXME: this alternate link is not quite right because our - // web-based notice search does not support a rpp (responses per + // web-based notice search doesn't support a rpp (responses per // page) param yet $this->element('link', array('type' => 'text/html', diff --git a/actions/twitapitrends.php b/actions/twitapitrends.php index 2d17e77cc8..779405e6d6 100644 --- a/actions/twitapitrends.php +++ b/actions/twitapitrends.php @@ -55,7 +55,7 @@ class TwitapitrendsAction extends ApiAction * * @param array $args Web and URL arguments * - * @return boolean false if user does not exist + * @return boolean false if user doesn't exist */ function prepare($args) { diff --git a/classes/File_redirection.php b/classes/File_redirection.php index c951c1ee77..08a6e8d8be 100644 --- a/classes/File_redirection.php +++ b/classes/File_redirection.php @@ -53,7 +53,7 @@ class File_redirection extends Memcached_DataObject 'connect_timeout' => 10, // # seconds to wait 'max_redirs' => $redirs, // # max number of http redirections to follow 'follow_redirects' => true, // Follow redirects - 'store_body' => false, // We will not need body content here. + 'store_body' => false, // We won't need body content here. )); return $request; } @@ -81,12 +81,12 @@ class File_redirection extends Memcached_DataObject } try { $request = self::_commonHttp($short_url, $redirs); - // Do not include body in output + // Don't include body in output $request->setMethod(HTTP_Request2::METHOD_HEAD); $response = $request->send(); if (405 == $response->getStatus()) { - // Server does not support HEAD method? Can this really happen? + // Server doesn't support HEAD method? Can this really happen? // We'll try again as a GET and ignore the response data. $request = self::_commonHttp($short_url, $redirs); $response = $request->send(); @@ -178,7 +178,7 @@ class File_redirection extends Memcached_DataObject case 'aim': case 'jabber': case 'xmpp': - // do not touch anything + // don't touch anything break; default: diff --git a/classes/Notice.php b/classes/Notice.php index 32a8b693c0..9886875cb7 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -146,7 +146,7 @@ class Notice extends Memcached_DataObject /* Add them to the database */ foreach(array_unique($hashtags) as $hashtag) { - /* elide characters we do not want in the tag */ + /* elide characters we don't want in the tag */ $this->saveTag($hashtag); } return true; @@ -1105,7 +1105,7 @@ class Notice extends Memcached_DataObject if (empty($recipient)) { continue; } - // Do not save replies from blocked profile to local user + // Don't save replies from blocked profile to local user $recipient_user = User::staticGet('id', $recipient->id); if (!empty($recipient_user) && $recipient_user->hasBlocked($sender)) { continue; @@ -1131,7 +1131,7 @@ class Notice extends Memcached_DataObject $tagged = Profile_tag::getTagged($sender->id, $tag); foreach ($tagged as $t) { if (!$replied[$t->id]) { - // Do not save replies from blocked profile to local user + // Don't save replies from blocked profile to local user $t_user = User::staticGet('id', $t->id); if ($t_user && $t_user->hasBlocked($sender)) { continue; diff --git a/classes/Profile.php b/classes/Profile.php index a50f4951de..7c1e9db332 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -101,7 +101,7 @@ class Profile extends Memcached_DataObject } foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) { - # We do not do a scaled one if original is our scaled size + # We don't do a scaled one if original is our scaled size if (!($avatar->width == $size && $avatar->height == $size)) { $scaled_filename = $imagefile->resize($size); @@ -174,7 +174,7 @@ class Profile extends Memcached_DataObject function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0, $since=null) { - // XXX: I'm not sure this is going to be any faster. It probably is not. + // XXX: I'm not sure this is going to be any faster. It probably isn't. $ids = Notice::stream(array($this, '_streamDirect'), array(), 'profile:notice_ids:' . $this->id, diff --git a/classes/User.php b/classes/User.php index c529b82e0b..9b90ce61bf 100644 --- a/classes/User.php +++ b/classes/User.php @@ -87,7 +87,7 @@ class User extends Memcached_DataObject return (is_null($sub)) ? false : true; } - // 'update' will not write key columns, so we have to do it ourselves. + // 'update' won't write key columns, so we have to do it ourselves. function updateKeys(&$orig) { @@ -384,7 +384,7 @@ class User extends Memcached_DataObject return false; } - // Otherwise, cache does not have all faves; + // Otherwise, cache doesn't have all faves; // fall through to the default } @@ -463,7 +463,7 @@ class User extends Memcached_DataObject { $cache = common_memcache(); if ($cache) { - // Faves do not happen chronologically, so we need to blow + // Faves don't happen chronologically, so we need to blow // ;last cache, too $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id)); $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last')); diff --git a/lib/api.php b/lib/api.php index fb4c4289b4..a1236ab7ec 100644 --- a/lib/api.php +++ b/lib/api.php @@ -66,7 +66,7 @@ class ApiAction extends Action * * @param array $args Web and URL arguments * - * @return boolean false if user does not exist + * @return boolean false if user doesn't exist */ function prepare($args) @@ -138,7 +138,7 @@ class ApiAction extends Action $design = null; $user = $profile->getUser(); - // Note: some profiles do not have an associated user + // Note: some profiles don't have an associated user if (!empty($user)) { $design = $user->getDesign(); @@ -203,7 +203,7 @@ class ApiAction extends Action if ($get_notice) { $notice = $profile->getCurrentNotice(); if ($notice) { - # do not get user! + # don't get user! $twitter_user['status'] = $this->twitterStatusArray($notice, false); } } @@ -263,7 +263,7 @@ class ApiAction extends Action } if ($include_user) { - # Do not get notice (recursive!) + # Don't get notice (recursive!) $twitter_user = $this->twitterUserArray($profile, false); $twitter_status['user'] = $twitter_user; } @@ -1074,7 +1074,7 @@ class ApiAction extends Action function initTwitterAtom() { $this->startXML(); - // FIXME: do not hardcode the language here! + // FIXME: don't hardcode the language here! $this->elementStart('feed', array('xmlns' => 'http://www.w3.org/2005/Atom', 'xml:lang' => 'en-US', 'xmlns:thr' => 'http://purl.org/syndication/thread/1.0')); @@ -1116,7 +1116,7 @@ class ApiAction extends Action return User::staticGet('nickname', $nickname); } else if ($this->arg('user_id')) { // This is to ensure that a non-numeric user_id still - // overrides screen_name even if it does not get used + // overrides screen_name even if it doesn't get used if (is_numeric($this->arg('user_id'))) { return User::staticGet('id', $this->arg('user_id')); } @@ -1146,7 +1146,7 @@ class ApiAction extends Action return User_group::staticGet('nickname', $nickname); } else if ($this->arg('group_id')) { // This is to ensure that a non-numeric user_id still - // overrides screen_name even if it does not get used + // overrides screen_name even if it doesn't get used if (is_numeric($this->arg('group_id'))) { return User_group::staticGet('id', $this->arg('group_id')); } diff --git a/lib/apiauth.php b/lib/apiauth.php index b8189f15dd..2f2e44a264 100644 --- a/lib/apiauth.php +++ b/lib/apiauth.php @@ -87,7 +87,7 @@ class ApiAuthAction extends ApiAction } /** - * Check for a user specified via HTTP basic auth. If there is not + * Check for a user specified via HTTP basic auth. If there isn't * one, try to get one by outputting the basic auth header. * * @return boolean true or false diff --git a/lib/dberroraction.php b/lib/dberroraction.php index 893797b70e..2cb66a022d 100644 --- a/lib/dberroraction.php +++ b/lib/dberroraction.php @@ -39,7 +39,7 @@ require_once INSTALLDIR.'/lib/servererroraction.php'; * * This only occurs if there's been a DB_DataObject_Error that's * reported through PEAR, so we try to avoid doing anything that connects - * to the DB, so we do not trigger it again. + * to the DB, so we don't trigger it again. * * @category Action * @package StatusNet @@ -62,12 +62,12 @@ class DBErrorAction extends ServerErrorAction function getLanguage() { - // Do not try to figure out user's language; just show the page + // Don't try to figure out user's language; just show the page return common_config('site', 'language'); } function showPrimaryNav() { - // do not show primary nav + // don't show primary nav } } diff --git a/lib/error.php b/lib/error.php index 5ed5dec1bd..3162cfe656 100644 --- a/lib/error.php +++ b/lib/error.php @@ -104,11 +104,11 @@ class ErrorAction extends Action { parent::showPage(); - // We do not want to have any more output after this + // We don't want to have any more output after this exit(); } - // Overload a bunch of stuff so the page is not too bloated + // Overload a bunch of stuff so the page isn't too bloated function showBody() { diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 73bd9ce815..c2ec83c284 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -76,7 +76,7 @@ class HTMLOutputter extends XMLOutputter /** * Start an HTML document * - * If $type is not specified, will attempt to do content negotiation. + * If $type isn't specified, will attempt to do content negotiation. * * Attempts to do content negotiation for language, also. * diff --git a/lib/imagefile.php b/lib/imagefile.php index edc7218d03..cf1668f203 100644 --- a/lib/imagefile.php +++ b/lib/imagefile.php @@ -119,7 +119,7 @@ class ImageFile return; } - // Do not crop/scale if it is not necessary + // Don't crop/scale if it isn't necessary if ($size === $this->width && $size === $this->height && $x === 0 diff --git a/lib/jabber.php b/lib/jabber.php index d666fcbb38..73f2ec6605 100644 --- a/lib/jabber.php +++ b/lib/jabber.php @@ -437,7 +437,7 @@ function jabber_public_notice($notice) $public = common_config('xmpp', 'public'); - // FIXME PRIV do not send out private messages here + // FIXME PRIV don't send out private messages here // XXX: should we send out non-local messages if public,localonly // = false? I think not diff --git a/lib/mail.php b/lib/mail.php index 79630b721c..5218059e9d 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -467,7 +467,7 @@ function mail_notify_nudge($from, $to) "these days and is inviting you to post some news.\n\n". "So let's hear from you :)\n\n". "%3\$s\n\n". - "Do not reply to this email. It will not get to them.\n\n". + "Don't reply to this email; it won't get to them.\n\n". "With kind regards,\n". "%4\$s\n"), $from_profile->getBestName(), @@ -516,7 +516,7 @@ function mail_notify_message($message, $from=null, $to=null) "------------------------------------------------------\n\n". "You can reply to their message here:\n\n". "%4\$s\n\n". - "Do not reply to this email. It will not get to them.\n\n". + "Don't reply to this email; it won't get to them.\n\n". "With kind regards,\n". "%5\$s\n"), $from_profile->getBestName(), @@ -532,7 +532,7 @@ function mail_notify_message($message, $from=null, $to=null) /** * notify a user that one of their notices has been chosen as a 'fave' * - * Does not check that the user has an email address nor if they + * Doesn't check that the user has an email address nor if they * want to receive notification of faves. Maybe this happens higher * up the stack...? * diff --git a/lib/noticelist.php b/lib/noticelist.php index 4e5623ded6..bf12bb73c5 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -347,7 +347,7 @@ class NoticeListItem extends Widget * show the link to the main page for the notice * * Displays a link to the page for a notice, with "relative" time. Tries to - * get remote notice URLs correct, but does not always succeed. + * get remote notice URLs correct, but doesn't always succeed. * * @return void */ @@ -483,7 +483,7 @@ class NoticeListItem extends Widget * show a link to reply to the current notice * * Should either do the reply in the current notice form (if available), or - * link out to the notice-posting form. A little flakey, does not always work. + * link out to the notice-posting form. A little flakey, doesn't always work. * * @return void */ diff --git a/lib/queuehandler.php b/lib/queuehandler.php index 7c07ca4f99..cd43b1e09a 100644 --- a/lib/queuehandler.php +++ b/lib/queuehandler.php @@ -96,8 +96,8 @@ class QueueHandler extends Daemon * Initialization, run when the queue handler starts. * If this function indicates failure, the handler run will be aborted. * - * @fixme run() will abort if this does not return true, - * but some subclasses do not bother. + * @fixme run() will abort if this doesn't return true, + * but some subclasses don't bother. * @return boolean true on success, false on failure */ function start() @@ -108,8 +108,8 @@ class QueueHandler extends Daemon * Cleanup, run when the queue handler ends. * If this function indicates failure, a warning will be logged. * - * @fixme run() will throw warnings if this does not return true, - * but many subclasses do not bother. + * @fixme run() will throw warnings if this doesn't return true, + * but many subclasses don't bother. * @return boolean true on success, false on failure */ function finish() @@ -137,7 +137,7 @@ class QueueHandler extends Daemon * method, which passes control back to our handle_notice() method for * each notice that comes in on the queue. * - * Most of the time this will not need to be overridden in a subclass. + * Most of the time this won't need to be overridden in a subclass. * * @return boolean true on success, false on failure */ @@ -173,7 +173,7 @@ class QueueHandler extends Daemon * Called by QueueHandler after each handled item or empty polling cycle. * This is a good time to e.g. service your XMPP connection. * - * Does not need to be overridden if there's no maintenance to do. + * Doesn't need to be overridden if there's no maintenance to do. * * @param int $timeout seconds to sleep if there's nothing to do */ diff --git a/lib/rssaction.php b/lib/rssaction.php index 0e84a65e92..faf6bec7de 100644 --- a/lib/rssaction.php +++ b/lib/rssaction.php @@ -386,7 +386,7 @@ class Rss10Action extends Action return null; } - // FIXME: does not handle modified profiles, avatars, deleted notices + // FIXME: doesn't handle modified profiles, avatars, deleted notices return strtotime($this->notices[0]->created); } diff --git a/lib/search_engines.php b/lib/search_engines.php index 82713235c9..69f6ff468e 100644 --- a/lib/search_engines.php +++ b/lib/search_engines.php @@ -119,7 +119,7 @@ class MySQLSearch extends SearchEngine return true; } else if ('identica_notices' === $this->table) { - // Do not show imported notices + // Don't show imported notices $this->target->whereAdd('notice.is_local != ' . Notice::GATEWAY); if (strtolower($q) != $q) { diff --git a/lib/util.php b/lib/util.php index b4f5af1af2..a4865c46c1 100644 --- a/lib/util.php +++ b/lib/util.php @@ -62,7 +62,7 @@ function common_init_language() $locale_set = common_init_locale($language); setlocale(LC_CTYPE, 'C'); - // So we do not have to make people install the gettext locales + // So we don't have to make people install the gettext locales $path = common_config('site','locale_path'); bindtextdomain("statusnet", $path); bind_textdomain_codeset("statusnet", "UTF-8"); @@ -139,7 +139,7 @@ function common_check_user($nickname, $password) } } }else{ - //no handler indicated the credentials were valid, and we know their not valid because the user is not in the database + //no handler indicated the credentials were valid, and we know their not valid because the user isn't in the database return false; } } else { @@ -396,7 +396,7 @@ function common_current_user() } // Logins that are 'remembered' aren't 'real' -- they're subject to -// cookie-stealing. So, we do not let them do certain things. New reg, +// cookie-stealing. So, we don't let them do certain things. New reg, // OpenID, and password logins _are_ real. function common_real_login($real=true) @@ -1147,7 +1147,7 @@ function common_accept_to_prefs($accept, $def = '*/*') $parts = explode(',', $accept); foreach($parts as $part) { - // FIXME: does not deal with params like 'text/html; level=1' + // FIXME: doesn't deal with params like 'text/html; level=1' @list($value, $qpart) = explode(';', trim($part)); $match = array(); if(!isset($qpart)) { @@ -1346,7 +1346,7 @@ function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext) } // FIXME: show error page if we're on the Web - /* Do not execute PHP internal error handler */ + /* Don't execute PHP internal error handler */ return true; } @@ -1448,7 +1448,7 @@ function common_shorten_url($long_url) } global $_shorteners; if (!isset($_shorteners[$svc])) { - //the user selected service does not exist, so default to ur1.ca + //the user selected service doesn't exist, so default to ur1.ca $svc = 'ur1.ca'; } if (!isset($_shorteners[$svc])) { diff --git a/lib/xmloutputter.php b/lib/xmloutputter.php index 9d862b2d02..5f06e491df 100644 --- a/lib/xmloutputter.php +++ b/lib/xmloutputter.php @@ -112,7 +112,7 @@ class XMLOutputter * * Utility for outputting an XML element. A convenient wrapper * for a bunch of longer XMLWriter calls. This is best for - * when an element does not have any sub-elements; if that's the + * when an element doesn't have any sub-elements; if that's the * case, use elementStart() and elementEnd() instead. * * The $content element will be escaped for XML. If you need diff --git a/lib/xmppqueuehandler.php b/lib/xmppqueuehandler.php index 7caa078ae3..f28fc9088c 100644 --- a/lib/xmppqueuehandler.php +++ b/lib/xmppqueuehandler.php @@ -37,7 +37,7 @@ class XmppQueueHandler extends QueueHandler function start() { - # Low priority; we do not want to receive messages + # Low priority; we don't want to receive messages $this->log(LOG_INFO, "INITIALIZE"); $this->conn = jabber_connect($this->_id.$this->transport()); diff --git a/plugins/Autocomplete/autocomplete.php b/plugins/Autocomplete/autocomplete.php index aeb100cfa4..379390ffdf 100644 --- a/plugins/Autocomplete/autocomplete.php +++ b/plugins/Autocomplete/autocomplete.php @@ -79,7 +79,7 @@ class AutocompleteAction extends Action function etag() { return '"' . implode(':', array($this->arg('action'), - crc32($this->arg('q')), //the actual string can have funny characters in we do not want showing up in the etag + crc32($this->arg('q')), //the actual string can have funny characters in we don't want showing up in the etag $this->arg('limit'), $this->lastModified())) . '"'; } diff --git a/plugins/BlogspamNetPlugin.php b/plugins/BlogspamNetPlugin.php index bf60fdcaf0..51236001aa 100644 --- a/plugins/BlogspamNetPlugin.php +++ b/plugins/BlogspamNetPlugin.php @@ -85,7 +85,7 @@ class BlogspamNetPlugin extends Plugin } else if (preg_match('/^SPAM(:(.*))?$/', $response, $match)) { throw new ClientException(sprintf(_("Spam checker results: %s"), $match[2]), 400); } else if (preg_match('/^OK$/', $response)) { - // do not do anything + // don't do anything } else { throw new ServerException(sprintf(_("Unexpected response from %s: %s"), $this->baseUrl, $response), 500); } diff --git a/plugins/Facebook/FBConnectAuth.php b/plugins/Facebook/FBConnectAuth.php index 165477419a..b909a49771 100644 --- a/plugins/Facebook/FBConnectAuth.php +++ b/plugins/Facebook/FBConnectAuth.php @@ -71,7 +71,7 @@ class FBConnectauthAction extends Action 'There is already a local user (' . $flink->user_id . ') linked with this Facebook (' . $this->fbuid . ').'); - // We do not want these cookies + // We don't want these cookies getFacebook()->clear_cookie_state(); $this->clientError(_('There is already a local user linked with this Facebook.')); @@ -364,7 +364,7 @@ class FBConnectauthAction extends Action { $url = common_get_returnto(); if ($url) { - // We do not have to return to it again + // We don't have to return to it again common_set_returnto(null); } else { $url = common_local_url('all', diff --git a/plugins/Facebook/FacebookPlugin.php b/plugins/Facebook/FacebookPlugin.php index cd1ad7b45e..b68534b24f 100644 --- a/plugins/Facebook/FacebookPlugin.php +++ b/plugins/Facebook/FacebookPlugin.php @@ -182,7 +182,7 @@ class FacebookPlugin extends Plugin $login_url = common_local_url('FBConnectAuth'); $logout_url = common_local_url('logout'); - // XXX: Facebook says we do not need this FB_RequireFeatures(), + // XXX: Facebook says we don't need this FB_RequireFeatures(), // but we actually do, for IE and Safari. Gar. $js = '"; } else { diff --git a/plugins/Facebook/facebook/facebook_desktop.php b/plugins/Facebook/facebook/facebook_desktop.php index 425bb5c7bd..e79a2ca343 100644 --- a/plugins/Facebook/facebook/facebook_desktop.php +++ b/plugins/Facebook/facebook/facebook_desktop.php @@ -93,7 +93,7 @@ class FacebookDesktop extends Facebook { } public function verify_signature($fb_params, $expected_sig) { - // we do not want to verify the signature until we have a valid + // we don't want to verify the signature until we have a valid // session secret if ($this->verify_sig) { return parent::verify_signature($fb_params, $expected_sig); diff --git a/plugins/Facebook/facebook/facebookapi_php5_restlib.php b/plugins/Facebook/facebook/facebookapi_php5_restlib.php index c742df7480..55cb7fb86a 100755 --- a/plugins/Facebook/facebook/facebookapi_php5_restlib.php +++ b/plugins/Facebook/facebook/facebookapi_php5_restlib.php @@ -46,7 +46,7 @@ class FacebookRestClient { // on canvas pages public $added; public $is_user; - // we do not pass friends list to iframes, but we want to make + // we don't pass friends list to iframes, but we want to make // friends_get really simple in the canvas_user (non-logged in) case. // So we use the canvas_user as default arg to friends_get public $canvas_user; @@ -657,7 +657,7 @@ function toggleDisplay(id, type) { * deleted. * * IMPORTANT: If your application has registered public tags - * that other applications may be using, do not delete those tags! + * that other applications may be using, don't delete those tags! * Doing so can break the FBML ofapplications that are using them. * * @param array $tag_names the names of the tags to delete (optinal) @@ -820,7 +820,7 @@ function toggleDisplay(id, type) { if (is_array($target_ids)) { $target_ids = json_encode($target_ids); - $target_ids = trim($target_ids, "[]"); // we do not want square brackets + $target_ids = trim($target_ids, "[]"); // we don't want square brackets } return $this->call_method('facebook.feed.publishUserAction', diff --git a/plugins/Facebook/facebook/jsonwrapper/jsonwrapper.php b/plugins/Facebook/facebook/jsonwrapper/jsonwrapper.php index 9c6c626632..29509debad 100644 --- a/plugins/Facebook/facebook/jsonwrapper/jsonwrapper.php +++ b/plugins/Facebook/facebook/jsonwrapper/jsonwrapper.php @@ -1,5 +1,5 @@ location_id = $n->geonameId; $location->location_ns = self::NAMESPACE; - // handled, do not continue processing! + // handled, don't continue processing! return false; } } - // Continue processing; we do not have the answer + // Continue processing; we don't have the answer return true; } @@ -217,7 +217,7 @@ class GeonamesPlugin extends Plugin } } - // For some reason we do not know, so pass. + // For some reason we don't know, so pass. return true; } @@ -299,7 +299,7 @@ class GeonamesPlugin extends Plugin $url = 'http://www.geonames.org/' . $location->location_id; - // it's been filled, so do not process further. + // it's been filled, so don't process further. return false; } } diff --git a/plugins/OpenID/finishopenidlogin.php b/plugins/OpenID/finishopenidlogin.php index b5d9782945..ff0b451d30 100644 --- a/plugins/OpenID/finishopenidlogin.php +++ b/plugins/OpenID/finishopenidlogin.php @@ -341,7 +341,7 @@ class FinishopenidloginAction extends Action { $url = common_get_returnto(); if ($url) { - # We do not have to return to it again + # We don't have to return to it again common_set_returnto(null); } else { $url = common_local_url('all', @@ -421,7 +421,7 @@ class FinishopenidloginAction extends Action $parts = parse_url($openid); - # If any of these parts exist, this will not work + # If any of these parts exist, this won't work foreach ($bad as $badpart) { if (array_key_exists($badpart, $parts)) { diff --git a/plugins/OpenID/openid.php b/plugins/OpenID/openid.php index c5f6d17132..ff7a938994 100644 --- a/plugins/OpenID/openid.php +++ b/plugins/OpenID/openid.php @@ -187,7 +187,7 @@ function oid_authenticate($openid_url, $returnto, $immediate=false) $form_html = $auth_request->formMarkup($trust_root, $process_url, $immediate, array('id' => $form_id)); - # XXX: This is cheap, but things choke if we do not escape ampersands + # XXX: This is cheap, but things choke if we don't escape ampersands # in the HTML attributes $form_html = preg_replace('/&/', '&', $form_html); diff --git a/plugins/PiwikAnalyticsPlugin.php b/plugins/PiwikAnalyticsPlugin.php index 81ef7c6837..54faa0bdbe 100644 --- a/plugins/PiwikAnalyticsPlugin.php +++ b/plugins/PiwikAnalyticsPlugin.php @@ -44,7 +44,7 @@ if (!defined('STATUSNET')) { * 'piwikId' => 'id')); * * Replace 'example.com/piwik/' with the URL to your Piwik installation and - * make sure you do not forget the final /. + * make sure you don't forget the final /. * Replace 'id' with the ID your statusnet installation has in your Piwik * analytics setup - for example '8'. * diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 88a87dcf9c..0c7c1240c3 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -240,7 +240,7 @@ class RealtimePlugin extends Plugin // FIXME: this code should be abstracted to a neutral third // party, like Notice::asJson(). I'm not sure of the ethics // of refactoring from within a plugin, so I'm just abusing - // the ApiAction method. Do not do this unless you're me! + // the ApiAction method. Don't do this unless you're me! require_once(INSTALLDIR.'/lib/api.php'); diff --git a/plugins/TwitterBridge/daemons/synctwitterfriends.php b/plugins/TwitterBridge/daemons/synctwitterfriends.php index c89c02eedb..671e3c7afa 100755 --- a/plugins/TwitterBridge/daemons/synctwitterfriends.php +++ b/plugins/TwitterBridge/daemons/synctwitterfriends.php @@ -115,7 +115,7 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon // Each child ps needs its own DB connection // Note: DataObject::getDatabaseConnection() creates - // a new connection if there is not one already + // a new connection if there isn't one already $conn = &$flink->getDatabaseConnection(); diff --git a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php index 25df0d8396..b5428316bd 100755 --- a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php +++ b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php @@ -136,7 +136,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon // Each child ps needs its own DB connection // Note: DataObject::getDatabaseConnection() creates - // a new connection if there is not one already + // a new connection if there isn't one already $conn = &$flink->getDatabaseConnection(); @@ -499,7 +499,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon $avatar->height = 73; } - $avatar->original = 0; // we do not have the original + $avatar->original = 0; // we don't have the original $avatar->mediatype = $mediatype; $avatar->filename = $filename; $avatar->url = Avatar::url($filename); diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php index d48089caa2..3c6803e49a 100644 --- a/plugins/TwitterBridge/twitter.php +++ b/plugins/TwitterBridge/twitter.php @@ -33,7 +33,7 @@ function updateTwitter_user($twitter_id, $screen_name) $fuser->query('BEGIN'); - // Dropping down to SQL because regular DB_DataObject udpate stuff does not seem + // Dropping down to SQL because regular DB_DataObject udpate stuff doesn't seem // to work so good with tables that have multiple column primary keys // Any time we update the uri for a forein user we have to make sure there diff --git a/scripts/console.php b/scripts/console.php index 2a000d39b0..41dd43f281 100755 --- a/scripts/console.php +++ b/scripts/console.php @@ -60,9 +60,9 @@ function read_input_line($prompt) } /** - * On Unix-like systems where PHP readline extension is not present, + * On Unix-like systems where PHP readline extension isn't present, * -cough- Mac OS X -cough- we can shell out to bash to do it for us. - * This lets us at least handle things like arrow keys, but we do not + * This lets us at least handle things like arrow keys, but we don't * get any entry history. :( * * Shamelessly ripped from when I wrote the same code for MediaWiki. :) diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php index 4ec4526ef4..b4e4d9f08d 100755 --- a/scripts/maildaemon.php +++ b/scripts/maildaemon.php @@ -231,7 +231,7 @@ class MailerDaemon foreach ($parsed->parts as $part) { $this->extract_part($part,$msg,$attachments); } - //we do not want any attachments that are a result of this parsing + //we don't want any attachments that are a result of this parsing return $msg; } diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php index f5f824dee2..c7ed15e495 100755 --- a/scripts/xmppconfirmhandler.php +++ b/scripts/xmppconfirmhandler.php @@ -69,7 +69,7 @@ class XmppConfirmHandler extends XmppQueueHandler continue; } else { $this->log(LOG_INFO, 'Confirmation sent for ' . $confirm->address); - # Mark confirmation sent; need a dupe so we do not have the WHERE clause + # Mark confirmation sent; need a dupe so we don't have the WHERE clause $dupe = Confirm_address::staticGet('code', $confirm->code); if (!$dupe) { common_log(LOG_WARNING, 'Could not refetch confirm', __FILE__); From 3be120571446880cb71a57845204b3213e6df67e Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 9 Nov 2009 17:43:37 -0500 Subject: [PATCH 2/9] Add a new event: CanUserChangeField --- EVENTS.txt | 4 ++++ actions/passwordsettings.php | 14 ++++++++++++++ lib/accountsettingsaction.php | 35 ++++++++++++++++++++--------------- plugins/Ldap/LdapPlugin.php | 11 +++++++++++ 4 files changed, 49 insertions(+), 15 deletions(-) diff --git a/EVENTS.txt b/EVENTS.txt index 25a51516b4..c3fe73134c 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -489,6 +489,10 @@ ChangePassword: Handle a password change request - $newpassword: the desired new password - &$errormsg: set this to an error message if the password could not be changed. If the password was changed, leave this as false +CanUserChangeField: Determines if a user is allowed to change a specific profile field +- $nickname: nickname of the user who would like to know which of their profile fields are mutable +- $field: name of the field the user wants to change (nickname, fullname, password, avatar, etc) + UserDeleteRelated: Specify additional tables to delete entries from when deleting users - $user: User object - &$related: array of DB_DataObject class names to delete entries on matching user_id. diff --git a/actions/passwordsettings.php b/actions/passwordsettings.php index 6658d279f2..15539d4a01 100644 --- a/actions/passwordsettings.php +++ b/actions/passwordsettings.php @@ -58,6 +58,19 @@ class PasswordsettingsAction extends AccountSettingsAction return _('Change password'); } + function prepare($args){ + parent::prepare($args); + + $user = common_current_user(); + + Event::handle('CanUserChangeField', array($user->nickname, 'password')); + + if(! $fields['password']){ + //user is not allowed to change his password + $this->clientError(_('You are not allowed to change your password')); + } + } + /** * Instructions for use * @@ -86,6 +99,7 @@ class PasswordsettingsAction extends AccountSettingsAction function showContent() { $user = common_current_user(); + $this->elementStart('form', array('method' => 'POST', 'id' => 'form_password', 'class' => 'form_settings', diff --git a/lib/accountsettingsaction.php b/lib/accountsettingsaction.php index a004a3ed99..9865e17489 100644 --- a/lib/accountsettingsaction.php +++ b/lib/accountsettingsaction.php @@ -102,26 +102,31 @@ class AccountSettingsNav extends Widget $this->action->elementStart('ul', array('class' => 'nav')); if (Event::handle('StartAccountSettingsNav', array(&$this->action))) { + $user = common_current_user(); - $menu = - array('profilesettings' => + $menu = array(); + $menu['profilesettings'] = array(_('Profile'), - _('Change your profile settings')), - 'avatarsettings' => - array(_('Avatar'), - _('Upload an avatar')), - 'passwordsettings' => - array(_('Password'), - _('Change your password')), - 'emailsettings' => + _('Change your profile settings')); + if(Event::handle('CanUserChangeField', array($user->nickname, 'avatar'))){ + $menu['avatarsettings'] = + array(_('Avatar'), + _('Upload an avatar')); + } + if(Event::handle('CanUserChangeField', array($user->nickname, 'password'))){ + $menu['passwordsettings'] = + array(_('Password'), + _('Change your password')); + } + $menu['emailsettings'] = array(_('Email'), - _('Change email handling')), - 'userdesignsettings' => + _('Change email handling')); + $menu['userdesignsettings'] = array(_('Design'), - _('Design your profile')), - 'othersettings' => + _('Design your profile')); + $menu['othersettings'] = array(_('Other'), - _('Other options'))); + _('Other options')); foreach ($menu as $menuaction => $menudesc) { $this->action->menuItem(common_local_url($menuaction), diff --git a/plugins/Ldap/LdapPlugin.php b/plugins/Ldap/LdapPlugin.php index 755562f54b..3795ffd7f1 100644 --- a/plugins/Ldap/LdapPlugin.php +++ b/plugins/Ldap/LdapPlugin.php @@ -102,4 +102,15 @@ class LdapPlugin extends Plugin //return false, indicating that the event has been handled return false; } + + function onCanUserChangeField($nickname, $field) + { + switch($field) + { + case 'password': + case 'nickname': + case 'email': + return false; + } + } } From 223fee2ad1430e827830265c9fe97f4d025bb060 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 10 Nov 2009 15:53:07 +1300 Subject: [PATCH 3/9] just sent a http 200 for the check-fancy from install.php --- lib/common.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/common.php b/lib/common.php index 6aac468075..c473d9cdbf 100644 --- a/lib/common.php +++ b/lib/common.php @@ -38,6 +38,8 @@ define('FOREIGN_NOTICE_SEND_REPLY', 4); define('FOREIGN_FRIEND_SEND', 1); define('FOREIGN_FRIEND_RECV', 2); +if ( $_REQUEST['p'] == 'check-fancy') { exit; } //exit with 200 response, if this is checking fancy from the installer + define_syslog_variables(); # append our extlib dir as the last-resort place to find libs From 2f3e414cd1226b328a63854592f0783a9088baae Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 10 Nov 2009 13:08:58 +0000 Subject: [PATCH 4/9] Updated group block markup --- actions/groupblock.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/actions/groupblock.php b/actions/groupblock.php index 133101eb7a..fe09cbc2d6 100644 --- a/actions/groupblock.php +++ b/actions/groupblock.php @@ -151,17 +151,19 @@ class GroupblockAction extends Action function areYouSureForm() { $id = $this->profile->id; + $this->elementStart('form', array('id' => 'block-' . $id, + 'method' => 'post', + 'class' => 'form_settings form_entity_block', + 'action' => common_local_url('groupblock'))); + $this->elementStart('fieldset'); + $this->hidden('token', common_session_token()); + $this->element('legend', _('Block user')); $this->element('p', null, sprintf(_('Are you sure you want to block user "%s" from the group "%s"? '. 'They will be removed from the group, unable to post, and '. 'unable to subscribe to the group in the future.'), $this->profile->getBestName(), $this->group->getBestName())); - $this->elementStart('form', array('id' => 'block-' . $id, - 'method' => 'post', - 'class' => 'block', - 'action' => common_local_url('groupblock'))); - $this->hidden('token', common_session_token()); $this->hidden('blockto-' . $this->profile->id, $this->profile->id, 'blockto'); @@ -173,8 +175,9 @@ class GroupblockAction extends Action $this->hidden($k, $v); } } - $this->submit('no', _('No')); - $this->submit('yes', _('Yes')); + $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user from this group")); + $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user from this group')); + $this->elementEnd('fieldset'); $this->elementEnd('form'); } From 91da72ede0b834d017165ececdc340ec0a24227b Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 10 Nov 2009 13:09:15 +0000 Subject: [PATCH 5/9] Updated block @title text (shouldn't say from group) --- actions/block.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/block.php b/actions/block.php index 408f16434b..b125d2d8b6 100644 --- a/actions/block.php +++ b/actions/block.php @@ -146,8 +146,8 @@ class BlockAction extends Action $this->hidden($k, $v); } } - $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user from this group")); - $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user from this group')); + $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user")); + $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user')); $this->elementEnd('fieldset'); $this->elementEnd('form'); } From 069d3f2b2f912f2e7d2289bc58270341c9b1ecc5 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 10 Nov 2009 13:52:47 +0000 Subject: [PATCH 6/9] Added hook for the Group navigation items --- EVENTS.txt | 6 ++++ lib/groupnav.php | 81 +++++++++++++++++++++++++----------------------- 2 files changed, 48 insertions(+), 39 deletions(-) diff --git a/EVENTS.txt b/EVENTS.txt index c3fe73134c..af686b9cdf 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -191,6 +191,12 @@ StartPersonalGroupNav: beginning of personal group nav menu EndPersonalGroupNav: end of personal group nav menu (good place to add a menu item) - $action: action object being shown +StartGroupGroupNav: Showing the group nav menu +- $action: the current action + +EndGroupGroupNav: At the end of the group nav menu +- $action: the current action + StartEndHTML: just before the tag - $action: action object being shown diff --git a/lib/groupnav.php b/lib/groupnav.php index 31cf378c8a..131b38fa27 100644 --- a/lib/groupnav.php +++ b/lib/groupnav.php @@ -79,46 +79,49 @@ class GroupNav extends Widget $nickname = $this->group->nickname; $this->out->elementStart('ul', array('class' => 'nav')); - $this->out->menuItem(common_local_url('showgroup', array('nickname' => - $nickname)), - _('Group'), - sprintf(_('%s group'), $nickname), - $action_name == 'showgroup', - 'nav_group_group'); - $this->out->menuItem(common_local_url('groupmembers', array('nickname' => - $nickname)), - _('Members'), - sprintf(_('%s group members'), $nickname), - $action_name == 'groupmembers', - 'nav_group_members'); - - $cur = common_current_user(); - - if ($cur && $cur->isAdmin($this->group)) { - $this->out->menuItem(common_local_url('blockedfromgroup', array('nickname' => - $nickname)), - _('Blocked'), - sprintf(_('%s blocked users'), $nickname), - $action_name == 'blockedfromgroup', - 'nav_group_blocked'); - $this->out->menuItem(common_local_url('editgroup', array('nickname' => + if (Event::handle('StartGroupGroupNav', array($this))) { + $this->out->menuItem(common_local_url('showgroup', array('nickname' => $nickname)), - _('Admin'), - sprintf(_('Edit %s group properties'), $nickname), - $action_name == 'editgroup', - 'nav_group_admin'); - $this->out->menuItem(common_local_url('grouplogo', array('nickname' => - $nickname)), - _('Logo'), - sprintf(_('Add or edit %s logo'), $nickname), - $action_name == 'grouplogo', - 'nav_group_logo'); - $this->out->menuItem(common_local_url('groupdesignsettings', array('nickname' => - $nickname)), - _('Design'), - sprintf(_('Add or edit %s design'), $nickname), - $action_name == 'groupdesignsettings', - 'nav_group_design'); + _('Group'), + sprintf(_('%s group'), $nickname), + $action_name == 'showgroup', + 'nav_group_group'); + $this->out->menuItem(common_local_url('groupmembers', array('nickname' => + $nickname)), + _('Members'), + sprintf(_('%s group members'), $nickname), + $action_name == 'groupmembers', + 'nav_group_members'); + + $cur = common_current_user(); + + if ($cur && $cur->isAdmin($this->group)) { + $this->out->menuItem(common_local_url('blockedfromgroup', array('nickname' => + $nickname)), + _('Blocked'), + sprintf(_('%s blocked users'), $nickname), + $action_name == 'blockedfromgroup', + 'nav_group_blocked'); + $this->out->menuItem(common_local_url('editgroup', array('nickname' => + $nickname)), + _('Admin'), + sprintf(_('Edit %s group properties'), $nickname), + $action_name == 'editgroup', + 'nav_group_admin'); + $this->out->menuItem(common_local_url('grouplogo', array('nickname' => + $nickname)), + _('Logo'), + sprintf(_('Add or edit %s logo'), $nickname), + $action_name == 'grouplogo', + 'nav_group_logo'); + $this->out->menuItem(common_local_url('groupdesignsettings', array('nickname' => + $nickname)), + _('Design'), + sprintf(_('Add or edit %s design'), $nickname), + $action_name == 'groupdesignsettings', + 'nav_group_design'); + } + Event::handle('EndGroupGroupNav', array($this)); } $this->out->elementEnd('ul'); } From 486dbe6aef380a9057c5ac609cd1c6086a5e34fc Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 10 Nov 2009 07:57:58 -0800 Subject: [PATCH 7/9] Revert untested code; spews PHP notice warnings on every page view: "just sent a http 200 for the check-fancy from install.php" Notice: Undefined index: p in /Library/WebServer/Documents/mublog/lib/common.php on line 41 This reverts commit 223fee2ad1430e827830265c9fe97f4d025bb060. --- lib/common.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/common.php b/lib/common.php index c473d9cdbf..6aac468075 100644 --- a/lib/common.php +++ b/lib/common.php @@ -38,8 +38,6 @@ define('FOREIGN_NOTICE_SEND_REPLY', 4); define('FOREIGN_FRIEND_SEND', 1); define('FOREIGN_FRIEND_RECV', 2); -if ( $_REQUEST['p'] == 'check-fancy') { exit; } //exit with 200 response, if this is checking fancy from the installer - define_syslog_variables(); # append our extlib dir as the last-resort place to find libs From 9d0687b0559095f270a55af3467c53ad29bfd4c7 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 10 Nov 2009 08:23:24 -0800 Subject: [PATCH 8/9] Adjusting indexes to make favorites query more efficient, based on feedback from ops. fave_user_id_idx index changed from (user_id) to (user_id,modified), so the timestamp ordering can be done straight from the index while we're looking up the user's notices. Added to 08to09.sql and 08to09_pg.sql; may need to be run manually by folks doing development. (No harm if you don't update it, the favorites tab/rss feed will just stay inefficent.) --- db/08to09.sql | 3 +++ db/08to09_pg.sql | 3 +++ db/statusnet.sql | 2 +- db/statusnet_pg.sql | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/db/08to09.sql b/db/08to09.sql index a0e37f0f14..e6842225bb 100644 --- a/db/08to09.sql +++ b/db/08to09.sql @@ -42,3 +42,6 @@ create table login_token ( constraint primary key (user_id) ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin; +alter table fave + drop index fave_user_id_idx, + add index fave_user_id_idx (user_id,modified); diff --git a/db/08to09_pg.sql b/db/08to09_pg.sql index 197fcabfdb..956c4dee55 100644 --- a/db/08to09_pg.sql +++ b/db/08to09_pg.sql @@ -48,3 +48,6 @@ create table login_token ( constraint primary key (user_id) ); +alter table fave + drop index fave_user_id_idx, + add index fave_user_id_idx using btree(user_id,modified); diff --git a/db/statusnet.sql b/db/statusnet.sql index 3ed4e2c48b..510c8866ef 100644 --- a/db/statusnet.sql +++ b/db/statusnet.sql @@ -165,7 +165,7 @@ create table fave ( constraint primary key (notice_id, user_id), index fave_notice_id_idx (notice_id), - index fave_user_id_idx (user_id), + index fave_user_id_idx (user_id,modified), index fave_modified_idx (modified) ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin; diff --git a/db/statusnet_pg.sql b/db/statusnet_pg.sql index 0e5e96c327..710883e57d 100644 --- a/db/statusnet_pg.sql +++ b/db/statusnet_pg.sql @@ -171,7 +171,7 @@ create table fave ( ); create index fave_notice_id_idx on fave using btree(notice_id); -create index fave_user_id_idx on fave using btree(user_id); +create index fave_user_id_idx on fave using btree(user_id,modified); create index fave_modified_idx on fave using btree(modified); /* tables for OAuth */ From 737fe763471bcb6ebd95c318363308a33e28e889 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 10 Nov 2009 08:47:54 -0800 Subject: [PATCH 9/9] Performance fix for subscription/subscriber lists based on feedback from ops. Extended subscription table indexes for subscriber and subscribed to include the created field, which is used to sort for display. This lets us skip a filesort and do the join much more efficiently. Alter table from 08to09.sql needs to be run manually (though no ill effects if you forget other than not getting the perf improvement). --- db/08to09.sql | 6 ++++++ db/08to09_pg.sql | 6 ++++++ db/statusnet.sql | 4 ++-- db/statusnet_pg.sql | 4 ++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/db/08to09.sql b/db/08to09.sql index e6842225bb..1d37a759d8 100644 --- a/db/08to09.sql +++ b/db/08to09.sql @@ -45,3 +45,9 @@ create table login_token ( alter table fave drop index fave_user_id_idx, add index fave_user_id_idx (user_id,modified); + +alter table subscription + drop index subscription_subscriber_idx, + add index subscription_subscriber_idx (subscriber,created), + drop index subscription_subscribed_idx, + add index subscription_subscribed_idx (subscribed,created); diff --git a/db/08to09_pg.sql b/db/08to09_pg.sql index 956c4dee55..004c77b365 100644 --- a/db/08to09_pg.sql +++ b/db/08to09_pg.sql @@ -51,3 +51,9 @@ create table login_token ( alter table fave drop index fave_user_id_idx, add index fave_user_id_idx using btree(user_id,modified); + +alter table subscription + drop index subscription_subscriber_idx, + add index subscription_subscriber_idx using btree(subscriber,created), + drop index subscription_subscribed_idx, + add index subscription_subscribed_idx using btree(subscribed,created); diff --git a/db/statusnet.sql b/db/statusnet.sql index 510c8866ef..2983c67cfc 100644 --- a/db/statusnet.sql +++ b/db/statusnet.sql @@ -107,8 +107,8 @@ create table subscription ( modified timestamp comment 'date this record was modified', constraint primary key (subscriber, subscribed), - index subscription_subscriber_idx (subscriber), - index subscription_subscribed_idx (subscribed), + index subscription_subscriber_idx (subscriber, created), + index subscription_subscribed_idx (subscribed, created), index subscription_token_idx (token) ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin; diff --git a/db/statusnet_pg.sql b/db/statusnet_pg.sql index 710883e57d..392a6a5f3c 100644 --- a/db/statusnet_pg.sql +++ b/db/statusnet_pg.sql @@ -115,8 +115,8 @@ create table subscription ( primary key (subscriber, subscribed) ); -create index subscription_subscriber_idx on subscription using btree(subscriber); -create index subscription_subscribed_idx on subscription using btree(subscribed); +create index subscription_subscriber_idx on subscription using btree(subscriber,created); +create index subscription_subscribed_idx on subscription using btree(subscribed,created); create sequence notice_seq; create table notice (