From 750936fdbcee00f6b580192df6d2bfc927b80cbb Mon Sep 17 00:00:00 2001 From: S Page Date: Mon, 19 Nov 2012 02:37:50 -0800 Subject: [PATCH] (bug 42215) "Welcome, X" as account creation title Use "Welcome, " 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 | 19 ++++++++++++++++++- languages/messages/MessagesEn.php | 3 +++ languages/messages/MessagesQqq.php | 2 ++ maintenance/language/messages.inc | 2 ++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index c077c4d411..c76047cb7b 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -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' ); } /** diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 5e33d62425..70dabd75de 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1067,9 +1067,12 @@ The administrator who locked it offered this explanation: "$3".', You can continue to use {{SITENAME}} anonymously, or you can [$1 log in again] 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:', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index fca15bef00..1f7a1bb190 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -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 {{[[Gender|GENDER]]}} is '''NOT''' supported. diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index d7a396f6d3..c4f8a5cc91 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -425,7 +425,9 @@ $wgMessageStructure = array( ), 'login' => array( 'logouttext', + 'welcomeuser', 'welcomecreation', + 'welcomecreation-agora', 'yourname', 'yourpassword', 'yourpasswordagain', -- 2.20.1