From 1bd66ea935ec458716d384604fab202b14e74590 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 17 Apr 2006 04:06:13 +0000 Subject: [PATCH] * (bug 3884) Add $user parameter to AddNewUser hook, call it for by-email registrations as well as self-registrations. --- RELEASE-NOTES | 3 +++ docs/hooks.txt | 2 +- includes/SpecialUserlogin.php | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d8ca6ccf42..16242b3314 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -79,6 +79,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 5536) Use content language for editing help link * Improvements to German localisation files * (bug 5570) Problems using /parameter link form for long titles +* (bug 3884) Add $user parameter to AddNewUser hook, call it for by-email + registrations as well as self-registrations. + == Compatibility == diff --git a/docs/hooks.txt b/docs/hooks.txt index 64dce31ce0..b0d81297bf 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -242,7 +242,7 @@ $user: the User object about to be created (read-only, incomplete) $message: out parameter: error message to display on abort 'AddNewAccount': after a user account is created -null: This hook passes null as an argument +$user: the User object that was created. (Parameter added in 1.7) 'ArticleDelete': before an article is deleted $article: the article (object) being deleted diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index f112acdd69..803d3fcd4a 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -114,6 +114,8 @@ class LoginForm { $u->saveSettings(); $result = $this->mailPasswordInternal($u); + wfRunHooks( 'AddNewAccount', array( $u ) ); + $wgOut->setPageTitle( wfMsg( 'accmailtitle' ) ); $wgOut->setRobotpolicy( 'noindex,nofollow' ); $wgOut->setArticleRelated( false ); @@ -148,7 +150,7 @@ class LoginForm { $wgUser->sendConfirmationMail(); } - wfRunHooks( 'AddNewAccount' ); + wfRunHooks( 'AddNewAccount', array( $u ) ); if( $this->hasSessionCookie() ) { return $this->successfulLogin( wfMsg( 'welcomecreation', $wgUser->getName() ), false ); -- 2.20.1