MediaWiki  1.23.2
ApiLogout.php
Go to the documentation of this file.
1 <?php
33 class ApiLogout extends ApiBase {
34 
35  public function execute() {
36  $user = $this->getUser();
37  $oldName = $user->getName();
38  $user->logout();
39 
40  // Give extensions to do something after user logout
41  $injected_html = '';
42  wfRunHooks( 'UserLogoutComplete', array( &$user, &$injected_html, $oldName ) );
43  }
44 
45  public function isReadMode() {
46  return false;
47  }
48 
49  public function getAllowedParams() {
50  return array();
51  }
52 
53  public function getResultProperties() {
54  return array();
55  }
56 
57  public function getParamDescription() {
58  return array();
59  }
60 
61  public function getDescription() {
62  return 'Log out and clear session data.';
63  }
64 
65  public function getExamples() {
66  return array(
67  'api.php?action=logout' => 'Log the current user out',
68  );
69  }
70 
71  public function getHelpUrls() {
72  return 'https://www.mediawiki.org/wiki/API:Logout';
73  }
74 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
ApiLogout\getAllowedParams
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Definition: ApiLogout.php:49
ApiLogout\getDescription
getDescription()
Returns the description string for this module.
Definition: ApiLogout.php:61
ContextSource\getUser
getUser()
Get the User object.
Definition: ContextSource.php:132
ApiLogout
API module to allow users to log out of the wiki.
Definition: ApiLogout.php:33
ApiBase
This abstract class implements many basic API functions, and is the base of all API classes.
Definition: ApiBase.php:42
ApiLogout\execute
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Definition: ApiLogout.php:35
ApiLogout\isReadMode
isReadMode()
Indicates whether this module requires read rights.
Definition: ApiLogout.php:45
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4001
ApiLogout\getResultProperties
getResultProperties()
Returns possible properties in the result, grouped by the value of the prop parameter that shows them...
Definition: ApiLogout.php:53
ApiLogout\getParamDescription
getParamDescription()
Returns an array of parameter descriptions.
Definition: ApiLogout.php:57
ApiLogout\getExamples
getExamples()
Returns usage examples for this module.
Definition: ApiLogout.php:65
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
ApiLogout\getHelpUrls
getHelpUrls()
Definition: ApiLogout.php:71
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:237