41 AuthManager::ACTION_CREATE,
42 AuthManager::ACTION_CREATE_CONTINUE
46 'authform-newtoken' =>
'nocookiesfornew',
47 'authform-notoken' =>
'sessionfailure',
48 'authform-wrongtoken' =>
'sessionfailure',
58 parent::__construct(
'CreateAccount',
'createaccount' );
61 $this->formatterFactory = $formatterFactory;
69 parent::checkPermissions();
74 $status = $this->mPosted ?
75 $authManager->authorizeCreateAccount( $performer ) :
76 $authManager->probablyCanCreateAccount( $performer );
78 if ( !$status->isGood() ) {
79 $formatter = $this->formatterFactory->getStatusFormatter( $this->
getContext() );
82 $formatter->getMessage( $status )
92 return AuthManager::ACTION_CREATE;
96 return $this->
msg(
'createaccount' );
112 $user = $this->targetUser ?: $this->
getUser();
116 # Only save preferences if the user is not creating an account for someone else.
117 if ( !$this->proxyAccountCreation ) {
123 $this->
mainLoginForm( [ ], $session->getProvider()->whyNoSession() );
135 $out->setPageTitleMsg( $this->
msg( $byEmail ?
'accmailtitle' :
'accountcreated' ) );
138 $out->addWikiMsg(
'accmailtext', $user->getName(), $user->getEmail() );
140 $out->addWikiMsg(
'accountcreatedtext', $user->getName() );
143 $rt = Title::newFromText( $this->mReturnTo );
145 ( $rt && !$rt->isExternal() ) ? $rt : $this->
getPageTitle(),
150 $this->
getHookRunner()->onUserLoginComplete( $user, $injected_html, $direct );
155 # Run any hooks; display injected HTML
156 $welcome_creation_msg =
'welcomecreation-msg';
162 $this->
getHookRunner()->onBeforeWelcomeCreation( $welcome_creation_msg, $injected_html );
167 $welcome_creation_msg, $injected_html, $extraMessages );
171 return $this->
getRequest()->getSession()->getToken(
'',
'createaccount' );
175 $this->
getRequest()->getSession()->resetToken(
'createaccount' );
179 return 'wpCreateaccountToken';
187 LoggerFactory::getInstance(
'authevents' )->info(
'Account creation attempt', [
188 'event' =>
'accountcreation',
190 'status' => strval( $status ),
198class_alias( SpecialCreateAccount::class,
'SpecialCreateAccount' );
wfCgiToArray( $query)
This is the logical opposite of wfArrayToCgi(): it accepts a query string as its argument and returns...
An error page which can definitely be safely rendered using the OutputPage.
string $subPage
Subpage of the special page.
getRequest()
Get the WebRequest being used for this instance.
Holds shared logic for login and account creation pages.
showSuccessPage( $type, $title, $msgname, $injected_html, $extraMessages)
Show the success page.
mainLoginForm(array $requests, $msg='', $msgtype='error')
hasSessionCookie()
Check if a session cookie is present.
getUser()
Shortcut to get the User executing this instance.
setAuthManager(AuthManager $authManager)
Set the injected AuthManager from the special page constructor.
getPageTitle( $subpage=false)
Get a self-referential title object.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
getAuthority()
Shortcut to get the Authority executing this instance.
getName()
Get the name of this Special Page.
Generic operation result class Has warning/error list, boolean status and arbitrary value.