* (bug 3884) Add $user parameter to AddNewUser hook, call it for by-email
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 17 Apr 2006 04:06:13 +0000 (04:06 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 17 Apr 2006 04:06:13 +0000 (04:06 +0000)
  registrations as well as self-registrations.

RELEASE-NOTES
docs/hooks.txt
includes/SpecialUserlogin.php

index d8ca6cc..16242b3 100644 (file)
@@ -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 <special page>/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 ==
 
index 64dce31..b0d8129 100644 (file)
@@ -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
index f112acd..803d3fc 100644 (file)
@@ -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 );