45 parent::__construct( $main, $action,
'create' );
46 $this->authManager = $authManager;
47 $this->urlUtils = $urlUtils;
52 $msgs = parent::getFinalDescription();
53 $msgs[] = $this->
msg(
'api-help-authmanager-general-usage',
57 AuthManager::ACTION_CREATE,
69 if (
$params[
'returnurl'] !==
null ) {
70 $bits = $this->urlUtils->parse(
$params[
'returnurl'] );
71 if ( !$bits || $bits[
'scheme'] ===
'' ) {
75 "badurl_{$encParamName}"
83 if ( !$this->authManager->canCreateAccounts() ) {
84 $res = AuthenticationResponse::newFail( $this->
msg(
'userlogin-cannot-' . AuthManager::ACTION_CREATE ) );
85 $this->
getResult()->addValue(
null,
'createaccount',
86 $helper->formatAuthenticationResponse( $res ) );
87 $helper->logAuthenticationResult(
'accountcreation', $performer, $res );
93 $reqs = $helper->loadAuthenticationRequests( AuthManager::ACTION_CREATE_CONTINUE );
94 $res = $this->authManager->continueAccountCreation( $reqs );
96 $reqs = $helper->loadAuthenticationRequests( AuthManager::ACTION_CREATE );
97 if (
$params[
'preservestate'] ) {
98 $req = $helper->getPreservedRequest();
103 $res = $this->authManager->beginAccountCreation(
110 $this->
getResult()->addValue(
null,
'createaccount',
111 $helper->formatAuthenticationResponse( $res ) );
112 $helper->logAuthenticationResult(
'accountcreation', $performer, $res );
124 return 'createaccount';
129 'requests',
'messageformat',
'mergerequestfields',
'preservestate',
'returnurl',
'continue'
132 'apihelp-createaccount-param-preservestate';
137 return [
'api-help-authmanagerhelper-additional-params', AuthManager::ACTION_CREATE ];
142 'action=createaccount&username=Example&password=ExamplePassword&retype=ExamplePassword'
143 .
'&createreturnurl=http://example.org/&createtoken=123ABC'
144 =>
'apihelp-createaccount-example-create',
149 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Account_creation';
154class_alias( ApiAMCreateAccount::class,
'ApiAMCreateAccount' );
wfEscapeWikiText( $input)
Escapes the given text so that it may be output using addWikiText() without any linking,...
array $params
The job parameters.
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()