r40760 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40759‎ | r40760 | r40761 >
Date:21:08, 12 September 2008
Author:simetrical
Status:old
Tags:
Comment:
(bug 6702) Improve default English messages

Two more tweaks based on suggestions by Michael De La Rue on the bug.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -175,8 +175,9 @@
176176 # Save settings (including confirmation token)
177177 $u->saveSettings();
178178
179 - # If not logged in, assume the new account as the current one and set session cookies
180 - # then show a "welcome" message or a "need cookies" message as needed
 179+ # If not logged in, assume the new account as the current one and set
 180+ # session cookies then show a "welcome" message or a "need cookies"
 181+ # message as needed
181182 if( $wgUser->isAnon() ) {
182183 $wgUser = $u;
183184 $wgUser->setCookies();
@@ -216,12 +217,11 @@
217218 return false;
218219 }
219220
220 - // If we are not allowing users to login locally, we should
221 - // be checking to see if the user is actually able to
222 - // authenticate to the authentication server before they
223 - // create an account (otherwise, they can create a local account
224 - // and login as any domain user). We only need to check this for
225 - // domains that aren't local.
 221+ // If we are not allowing users to login locally, we should be checking
 222+ // to see if the user is actually able to authenticate to the authenti-
 223+ // cation server before they create an account (otherwise, they can
 224+ // create a local account and login as any domain user). We only need
 225+ // to check this for domains that aren't local.
226226 if( 'local' != $this->mDomain && '' != $this->mDomain ) {
227227 if( !$wgAuth->canCreateAccounts() && ( !$wgAuth->userExists( $this->mName ) || !$wgAuth->authenticate( $this->mName, $this->mPassword ) ) ) {
228228 $this->mainLoginForm( wfMsg( 'wrongpassword' ) );
@@ -281,7 +281,8 @@
282282 }
283283 }
284284
285 - # if you need a confirmed email address to edit, then obviously you need an email address.
 285+ # if you need a confirmed email address to edit, then obviously you
 286+ # need an email address.
286287 if ( $wgEmailConfirmToEdit && empty( $this->mEmail ) ) {
287288 $this->mainLoginForm( wfMsg( 'noemailtitle' ) );
288289 return false;
@@ -292,8 +293,8 @@
293294 return false;
294295 }
295296
296 - # Set some additional data so the AbortNewAccount hook can be
297 - # used for more than just username validation
 297+ # Set some additional data so the AbortNewAccount hook can be used for
 298+ # more than just username validation
298299 $u->setEmail( $this->mEmail );
299300 $u->setRealName( $this->mRealName );
300301
@@ -391,11 +392,12 @@
392393 }
393394 }
394395
395 - // Load $wgUser now, and check to see if we're logging in as the same name.
396 - // This is necessary because loading $wgUser (say by calling getName()) calls
397 - // the UserLoadFromSession hook, which potentially creates the user in the
398 - // database. Until we load $wgUser, checking for user existence using
399 - // User::newFromName($name)->getId() below will effectively be using stale data.
 396+ // Load $wgUser now, and check to see if we're logging in as the same
 397+ // name. This is necessary because loading $wgUser (say by calling
 398+ // getName()) calls the UserLoadFromSession hook, which potentially
 399+ // creates the user in the database. Until we load $wgUser, checking
 400+ // for user existence using User::newFromName($name)->getId() below
 401+ // will effectively be using stale data.
