28 parent::__construct( $main, $action,
'create' );
34 $msgs = parent::getFinalDescription();
35 $msgs[] = $this->
msg(
'api-help-authmanager-general-usage',
39 AuthManager::ACTION_CREATE,
51 if ( $params[
'returnurl'] !==
null ) {
52 $bits = $this->urlUtils->parse( $params[
'returnurl'] );
53 if ( !$bits || $bits[
'scheme'] ===
'' ) {
56 [
'apierror-badurl', $encParamName,
wfEscapeWikiText( $params[
'returnurl'] ) ],
57 "badurl_{$encParamName}"
65 if ( !$this->authManager->canCreateAccounts() ) {
66 $res = AuthenticationResponse::newFail( $this->
msg(
'userlogin-cannot-' . AuthManager::ACTION_CREATE ) );
67 $this->
getResult()->addValue(
null,
'createaccount',
68 $helper->formatAuthenticationResponse( $res ) );
69 $helper->logAuthenticationResult(
'accountcreation', $performer, $res );
74 if ( $params[
'continue'] ) {
75 $reqs = $helper->loadAuthenticationRequests( AuthManager::ACTION_CREATE_CONTINUE );
76 $res = $this->authManager->continueAccountCreation( $reqs );
78 $reqs = $helper->loadAuthenticationRequests( AuthManager::ACTION_CREATE );
79 if ( $params[
'preservestate'] ) {
80 $req = $helper->getPreservedRequest();
85 $res = $this->authManager->beginAccountCreation(
92 $this->
getResult()->addValue(
null,
'createaccount',
93 $helper->formatAuthenticationResponse( $res ) );
94 $helper->logAuthenticationResult(
'accountcreation', $performer, $res );
109 return 'createaccount';
115 'requests',
'messageformat',
'mergerequestfields',
'preservestate',
'returnurl',
'continue'
118 'apihelp-createaccount-param-preservestate';
124 return [
'api-help-authmanagerhelper-additional-params', AuthManager::ACTION_CREATE ];
130 'action=createaccount&username=Example&password=ExamplePassword&retype=ExamplePassword'
131 .
'&createreturnurl=http://example.org/&createtoken=123ABC'
132 =>
'apihelp-createaccount-example-create',
138 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Account_creation';
143class_alias( ApiAMCreateAccount::class,
'ApiAMCreateAccount' );
wfEscapeWikiText( $input)
Escapes the given text so that it may be output using addWikiText() without any linking,...
This is the main API class, used for both external and internal processing.
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()