From b971a366a0cf89c94274f207627eaee769f91b4e Mon Sep 17 00:00:00 2001 From: Nimish Gautam Date: Wed, 13 Apr 2011 23:47:01 +0000 Subject: [PATCH] Created BeforeWelcomeCreation hook to be run before any welcome message gets displayed --- includes/specials/SpecialUserlogin.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 348ee57959..e23e28d61a 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -904,9 +904,14 @@ class LoginForm extends SpecialPage { global $wgUser; # Run any hooks; display injected HTML $injected_html = ''; + $welcome_creation_msg = 'welcomecreation'; + wfRunHooks( 'UserLoginComplete', array( &$wgUser, &$injected_html ) ); - - $this->displaySuccessfulLogin( 'welcomecreation', $injected_html ); + + //let any extensions change what message is shown + wfRunHooks( 'BeforeWelcomeCreation', array( &$welcome_creation_msg, &$injected_html ) ); + + $this->displaySuccessfulLogin( $welcome_creation_msg, $injected_html ); } /** @@ -916,7 +921,10 @@ class LoginForm extends SpecialPage { global $wgOut, $wgUser; $wgOut->setPageTitle( wfMsg( 'loginsuccesstitle' ) ); - $wgOut->addWikiMsg( $msgname, $wgUser->getName() ); + if( $msgname ){ + $wgOut->addWikiMsg( $msgname, $wgUser->getName() ); + } + $wgOut->addHTML( $injected_html ); if ( !empty( $this->mReturnTo ) ) { -- 2.20.1