From d9deecf432ab2b172a1aaa0d82dc9cb62c7e92ee Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 28 Aug 2018 15:00:08 -0700 Subject: [PATCH] Split AuthManagerAuthPluginUser into a separate file Change-Id: I22d2bf9514caf717a5d949bed425de1376670d3e --- .phpcs.xml | 1 - autoload.php | 2 +- includes/auth/AuthManagerAuthPlugin.php | 30 ------------ includes/auth/AuthManagerAuthPluginUser.php | 53 +++++++++++++++++++++ 4 files changed, 54 insertions(+), 32 deletions(-) create mode 100644 includes/auth/AuthManagerAuthPluginUser.php diff --git a/.phpcs.xml b/.phpcs.xml index 65ddb73393..9f9459ba04 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -226,7 +226,6 @@ */includes/api/ApiOpenSearch\.php */includes/api/ApiRsd\.php */includes/api/ApiUsageException\.php - */includes/auth/AuthManagerAuthPlugin\.php */includes/AuthPlugin\.php */includes/cache/CacheDependency\.php */includes/cache/CacheHelper\.php diff --git a/autoload.php b/autoload.php index 10aab64e8a..5d03874fcc 100644 --- a/autoload.php +++ b/autoload.php @@ -870,7 +870,7 @@ $wgAutoloadLocalClasses = [ 'MediaWiki\\Auth\\AbstractSecondaryAuthenticationProvider' => __DIR__ . '/includes/auth/AbstractSecondaryAuthenticationProvider.php', 'MediaWiki\\Auth\\AuthManager' => __DIR__ . '/includes/auth/AuthManager.php', 'MediaWiki\\Auth\\AuthManagerAuthPlugin' => __DIR__ . '/includes/auth/AuthManagerAuthPlugin.php', - 'MediaWiki\\Auth\\AuthManagerAuthPluginUser' => __DIR__ . '/includes/auth/AuthManagerAuthPlugin.php', + 'MediaWiki\\Auth\\AuthManagerAuthPluginUser' => __DIR__ . '/includes/auth/AuthManagerAuthPluginUser.php', 'MediaWiki\\Auth\\AuthPluginPrimaryAuthenticationProvider' => __DIR__ . '/includes/auth/AuthPluginPrimaryAuthenticationProvider.php', 'MediaWiki\\Auth\\AuthenticationProvider' => __DIR__ . '/includes/auth/AuthenticationProvider.php', 'MediaWiki\\Auth\\AuthenticationRequest' => __DIR__ . '/includes/auth/AuthenticationRequest.php', diff --git a/includes/auth/AuthManagerAuthPlugin.php b/includes/auth/AuthManagerAuthPlugin.php index 4f84b4c67d..01d992fe74 100644 --- a/includes/auth/AuthManagerAuthPlugin.php +++ b/includes/auth/AuthManagerAuthPlugin.php @@ -199,33 +199,3 @@ class AuthManagerAuthPlugin extends \AuthPlugin { return []; } } - -/** - * @since 1.27 - * @deprecated since 1.27 - */ -class AuthManagerAuthPluginUser extends \AuthPluginUser { - /** @var User */ - private $user; - - function __construct( $user ) { - $this->user = $user; - } - - public function getId() { - return $this->user->getId(); - } - - public function isLocked() { - return $this->user->isLocked(); - } - - public function isHidden() { - return $this->user->isHidden(); - } - - public function resetAuthToken() { - \MediaWiki\Session\SessionManager::singleton()->invalidateSessionsForUser( $this->user ); - return true; - } -} diff --git a/includes/auth/AuthManagerAuthPluginUser.php b/includes/auth/AuthManagerAuthPluginUser.php new file mode 100644 index 0000000000..e31be6019d --- /dev/null +++ b/includes/auth/AuthManagerAuthPluginUser.php @@ -0,0 +1,53 @@ +user = $user; + } + + public function getId() { + return $this->user->getId(); + } + + public function isLocked() { + return $this->user->isLocked(); + } + + public function isHidden() { + return $this->user->isHidden(); + } + + public function resetAuthToken() { + \MediaWiki\Session\SessionManager::singleton()->invalidateSessionsForUser( $this->user ); + return true; + } +} -- 2.20.1