MediaWiki  REL1_21
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 getResultProperties() {
00054                 return array();
00055         }
00056 
00057         public function getParamDescription() {
00058                 return array();
00059         }
00060 
00061         public function getDescription() {
00062                 return 'Log out and clear session data';
00063         }
00064 
00065         public function getExamples() {
00066                 return array(
00067                         'api.php?action=logout' => 'Log the current user out',
00068                 );
00069         }
00070 
00071         public function getHelpUrls() {
00072                 return 'https://www.mediawiki.org/wiki/API:Logout';
00073         }
00074 }