From b50c8007ec496d427a30ee650c17da8a58ddcd8b Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 12 Sep 2008 21:08:19 +0000 Subject: [PATCH] (bug 6702) Improve default English messages Two more tweaks based on suggestions by Michael De La Rue on the bug. --- includes/specials/SpecialUserlogin.php | 96 +++++++++++++------------- languages/messages/MessagesEn.php | 8 ++- 2 files changed, 54 insertions(+), 50 deletions(-) diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 478ac86a52..9d5cce926f 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -175,8 +175,9 @@ class LoginForm { # Save settings (including confirmation token) $u->saveSettings(); - # If not logged in, assume the new account as the current one and set session cookies - # then show a "welcome" message or a "need cookies" message as needed + # If not logged in, assume the new account as the current one and set + # session cookies then show a "welcome" message or a "need cookies" + # message as needed if( $wgUser->isAnon() ) { $wgUser = $u; $wgUser->setCookies(); @@ -216,12 +217,11 @@ class LoginForm { return false; } - // If we are not allowing users to login locally, we should - // be checking to see if the user is actually able to - // authenticate to the authentication server before they - // create an account (otherwise, they can create a local account - // and login as any domain user). We only need to check this for - // domains that aren't local. + // If we are not allowing users to login locally, we should be checking + // to see if the user is actually able to authenticate to the authenti- + // cation server before they create an account (otherwise, they can + // create a local account and login as any domain user). We only need + // to check this for domains that aren't local. if( 'local' != $this->mDomain && '' != $this->mDomain ) { if( !$wgAuth->canCreateAccounts() && ( !$wgAuth->userExists( $this->mName ) || !$wgAuth->authenticate( $this->mName, $this->mPassword ) ) ) { $this->mainLoginForm( wfMsg( 'wrongpassword' ) ); @@ -281,7 +281,8 @@ class LoginForm { } } - # if you need a confirmed email address to edit, then obviously you need an email address. + # if you need a confirmed email address to edit, then obviously you + # need an email address. if ( $wgEmailConfirmToEdit && empty( $this->mEmail ) ) { $this->mainLoginForm( wfMsg( 'noemailtitle' ) ); return false; @@ -292,8 +293,8 @@ class LoginForm { return false; } - # Set some additional data so the AbortNewAccount hook can be - # used for more than just username validation + # Set some additional data so the AbortNewAccount hook can be used for + # more than just username validation $u->setEmail( $this->mEmail ); $u->setRealName( $this->mRealName ); @@ -391,11 +392,12 @@ class LoginForm { } } - // Load $wgUser now, and check to see if we're logging in as the same name. - // This is necessary because loading $wgUser (say by calling getName()) calls - // the UserLoadFromSession hook, which potentially creates the user in the - // database. Until we load $wgUser, checking for user existence using - // User::newFromName($name)->getId() below will effectively be using stale data. + // Load $wgUser now, and check to see if we're logging in as the same + // name. This is necessary because loading $wgUser (say by calling + // getName()) calls the UserLoadFromSession hook, which potentially + // creates the user in the database. Until we load $wgUser, checking + // for user existence using User::newFromName($name)->getId() below + // will effectively be using stale data. if ( $wgUser->getName() === $this->mName ) { wfDebug( __METHOD__.": already logged in as {$this->mName}\n" ); return self::SUCCESS; @@ -425,34 +427,30 @@ class LoginForm { if (!$u->checkPassword( $this->mPassword )) { if( $u->checkTemporaryPassword( $this->mPassword ) ) { - // The e-mailed temporary password should not be used - // for actual logins; that's a very sloppy habit, - // and insecure if an attacker has a few seconds to - // click "search" on someone's open mail reader. + // The e-mailed temporary password should not be used for actu- + // al logins; that's a very sloppy habit, and insecure if an + // attacker has a few seconds to click "search" on someone's o- + // pen mail reader. // - // Allow it to be used only to reset the password - // a single time to a new value, which won't be in - // the user's e-mail archives. + // Allow it to be used only to reset the password a single time + // to a new value, which won't be in the user's e-mail ar- + // chives. // - // For backwards compatibility, we'll still recognize - // it at the login form to minimize surprises for - // people who have been logging in with a temporary - // password for some time. - // - // As a side-effect, we can authenticate the user's - // e-mail address if it's not already done, since - // the temporary password was sent via e-mail. + // For backwards compatibility, we'll still recognize it at the + // login form to minimize surprises for people who have been + // logging in with a temporary password for some time. // + // As a side-effect, we can authenticate the user's e-mail ad- + // dress if it's not already done, since the temporary password + // was sent via e-mail. if( !$u->isEmailConfirmed() ) { $u->confirmEmail(); $u->saveSettings(); } - // At this point we just return an appropriate code - // indicating that the UI should show a password - // reset form; bot interfaces etc will probably just - // fail cleanly here. - // + // At this point we just return an appropriate code/ indicating + // that the UI should show a password reset form; bot inter- + // faces etc will probably just fail cleanly here. $retval = self::RESET_PASS; } else { $retval = '' == $this->mPassword ? self::EMPTY_PASS : self::WRONG_PASS; @@ -473,16 +471,16 @@ class LoginForm { } /** - * Attempt to automatically create a user on login. - * Only succeeds if there is an external authentication method which allows it. + * Attempt to automatically create a user on login. Only succeeds if there + * is an external authentication method which allows it. * @return integer Status code */ function attemptAutoCreate( $user ) { global $wgAuth, $wgUser; /** - * If the external authentication plugin allows it, - * automatically create a new account for users that - * are externally defined but have not yet logged in. + * If the external authentication plugin allows it, automatically cre- + * ate a new account for users that are externally defined but have not + * yet logged in. */ if ( !$wgAuth->autoCreate() ) { return self::NOT_EXISTS; @@ -526,8 +524,8 @@ class LoginForm { $wgMemc->delete( $key ); if( $this->hasSessionCookie() || $this->mSkipCookieCheck ) { - /* Replace the language object to provide user interface in correct - * language immediately on this first page load. + /* Replace the language object to provide user interface in + * correct language immediately on this first page load. */ global $wgLang, $wgRequest; $code = $wgRequest->getVal( 'uselang', $wgUser->getOption( 'language' ) ); @@ -620,7 +618,8 @@ class LoginForm { # Check against password throttle if ( $u->isPasswordReminderThrottled() ) { global $wgPasswordReminderResendTime; - # Round the time in hours to 3 d.p., in case someone is specifying minutes or seconds. + # Round the time in hours to 3 d.p., in case someone is specifying + # minutes or seconds. $this->mainLoginForm( wfMsgExt( 'throttled-mailpassword', array( 'parsemag' ), round( $wgPasswordReminderResendTime, 3 ) ) ); return; @@ -741,7 +740,8 @@ class LoginForm { $wgOut->setArticleRelated( false ); $wgOut->addWikitext( $wgOut->formatPermissionsErrorMessage( $errors, 'createaccount' ) ); - // Stuff that might want to be added at the end. For example, instructions if blocked. + // Stuff that might want to be added at the end. For example, instruc- + // tions if blocked. $wgOut->addWikiMsg( 'cantcreateaccount-nonblock-text' ); $wgOut->returnToMain( false ); @@ -899,9 +899,9 @@ class LoginForm { /** * Check if a session cookie is present. * - * This will not pick up a cookie set during _this_ request, but is - * meant to ensure that the client is returning the cookie which was - * set on a previous pass through the system. + * This will not pick up a cookie set during _this_ request, but is meant + * to ensure that the client is returning the cookie which was set on a + * previous pass through the system. * * @private */ diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 965ac02f28..5d3ee52427 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1101,7 +1101,11 @@ If you are an anonymous user and feel that irrelevant comments have been directe 'noarticletextanon' => '{{int:noarticletext}}', # do not translate or duplicate this message to other languages 'userpage-userdoesnotexist' => 'User account "$1" is not registered. Please check if you want to create/edit this page.', -'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.''", +'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''.", 'usercssjsyoucanpreview' => "Tip: Use the 'Show preview' button to test your new CSS/JS before saving.", 'usercsspreview' => "'''Remember that you are only previewing your user CSS.''' '''It has not yet been saved!'''", @@ -2160,7 +2164,7 @@ Future changes to this page and its associated talk page will be listed there, a 'notanarticle' => 'Not a content page', 'notvisiblerev' => 'Revision has been deleted', 'watchnochange' => 'None of your watched items were edited in the time period displayed.', -'watchlist-details' => '{{PLURAL:$1|$1 page|$1 pages}} watched not counting talk pages.', +'watchlist-details' => '{{PLURAL:$1|$1 page|$1 pages}} on your watchlist, not counting talk pages.', 'wlheader-enotif' => '* E-mail notification is enabled.', 'wlheader-showupdated' => "* Pages which have been changed since you last visited them are shown in '''bold'''", 'watchmethod-recent' => 'checking recent edits for watched pages', -- 2.20.1