(bug 42215) "Welcome, X" as account creation title
authorS Page <spage@wikimedia.org>
Mon, 19 Nov 2012 10:37:50 +0000 (02:37 -0800)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 19 Nov 2012 11:13:52 +0000 (11:13 +0000)
Use "Welcome, <user>" as title on successful account creation.
Create separate displaySuccessfulAccountCreation() function that
uses new welcomeuser and welcomecreation-agora messages split from
existing welcomecreation message.

Change-Id: I087c272952e5b2a271411764d368f723719cd0e3

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

index c077c4d..c76047c 100644 (file)
@@ -924,7 +924,24 @@ class LoginForm extends SpecialPage {
                 */
                wfRunHooks( 'BeforeWelcomeCreation', array( &$welcome_creation_msg, &$injected_html ) );
 
-               $this->displaySuccessfulLogin( $welcome_creation_msg, $injected_html );
+               $this->displaySuccessfulAccountCreation( $welcome_creation_msg, $injected_html );
+       }
+
+       /**
+        * Display an "account creation successful" page.
+        * @param $msgname string
+        * @param $injected_html string
+        */
+       private function displaySuccessfulAccountCreation( $msgname, $injected_html ) {
+               $out = $this->getOutput();
+               $out->setPageTitle( $this->msg( 'welcomeuser', $this->getUser()) );
+               if( $msgname ){
+                       $out->addWikiMsg( $msgname, wfEscapeWikiText( $this->getUser()->getName() ) );
+               }
+
+               $out->addHTML( $injected_html );
+
+               $this->executeReturnTo( 'success' );
        }
 
        /**
index 5e33d62..70dabd7 100644 (file)
@@ -1067,9 +1067,12 @@ The administrator who locked it offered this explanation: "$3".',
 
 You can continue to use {{SITENAME}} anonymously, or you can <span class='plainlinks'>[$1 log in again]</span> as the same or as a different user.
 Note that some pages may continue to be displayed as if you were still logged in, until you clear your browser cache.",
+'welcomeuser'                => 'Welcome, $1!',
 'welcomecreation'            => '== Welcome, $1! ==
 Your account has been created.
 Do not forget to change your [[Special:Preferences|{{SITENAME}} preferences]].',
+'welcomecreation-agora'            => 'Your account has been created.
+Do not forget to change your [[Special:Preferences|{{SITENAME}} preferences]].',
 'yourname'                   => 'Username:',
 'yourpassword'               => 'Password:',
 'yourpasswordagain'          => 'Retype password:',
index fca15be..1f7a1bb 100644 (file)
@@ -744,7 +744,9 @@ See also {{msg-mw|protectedinterface}}.',
 # Login and logout pages
 'logouttext' => 'Log out message
 * $1 is an URL to [[Special:Userlogin]] containing returnto and returntoquery parameters',
+'welcomeuser' => 'Text for a welcome heading that users see after registering a user account. $1 is the username of the new user. See [[bugzilla:42215]',
 'welcomecreation' => 'The welcome message users see after registering a user account. $1 is the username of the new user.',
+'welcomecreation-agora' => 'A welcome message users see after registering a user account, following a welcomeuser heading. $1 is the username of the new user.',
 'yourname' => "In user preferences
 
 <nowiki>{{</nowiki>[[Gender|GENDER]]<nowiki>}}</nowiki> is '''NOT''' supported.
index d7a396f..c4f8a5c 100644 (file)
@@ -425,7 +425,9 @@ $wgMessageStructure = array(
        ),
        'login' => array(
                'logouttext',
+               'welcomeuser',
                'welcomecreation',
+               'welcomecreation-agora',
                'yourname',
                'yourpassword',
                'yourpasswordagain',