34 $session = MediaWiki\Session\SessionManager::getGlobalSession();
38 $session->unpersist();
43 if ( !$session->canSetUser() ) {
46 'cannotlogoutnow-text',
47 $session->getProvider()->describe( $this->getErrorFormatter()->getLanguage() )
54 $oldName = $user->getName();
59 $this->
getHookRunner()->onUserLogoutComplete( $user, $injected_html, $oldName );
80 'action=logout&token=123ABC'
81 =>
'apihelp-logout-example-logout',
86 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=0)
Abort execution with an error.
getHookRunner()
Get an ApiHookRunner for running core API hooks.
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.