46 parent::__construct(
'Userlogout' );
47 $this->tempUserConfig = $tempUserConfig;
72 if ( $user->isAnon() ) {
77 $this->oldUserName = $user->getName();
79 parent::execute(
$par );
85 $this->
getUser()->isTemp() ?
'userlogout-temp' :
'userlogout-continue'
100 $session = SessionManager::getGlobalSession();
101 if ( !$session->canSetUser() ) {
103 'cannotlogoutnow-title',
104 'cannotlogoutnow-text',
106 $session->getProvider()->describe( $this->getLanguage() )
118 $this->showSuccess();
123 $this->
getHookRunner()->onUserLogoutComplete( $this->
getUser(), $injected_html, $this->oldUserName );
124 $out->addHTML( $injected_html );
127 private function showSuccess() {
129 $this->
getRequest()->getValues(
'returnto',
'returntoquery' ) );
133 $messageKey =
'logouttext';
135 ( isset( $this->oldUserName ) && $this->tempUserConfig->isTempName( $this->oldUserName ) ) ||
136 $this->getRequest()->getCheck(
'wasTempUser' )
140 $messageKey .=
'-for-temporary-account';
142 $out->addWikiMsg( $messageKey, $loginURL );
144 $out->returnToMain();
159 ( isset( $this->oldUserName ) && $this->tempUserConfig->isTempName( $this->oldUserName ) ) ||
160 $this->getRequest()->getCheck(
'wasTempUser' )
162 return $this->
msg(
'templogout' );
164 return parent::getDescription();
172class_alias( SpecialUserLogout::class,
'SpecialUserLogout' );
An error page which can definitely be safely rendered using the OutputPage.
Special page which uses an HTMLForm to handle processing.
string null $par
The subpage of the special page.
Parent class for all special pages.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
getUser()
Shortcut to get the User executing this instance.
getRequest()
Get the WebRequest being used for this instance.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.