38 $session = MediaWiki\Session\SessionManager::getGlobalSession();
42 $session->unpersist();
47 if ( !$session->canSetUser() ) {
50 'cannotlogoutnow-text',
51 $session->getProvider()->describe( $this->getErrorFormatter()->getLanguage() )
58 $oldName = $user->getName();
63 Hooks::run(
'UserLogoutComplete', [ &$user, &$injected_html, $oldName ] );
84 'action=logout&token=123ABC'
85 =>
'apihelp-logout-example-logout',
90 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Logout';
This abstract class implements many basic API functions, and is the base of all API classes.
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
API module to allow users to log out of the wiki.
getWebUITokenSalt(array $params)
Fetch the salt used in the Web UI corresponding to this module.
needsToken()
Returns the token type this module requires in order to execute.
getHelpUrls()
Return links to more detailed help pages about the module.
mustBePosted()
Indicates whether this module must be called with a POST request.
isReadMode()
Indicates whether this module requires read rights.
getExamplesMessages()
Returns usage examples for this module.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
getUser()
Get the User object.