MediaWiki  REL1_24
ApiLogout.php
Go to the documentation of this file.
00001 <?php
00033 class ApiLogout extends ApiBase {
00034 
00035     public function execute() {
00036         $user = $this->getUser();
00037         $oldName = $user->getName();
00038         $user->logout();
00039 
00040         // Give extensions to do something after user logout
00041         $injected_html = '';
00042         wfRunHooks( 'UserLogoutComplete', array( &$user, &$injected_html, $oldName ) );
00043     }
00044 
00045     public function isReadMode() {
00046         return false;
00047     }
00048 
00049     public function getAllowedParams() {
00050         return array();
00051     }
00052 
00053     public function getParamDescription() {
00054         return array();
00055     }
00056 
00057     public function getDescription() {
00058         return 'Log out and clear session data.';
00059     }
00060 
00061     public function getExamples() {
00062         return array(
00063             'api.php?action=logout' => 'Log the current user out',
00064         );
00065     }
00066 
00067     public function getHelpUrls() {
00068         return 'https://www.mediawiki.org/wiki/API:Logout';
00069     }
00070 }