24 namespace MediaWiki\Specials;
46 'authform-newtoken' =>
'nocookiesfornew',
47 'authform-notoken' =>
'sessionfailure',
48 'authform-wrongtoken' =>
'sessionfailure',
55 parent::__construct(
'CreateAccount',
'createaccount' );
65 parent::checkPermissions();
70 $status = $this->mPosted ?
71 $authManager->authorizeCreateAccount( $performer ) :
72 $authManager->probablyCanCreateAccount( $performer );
73 if ( !$status->isGood() ) {
90 return $this->
msg(
'createaccount' )->text();
106 $user = $this->targetUser ?: $this->
getUser();
109 # Only save preferences if the user is not creating an account for someone else.
110 if ( !$this->proxyAccountCreation ) {
116 $this->
mainLoginForm( [ ], $session->getProvider()->whyNoSession() );
128 $out->setPageTitle( $this->
msg( $byEmail ?
'accmailtitle' :
'accountcreated' ) );
131 $out->addWikiMsg(
'accmailtext', $user->getName(), $user->getEmail() );
133 $out->addWikiMsg(
'accountcreatedtext', $user->getName() );
138 ( $rt && !$rt->isExternal() ) ? $rt : $this->getPageTitle(),
147 # Run any hooks; display injected HTML
149 $welcome_creation_msg =
'welcomecreation-msg';
150 $this->
getHookRunner()->onUserLoginComplete( $user, $injected_html, $direct );
157 $this->
getHookRunner()->onBeforeWelcomeCreation( $welcome_creation_msg, $injected_html );
161 $welcome_creation_msg, $injected_html, $extraMessages );
165 return $this->
getRequest()->getSession()->getToken(
'',
'createaccount' );
169 $this->
getRequest()->getSession()->resetToken(
'createaccount' );
173 return 'wpCreateaccountToken';
182 'event' =>
'accountcreation',
184 'status' => strval( $status ),
192 class_alias( SpecialCreateAccount::class,
'SpecialCreateAccount' );
wfCgiToArray( $query)
This is the logical opposite of wfArrayToCgi(): it accepts a query string as its argument and returns...
string $subPage
Subpage of the special page.
getRequest()
Get the WebRequest being used for this instance.
An error page which can definitely be safely rendered using the OutputPage.
Holds shared logic for login and account creation pages.
mainLoginForm(array $requests, $msg='', $msgtype='error')
showSuccessPage( $type, $title, $msgname, $injected_html, $extraMessages)
Show the success page.
hasSessionCookie()
Check if a session cookie is present.
getName()
Get the name of this Special Page.
getOutput()
Get the OutputPage being used for this instance.
getUser()
Shortcut to get the User executing this instance.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getAuthority()
Shortcut to get the Authority executing this instance.
setAuthManager(AuthManager $authManager)
Set the injected AuthManager from the special page constructor.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
static wrap( $sv)
Succinct helper method to wrap a StatusValue.