00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 if ( !defined( 'MEDIAWIKI' ) ) {
00027
00028 require_once ( 'ApiBase.php' );
00029 }
00030
00037 class ApiLogout extends ApiBase {
00038
00039 public function __construct( $main, $action ) {
00040 parent :: __construct( $main, $action );
00041 }
00042
00043 public function execute() {
00044 global $wgUser;
00045 $oldName = $wgUser->getName();
00046 $wgUser->logout();
00047
00048
00049 $injected_html = '';
00050 wfRunHooks( 'UserLogoutComplete', array( &$wgUser, &$injected_html, $oldName ) );
00051 }
00052
00053 public function isReadMode() {
00054 return false;
00055 }
00056
00057 public function getAllowedParams() {
00058 return array ();
00059 }
00060
00061 public function getParamDescription() {
00062 return array ();
00063 }
00064
00065 public function getDescription() {
00066 return array (
00067 'This module is used to logout and clear session data'
00068 );
00069 }
00070
00071 protected function getExamples() {
00072 return array(
00073 'api.php?action=logout'
00074 );
00075 }
00076
00077 public function getVersion() {
00078 return __CLASS__ . ': $Id: ApiLogout.php 69578 2010-07-20 02:46:20Z tstarling $';
00079 }
00080 }