* Add a hook for additional user creation throttle / limiter extensions
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 17 Dec 2005 03:18:39 +0000 (03:18 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 17 Dec 2005 03:18:39 +0000 (03:18 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/SpecialUserlogin.php

index fd83c53..95b3f3e 100644 (file)
@@ -331,6 +331,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 1586) Fix interwiki generator for wikimedia obscure domains
 * (bug 3493) Mark edits patrolled when they are reverted
   patch by Leon Planken
+* Add a hook for additional user creation throttle / limiter extensions
 
 
 === Caveats ===
index 54507d5..1197f43 100644 (file)
@@ -237,6 +237,9 @@ protocol came about after MediaWiki 1.4rc1.
 This is a list of known events and parameters; please add to it if
 you're going to add events to the MediaWiki code.
 
+'AbortNewAccount': Return false to cancel account creation.
+$user: the User object about to be created (read-only, incomplete)
+
 'AddNewAccount': after a user account is created
 null: This hook passes null as an argument
 
index 719be81..eedbdee 100644 (file)
@@ -237,6 +237,12 @@ class LoginForm {
                                return false;
                        }
                }
+               
+               if( !wfRunHooks( 'AbortNewAccount', array( $u ) ) ) {
+                       // Hook point to add extra creation throttles and blocks
+                       wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" );
+                       return false;
+               }
 
                if( !$wgAuth->addUser( $u, $this->mPassword ) ) {
                        $this->mainLoginForm( wfMsg( 'externaldberror' ) );