Tweak login/account creation for logged in users
authorAlex Monk <krenair@gmail.com>
Sat, 22 Dec 2012 20:12:09 +0000 (20:12 +0000)
committerMatmaRex <matma.rex@gmail.com>
Tue, 13 Aug 2013 14:45:37 +0000 (16:45 +0200)
* Don't show the "Don't have an account? [Join <sitename>]" box to
  logged-in users.
* Use different message for "Real name" (disabled on WMF wikis) when
  creating another's account.

Also document showCreateOrLoginLink() and set its visibility.

Bug: 43172
Change-Id: I1b0bb6b78cbc5d37ef9f380a4bdf0f65d021a57f

includes/specials/SpecialUserlogin.php
includes/templates/Usercreate.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index 13a91aa..df1b16e 100644 (file)
@@ -1209,14 +1209,16 @@ class LoginForm extends SpecialPage {
        }
 
        /**
-        * @private
+        * Whether the login/create account form should display a link to the
+        * other form (in addition to whatever the skin provides).
         *
         * @param $user User
-        *
-        * @return Boolean
+        * @return bool
         */
-       function showCreateOrLoginLink( &$user ) {
-               if ( $this->mType == 'signup' ) {
+       private function showCreateOrLoginLink( &$user ) {
+               if ( $user->isLoggedIn() ) {
+                       return false;
+               } elseif ( $this->mType == 'signup' ) {
                        return true;
                } elseif ( $user->isAllowed( 'createaccount' ) ) {
                        return true;
index c7a0014..3d848cf 100644 (file)
@@ -175,7 +175,7 @@ class UsercreateTemplate extends BaseTemplate {
                                        tabindex="7"
                                        value="<?php $this->text( 'realname' ); ?>" size='20' />
                                <div class="prefsectiontip">
-                                       <?php $this->msgWiki( 'prefs-help-realname' ); ?>
+                                       <?php $this->msgWiki( $this->data['createAnother'] ? 'createacct-another-realname-tip' : 'prefs-help-realname' ); ?>
                                </div>
                        </div>
                <?php }
index b60ff6e..67fe889 100644 (file)
@@ -1257,6 +1257,8 @@ Please wait before trying again.',
 * {{#language:it}}|it
 * {{#language:nl}}|nl', # do not translate or duplicate this message to other languages
 'suspicious-userlogout'           => 'Your request to log out was denied because it looks like it was sent by a broken browser or caching proxy.',
+'createacct-another-realname-tip' => 'Real name is optional.
+If you choose to provide it, this will be used for giving the user attribution for their work.',
 
 # Email sending
 'pear-mail-error'        => '$1', # do not translate or duplicate this message to other languages
index 62b50d4..f7501b9 100644 (file)
@@ -1370,6 +1370,8 @@ See also:
 'loginlanguagelabel' => 'Used on [[Special:UserLogin]] if $wgLoginLanguageSelector is true. $1 is a pipe-separated list built from the names that appear in the message {{msg-mw|Loginlanguagelinks}}.
 {{Identical|Language}}',
 'suspicious-userlogout' => 'Used when the logout request looks suspicious, in Special:UserLogout.',
+'createacct-another-realname-tip' => 'Used on the account creation form when creating another user\'s account. Similar to {{mw-msg|prefs-help-realname}}.
+{{Identical|Real name attribution}}',
 
 # Email sending
 'php-mail-error-unknown' => 'Used as error message when <code>mail()</code> returned empty error message.',
index c266f89..5a42091 100644 (file)
@@ -564,6 +564,7 @@ $wgMessageStructure = array(
                'loginlanguagelabel',
                'loginlanguagelinks',
                'suspicious-userlogout',
+               'createacct-another-realname-tip',
        ),
        'mail' => array(
                'pear-mail-error',