Merge "(bug 42215) "Welcome, X" as account creation title"
authorOri.livneh <ori@wikimedia.org>
Wed, 21 Nov 2012 04:15:32 +0000 (04:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 21 Nov 2012 04:15:32 +0000 (04:15 +0000)
1  2 
includes/specials/SpecialUserlogin.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

@@@ -559,7 -559,7 +559,7 @@@ class LoginForm extends SpecialPage 
                }
  
                $isAutoCreated = false;
 -              if ( 0 == $u->getID() ) {
 +              if ( $u->getID() == 0 ) {
                        $status = $this->attemptAutoCreate( $u );
                        if ( $status !== self::SUCCESS ) {
                                return $status;
                } else {
                        global $wgExternalAuthType, $wgAutocreatePolicy;
                        if ( $wgExternalAuthType && $wgAutocreatePolicy != 'never'
 -                      && is_object( $this->mExtUser )
 -                      && $this->mExtUser->authenticate( $this->mPassword ) ) {
 +                              && is_object( $this->mExtUser )
 +                              && $this->mExtUser->authenticate( $this->mPassword )
 +                      ) {
                                # The external user and local user have the same name and
                                # password, so we assume they're the same.
                                $this->mExtUser->linkToLocal( $u->getID() );
                 */
                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' );
        }
  
        /**
@@@ -1067,9 -1067,12 +1067,12 @@@ The administrator who locked it offere
  
  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:',
@@@ -2315,7 -2318,6 +2318,7 @@@ If the problem persists, contact an [[S
  'backend-fail-notsame'       => 'A non-identical file already exists at "$1".',
  'backend-fail-invalidpath'   => '"$1" is not a valid storage path.',
  'backend-fail-delete'        => 'Could not delete file "$1".',
 +'backend-fail-describe'      => 'Could not change metadata for file "$1".',
  'backend-fail-alreadyexists' => 'The file "$1" already exists.',
  'backend-fail-store'         => 'Could not store file "$1" at "$2".',
  'backend-fail-copy'          => 'Could not copy file "$1" to "$2".',
@@@ -365,8 -365,7 +365,8 @@@ This can also appear in the credits pag
  {{Identical|Find}}',
  'qbbrowse' => '{{Identical|Browse}}',
  'qbedit' => '{{Identical|Edit}}',
 -'qbmyoptions' => '{{Identical|My pages}}',
 +'qbmyoptions' => 'Heading in the Cologne Blue skin user menu containing links to user (talk) page, preferences, watchlist, etc.
 +{{Identical|My pages}}',
  'qbspecialpages' => '{{Identical|Special pages}}',
  'faqpage' => "FAQ is short for ''frequently asked questions''. This page is only linked on some of the old skins, not in Monobook or Modern.
  
@@@ -745,7 -744,9 +745,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.
@@@ -2106,8 -2107,6 +2108,8 @@@ Extensions making use of it
  * $1 is a storage path.',
  'backend-fail-delete' => 'Parameters:
  * $1 is a file path.',
 +'backend-fail-describe' => 'Parameters:
 +* $1 is a file path.',
  'backend-fail-alreadyexists' => 'Parameters:
  * $1 is a filename.',
  'backend-fail-store' => 'Parameters:
@@@ -3696,7 -3695,7 +3698,7 @@@ Parameters
  Start with a lowercase letter, unless the first word is “SVG”.',
  'svg-long-desc-animated' => 'Displayed under an SVG image at the image description page if the image is animated. Non-animated images use {{msg-mw|svg-long-desc}}.
  * $1 is the width in pixels
 -* $2 is the height in pixels, and 
 +* $2 is the height in pixels, and
  * $3 is the file size including a unit (for example "10 KB").
  
  Start with a lowercase letter, unless the first word is “SVG”.',
@@@ -425,7 -425,9 +425,9 @@@ $wgMessageStructure = array
        ),
        'login' => array(
                'logouttext',
+               'welcomeuser',
                'welcomecreation',
+               'welcomecreation-agora',
                'yourname',
                'yourpassword',
                'yourpasswordagain',
                'backend-fail-notsame',
                'backend-fail-invalidpath',
                'backend-fail-delete',
 +              'backend-fail-describe',
                'backend-fail-alreadyexists',
                'backend-fail-store',
                'backend-fail-copy',