Index: extensions/AntiSpoof/AntiSpoof.php =================================================================== --- extensions/AntiSpoof/AntiSpoof.php (revision 36517) +++ extensions/AntiSpoof/AntiSpoof.php (working copy) @@ -60,7 +60,7 @@ * @param string $message * @return bool true to continue, false to abort user creation */ -function asAbortNewAccountHook( $user, &$message ) { +function asAbortNewAccountHook( $user, &$message, &$extrainput ) { global $wgAntiSpoofAccounts, $wgUser; wfLoadExtensionMessages( 'AntiSpoof' ); @@ -84,6 +84,7 @@ wfDebugLog( 'antispoof', "{$mode}PASS new account '$name' [$normalized]" ); } else { wfDebugLog( 'antispoof', "{$mode}CONFLICT new account '$name' [$normalized] spoofs '$conflict'" ); + global $wgRequest; if( $active ) { $message = wfMsg( 'antispoof-name-conflict', $name, $conflict ); return false; @@ -88,6 +89,11 @@ $message = wfMsg( 'antispoof-name-conflict', $name, $conflict ); return false; } + elseif( $mode = 'OVERRIDE' && !$wgRequest->getText( 'wpOverride' ) ) { + $message = wfMsg( 'antispoof-name-warning', $name, $conflict ); + $extrainput = array( 'name' => 'wpOverride', 'value' => true ); + return false; + } } } else { $error = $spoof->getError(); Index: phase3/includes/templates/Userlogin.php =================================================================== --- phase3/includes/templates/Userlogin.php (revision 36517) +++ phase3/includes/templates/Userlogin.php (working copy) @@ -208,6 +208,11 @@ tabindex="9" value="msg('createaccountmail') ?>" /> + data['extrainput'] ) && $this->data['extrainput']['name'] ) { ?> + + Index: phase3/includes/specials/SpecialUserlogin.php =================================================================== --- phase3/includes/specials/SpecialUserlogin.php (revision 36517) +++ phase3/includes/specials/SpecialUserlogin.php (working copy) @@ -297,10 +297,14 @@ $u->setRealName( $this->mRealName ); $abortError = ''; - if( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError ) ) ) { + if( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError, &$extraInput ) ) ) { // Hook point to add extra creation throttles and blocks wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" ); - $this->mainLoginForm( $abortError ); + if( is_array( $extrainput ) ) { + $this->mainLoginForm( $abortError, $extraInput ); + } else { + $this->mainLoginForm( $abortError ); + } return false; } @@ -710,7 +714,7 @@ /** * @private */ - function mainLoginForm( $msg, $msgtype = 'error' ) { + function mainLoginForm( $msg, $msgtype = 'error', $extrainput ) { global $wgUser, $wgOut, $wgAllowRealName, $wgEnableEmail; global $wgCookiePrefix, $wgAuth, $wgLoginLanguageSelector; global $wgAuth, $wgEmailConfirmToEdit; @@ -793,6 +797,15 @@ $template->set( 'canreset', $wgAuth->allowPasswordChange() ); $template->set( 'remember', $wgUser->getOption( 'rememberpassword' ) or $this->mRemember ); + if( is_array( $extrainput ) && isset( $extrainput['name'] ) ) { + if( isset( $extrainput['value'] ) ) { + $template->set( 'extrainput', array( 'name' => $extrainput['name'], 'value' => $extrainput['value'] ) ); + } + else { + $template->set( 'extrainput', array( 'name' => $extrainput['name'], 'value' => false ) ); + } + } + # Prepare language selection links as needed if( $wgLoginLanguageSelector ) { $template->set( 'languages', $this->makeLanguageSelector() );