400402 if ( $wgUser->getName() === $this->mName ) {
401403 wfDebug( __METHOD__.": already logged in as {$this->mName}\n" );
402404 return self::SUCCESS;
@@ -425,34 +427,30 @@
426428
427429 if (!$u->checkPassword( $this->mPassword )) {
428430 if( $u->checkTemporaryPassword( $this->mPassword ) ) {
429 - // The e-mailed temporary password should not be used
430 - // for actual logins; that's a very sloppy habit,
431 - // and insecure if an attacker has a few seconds to
432 - // click "search" on someone's open mail reader.
 431+ // The e-mailed temporary password should not be used for actu-
 432+ // al logins; that's a very sloppy habit, and insecure if an
 433+ // attacker has a few seconds to click "search" on someone's o-
 434+ // pen mail reader.
433435 //
434 - // Allow it to be used only to reset the password
435 - // a single time to a new value, which won't be in
436 - // the user's e-mail archives.
 436+ // Allow it to be used only to reset the password a single time
 437+ // to a new value, which won't be in the user's e-mail ar-
 438+ // chives.
437439 //
438 - // For backwards compatibility, we'll still recognize
439 - // it at the login form to minimize surprises for
440 - // people who have been logging in with a temporary
441 - // password for some time.
 440+ // For backwards compatibility, we'll still recognize it at the
 441+ // login form to minimize surprises for people who have been
 442+ // logging in with a temporary password for some time.
442443 //
443 - // As a side-effect, we can authenticate the user's
444 - // e-mail address if it's not already done, since
445 - // the temporary password was sent via e-mail.
446 - //
 444+ // As a side-effect, we can authenticate the user's e-mail ad-
 445+ // dress if it's not already done, since the temporary password
 446+ // was sent via e-mail.
447447 if( !$u->isEmailConfirmed() ) {
448448 $u->confirmEmail();
449449 $u->saveSettings();
450450 }
451451
452 - // At this point we just return an appropriate code
453 - // indicating that the UI should show a password
454 - // reset form; bot interfaces etc will probably just
455 - // fail cleanly here.
456 - //
 452+ // At this point we just return an appropriate code/ indicating
 453+ // that the UI should show a password reset form; bot inter-
 454+ // faces etc will probably just fail cleanly here.
457455 $retval = self::RESET_PASS;
458456 } else {
459457 $retval = '' == $this->mPassword ? self::EMPTY_PASS : self::WRONG_PASS;
@@ -473,16 +471,16 @@
474472 }
475473
476474 /**
477 - * Attempt to automatically create a user on login.
478 - * Only succeeds if there is an external authentication method which allows it.
 475+ * Attempt to automatically create a user on login. Only succeeds if there
 476+ * is an external authentication method which allows it.
479477 * @return integer Status code
480478 */
481479 function attemptAutoCreate( $user ) {
482480 global $wgAuth, $wgUser;
483481 /**
484 - * If the external authentication plugin allows it,
485 - * automatically create a new account for users that
486 - * are externally defined but have not yet logged in.
 482+ * If the external authentication plugin allows it, automatically cre-
 483+ * ate a new account for users that are externally defined but have not
 484+ * yet logged in.
487485 */
488486 if ( !$wgAuth->autoCreate() ) {
489487 return self::NOT_EXISTS;
@@ -526,8 +524,8 @@
527525 $wgMemc->delete( $key );
528526
529527 if( $this->hasSessionCookie() || $this->mSkipCookieCheck ) {
530 - /* Replace the language object to provide user interface in correct
531 - * language immediately on this first page load.
 528+ /* Replace the language object to provide user interface in
 529+ * correct language immediately on this first page load.
532530 */
533531 global $wgLang, $wgRequest;
534532 $code = $wgRequest->getVal( 'uselang', $wgUser->getOption( 'language' ) );
@@ -620,7 +618,8 @@
621619 # Check against password throttle
622620 if ( $u->isPasswordReminderThrottled() ) {
623621 global $wgPasswordReminderResendTime;
624 - # Round the time in hours to 3 d.p., in case someone is specifying minutes or seconds.
 622+ # Round the time in hours to 3 d.p., in case someone is specifying
 623+ # minutes or seconds.
625624 $this->mainLoginForm( wfMsgExt( 'throttled-mailpassword', array( 'parsemag' ),
626625 round( $wgPasswordReminderResendTime, 3 ) ) );
627626 return;
@@ -741,7 +740,8 @@
742741 $wgOut->setArticleRelated( false );
743742
744743 $wgOut->addWikitext( $wgOut->formatPermissionsErrorMessage( $errors, 'createaccount' ) );
745 - // Stuff that might want to be added at the end. For example, instructions if blocked.
 744+ // Stuff that might want to be added at the end. For example, instruc-
 745+ // tions if blocked.
746746 $wgOut->addWikiMsg( 'cantcreateaccount-nonblock-text' );
747747
748748 $wgOut->returnToMain( false );
@@ -899,9 +899,9 @@
900900 /**
901901 * Check if a session cookie is present.
902902 *
903 - * This will not pick up a cookie set during _this_ request, but is
904 - * meant to ensure that the client is returning the cookie which was
905 - * set on a previous pass through the system.
 903+ * This will not pick up a cookie set during _this_ request, but is meant
 904+ * to ensure that the client is returning the cookie which was set on a
 905+ * previous pass through the system.
906906 *
907907 * @private
908908 */
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1101,7 +1101,11 @@
11021102 'noarticletextanon' => '{{int:noarticletext}}', # do not translate or duplicate this message to other languages
11031103 'userpage-userdoesnotexist' => 'User account "$1" is not registered.
11041104 Please check if you want to create/edit this page.',
1105 -'clearyourcache' => "'''Note - After saving, you may have to bypass your browser's cache to see the changes.''' '''Mozilla / Firefox / Safari:''' hold ''Shift'' while clicking ''Reload,'' or press either ''Ctrl-F5'' or ''Ctrl-R'' (''Command-R'' on a Macintosh);'''Konqueror: '''click ''Reload'' or press ''F5;'' '''Opera:''' clear the cache in ''Tools → Preferences;'' '''Internet Explorer:''' hold ''Ctrl'' while clicking ''Refresh,'' or press ''Ctrl-F5.''",
 1105+'clearyourcache' => "'''Note - After saving, you may have to bypass your browser's cache to see the changes.'''
 1106+'''Mozilla / Firefox / Safari:''' hold ''Shift'' while clicking ''Reload'', or press either ''Ctrl-F5'' or ''Ctrl-R'' (''Command-R'' on a Macintosh);
 1107+'''Konqueror: '''click ''Reload'' or press ''F5'';
 1108+'''Opera:''' clear the cache in ''Tools → Preferences'';
 1109+'''Internet Explorer:''' hold ''Ctrl'' while clicking ''Refresh,'' or press ''Ctrl-F5''.",
11061110 'usercssjsyoucanpreview' => "<strong>Tip:</strong> Use the 'Show preview' button to test your new CSS/JS before saving.",
11071111 'usercsspreview' => "'''Remember that you are only previewing your user CSS.'''
11081112 '''It has not yet been saved!'''",
@@ -2160,7 +2164,7 @@
21612165 'notanarticle' => 'Not a content page',
21622166 'notvisiblerev' => 'Revision has been deleted',
21632167 'watchnochange' => 'None of your watched items were edited in the time period displayed.',
2164 -'watchlist-details' => '{{PLURAL:$1|$1 page|$1 pages}} watched not counting talk pages.',
 2168+'watchlist-details' => '{{PLURAL:$1|$1 page|$1 pages}} on your watchlist, not counting talk pages.',
21652169 'wlheader-enotif' => '* E-mail notification is enabled.',
21662170 'wlheader-showupdated' => "* Pages which have been changed since you last visited them are shown in '''bold'''",
21672171 'watchmethod-recent' => 'checking recent edits for watched pages',

Follow-up revisions

RevisionCommit summaryAuthorDate
r40829Add signup link to nosuchusertext...simetrical19:42, 14 September 2008
r46871(bug 6702) Default system messages updated/improved. Processed patches 5327 a...siebrand18:25, 5 February 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r40508(bug 6702) Improve some default system messagessimetrical22:11, 5 September 2008