From: Brion Vibber Date: Sat, 17 Dec 2005 03:18:39 +0000 (+0000) Subject: * Add a hook for additional user creation throttle / limiter extensions X-Git-Tag: 1.6.0~935 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=02de1965866421c6720cd42270a2e03898a07864;p=lhc%2Fweb%2Fwiklou.git * Add a hook for additional user creation throttle / limiter extensions --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index fd83c53704..95b3f3e87a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/docs/hooks.txt b/docs/hooks.txt index 54507d529b..1197f43862 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 719be81277..eedbdeeb08 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -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' ) );