34 AuthManager::ACTION_CREATE,
35 AuthManager::ACTION_CREATE_CONTINUE
39 'authform-newtoken' =>
'nocookiesfornew',
40 'authform-notoken' =>
'sessionfailure',
41 'authform-wrongtoken' =>
'sessionfailure',
48 parent::__construct(
'CreateAccount',
'createaccount' );
58 parent::checkPermissions();
63 $status = $this->mPosted ?
64 $authManager->authorizeCreateAccount( $performer ) :
65 $authManager->probablyCanCreateAccount( $performer );
66 if ( !$status->isGood() ) {
69 Status::wrap( $status )->getMessage()
79 return AuthManager::ACTION_CREATE;
83 return $this->
msg(
'createaccount' )->text();
99 $user = $this->targetUser ?: $this->
getUser();
102 # Only save preferences if the user is not creating an account for someone else.
103 if ( !$this->proxyAccountCreation ) {
109 $this->
mainLoginForm( [ ], $session->getProvider()->whyNoSession() );
121 $out->setPageTitle( $this->
msg( $byEmail ?
'accmailtitle' :
'accountcreated' ) );
124 $out->addWikiMsg(
'accmailtext', $user->getName(), $user->getEmail() );
126 $out->addWikiMsg(
'accountcreatedtext', $user->getName() );
129 $rt = Title::newFromText( $this->mReturnTo );
131 ( $rt && !$rt->isExternal() ) ? $rt : $this->
getPageTitle(),
140 # Run any hooks; display injected HTML
142 $welcome_creation_msg =
'welcomecreation-msg';
143 $this->
getHookRunner()->onUserLoginComplete( $user, $injected_html, $direct );
150 $this->
getHookRunner()->onBeforeWelcomeCreation( $welcome_creation_msg, $injected_html );
154 $welcome_creation_msg, $injected_html, $extraMessages );
158 return $this->
getRequest()->getSession()->getToken(
'',
'createaccount' );
162 return $this->
getRequest()->getSession()->resetToken(
'createaccount' );
166 return 'wpCreateaccountToken';
174 LoggerFactory::getInstance(
'authevents' )->info(
'Account creation attempt', [
175 'event' =>
'accountcreation',
177 'status' => strval( $status ),
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.
Implements Special:CreateAccount.
getTokenName()
Returns the name of the CSRF token (under which it should be found in the POST or GET data).
successfulAction( $direct=false, $extraMessages=null)
Run any hooks registered for logins, then display a message welcoming the user.
getToken()
Returns the CSRF token.
logAuthResult( $success, $status=null)
Logs to the authmanager-stats channel.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
doesWrites()
Indicates whether this special page may perform database writes.
__construct(AuthManager $authManager)
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
getDescription()
Returns the name that goes in the <h1> in the special page itself, and also the name that will be l...
getDefaultAction( $subPage)
Get the default action for this special page, if none is given via URL/POST data.
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.
getPageTitle( $subpage=false)
Get a self-referential title object.