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