$template->set(), etc. The hook has access to most of the stuff that will go into the
Login/Create form; see the documentation on HTMLForm for syntax for extra fields.
LoginForm class is deprecated, its state constants are now in the Login class.
+* New hook AbortNewAccountAuto, called before account creation from AuthPlugin-
+ or ExtUser-driven requests.
=== New features in 1.16 ===
$user: the User object about to be created (read-only, incomplete)
$message: out parameter: error message to display on abort
+'AbortNewAccountAuto': Return false to cancel account creation when the
+ request is coming from an AuthPlugin or ExtUser, rather than a
+ manually-submitted CreateAccount form.
+$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
$user: the User object that was created. (Parameter added in 1.7)
$byEmail: true when account was created "by email" (added in 1.12)
# is for an external auth plugin to autocreate the local user first.
if ( $this->mUser->getID() == 0 ) {
if ( $this->canAutoCreate() == self::SUCCESS ) {
+
$isAutoCreated = true;
wfDebug( __METHOD__.": creating account\n" );
+
+ if( !wfRunHooks( 'AbortNewAccountAuto', array( $this->mUser, &$this->mCreateResult ) ) ) {
+ wfDebug( __METHOD__ . ": a hook blocked creation\n" );
+ return self::ABORTED;
+ }
+
$result = $this->initUser( true );
if( $result !== self::SUCCESS ){
return $result;
- };
+ }
+
} else {
return $this->canAutoCreate();
}
if( !wfRunHooks( 'AbortNewAccount', array( $this->mUser, &$this->mCreateResult ) ) ) {
# Hook point to add extra creation throttles and blocks
- wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" );
+ wfDebug( __METHOD__ . ": a hook blocked creation\n" );
return self::ABORTED;
}