From d9022f63880ce039446fba8364f68e656b7bf4cb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 3 May 2012 13:01:35 +0200 Subject: Update to MediaWiki 1.19.0 --- includes/api/ApiLogout.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'includes/api/ApiLogout.php') diff --git a/includes/api/ApiLogout.php b/includes/api/ApiLogout.php index b5dd7ac9..81a054a6 100644 --- a/includes/api/ApiLogout.php +++ b/includes/api/ApiLogout.php @@ -24,11 +24,6 @@ * @file */ -if ( !defined( 'MEDIAWIKI' ) ) { - // Eclipse helper - will be ignored in production - require_once( 'ApiBase.php' ); -} - /** * API module to allow users to log out of the wiki. API equivalent of * Special:Userlogout. @@ -42,13 +37,13 @@ class ApiLogout extends ApiBase { } public function execute() { - global $wgUser; - $oldName = $wgUser->getName(); - $wgUser->logout(); + $user = $this->getUser(); + $oldName = $user->getName(); + $user->logout(); // Give extensions to do something after user logout $injected_html = ''; - wfRunHooks( 'UserLogoutComplete', array( &$wgUser, &$injected_html, $oldName ) ); + wfRunHooks( 'UserLogoutComplete', array( &$user, &$injected_html, $oldName ) ); } public function isReadMode() { @@ -67,9 +62,9 @@ class ApiLogout extends ApiBase { return 'Log out and clear session data'; } - protected function getExamples() { + public function getExamples() { return array( - 'api.php?action=logout' + 'api.php?action=logout' => 'Log the current user out', ); } -- cgit v1.2.2