jenkins-bot has submitted this change and it was merged.

Change subject: Tweak login/account creation for logged in users
......................................................................


Tweak login/account creation for logged in users

* 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
---
M includes/specials/SpecialUserlogin.php
M includes/templates/Usercreate.php
M languages/messages/MessagesEn.php
M languages/messages/MessagesQqq.php
M maintenance/language/messages.inc
5 files changed, 13 insertions(+), 6 deletions(-)

Approvals:
  Alex Monk: Looks good to me, but someone else must approve
  Matmarex: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialUserlogin.php 
b/includes/specials/SpecialUserlogin.php
index 13a91aa..df1b16e 100644
--- a/includes/specials/SpecialUserlogin.php
+++ b/includes/specials/SpecialUserlogin.php
@@ -1209,14 +1209,16 @@
        }
 
        /**
-        * @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;
diff --git a/includes/templates/Usercreate.php 
b/includes/templates/Usercreate.php
index c7a0014..3d848cf 100644
--- a/includes/templates/Usercreate.php
+++ b/includes/templates/Usercreate.php
@@ -175,7 +175,7 @@
                                        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 }
diff --git a/languages/messages/MessagesEn.php 
b/languages/messages/MessagesEn.php
index b60ff6e..67fe889 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -1257,6 +1257,8 @@
 * {{#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
diff --git a/languages/messages/MessagesQqq.php 
b/languages/messages/MessagesQqq.php
index 62b50d4..f7501b9 100644
--- a/languages/messages/MessagesQqq.php
+++ b/languages/messages/MessagesQqq.php
@@ -1370,6 +1370,8 @@
 '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.',
diff --git a/maintenance/language/messages.inc 
b/maintenance/language/messages.inc
index c266f89..5a42091 100644
--- a/maintenance/language/messages.inc
+++ b/maintenance/language/messages.inc
@@ -564,6 +564,7 @@
                'loginlanguagelabel',
                'loginlanguagelinks',
                'suspicious-userlogout',
+               'createacct-another-realname-tip',
        ),
        'mail' => array(
                'pear-mail-error',

-- 
To view, visit https://gerrit.wikimedia.org/r/39862
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1b0bb6b78cbc5d37ef9f380a4bdf0f65d021a57f
Gerrit-PatchSet: 14
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Liangent <[email protected]>
Gerrit-Reviewer: Matmarex <[email protected]>
Gerrit-Reviewer: Nemo bis <[email protected]>
Gerrit-Reviewer: Spage <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to