41 AuthManager::ACTION_CREATE,
42 AuthManager::ACTION_CREATE_CONTINUE
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() ) {
76 Status::wrap( $status )->getMessage()
86 return AuthManager::ACTION_CREATE;
90 return $this->
msg(
'createaccount' );
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->setPageTitleMsg( $this->
msg( $byEmail ?
'accmailtitle' :
'accountcreated' ) );
131 $out->addWikiMsg(
'accmailtext', $user->getName(), $user->getEmail() );
133 $out->addWikiMsg(
'accountcreatedtext', $user->getName() );
136 $rt = Title::newFromText( $this->mReturnTo );
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 );
162 $welcome_creation_msg, $injected_html, $extraMessages );
166 return $this->
getRequest()->getSession()->getToken(
'',
'createaccount' );
170 $this->
getRequest()->getSession()->resetToken(
'createaccount' );
174 return 'wpCreateaccountToken';
182 LoggerFactory::getInstance(
'authevents' )->info(
'Account creation attempt', [
183 'event' =>
'accountcreation',
185 'status' => strval( $status ),
193class_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.
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.