*/
use MediaWiki\Auth\AuthManager;
-use MediaWiki\Auth\AuthenticationRequest;
use MediaWiki\Auth\AuthenticationResponse;
/**
$helper = new ApiAuthManagerHelper( $this );
$manager = AuthManager::singleton();
- // Make sure it's possible to log in
+ // Make sure it's possible to create accounts
if ( !$manager->canCreateAccounts() ) {
$this->getResult()->addValue( null, 'createaccount', $helper->formatAuthenticationResponse(
AuthenticationResponse::newFail(
$this->msg( 'userlogin-cannot-' . AuthManager::ACTION_CREATE )
)
) );
+ $helper->logAuthenticationResult( 'accountcreation',
+ 'userlogin-cannot-' . AuthManager::ACTION_CREATE );
return;
}
$this->getResult()->addValue( null, 'createaccount',
$helper->formatAuthenticationResponse( $res ) );
+ $helper->logAuthenticationResult( 'accountcreation', $res );
}
public function isReadMode() {
}
public function getAllowedParams() {
- return ApiAuthManagerHelper::getStandardParams( AuthManager::ACTION_CREATE,
+ $ret = ApiAuthManagerHelper::getStandardParams( AuthManager::ACTION_CREATE,
'requests', 'messageformat', 'mergerequestfields', 'preservestate', 'returnurl', 'continue'
);
+ $ret['preservestate'][ApiBase::PARAM_HELP_MSG_APPEND][] =
+ 'apihelp-createaccount-param-preservestate';
+ return $ret;
}
public function dynamicParameterDocumentation() {