User: Mostly remove password handling
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 4 Sep 2015 16:17:42 +0000 (12:17 -0400)
committerBryan Davis <bd808@wikimedia.org>
Tue, 13 Oct 2015 22:10:41 +0000 (16:10 -0600)
commit3d0b4fea3dfb94610be0f0e9d8ff1cb24f106707
tree42fa1f8fc5969c418e91517b290ce95d548e883c
parent176e19e26cf94edec92797c9672806dc13635820
User: Mostly remove password handling

AuthManager is coming, which will make it easier to add alternative
methods of authentication. But in order to do that, we need to finally
get around to ripping the password-related bits out of the User class.

The password expiration handling isn't used anywhere in core or
extensions in Gerrit beyond testing for expired passwords on login and
resetting the expiry date on password change. Those bits have been
inlined and the functions removed; AuthManager will allow each
"authentication provider" to handle its own password expiration.

The methods for fetching passwords, including the fact that mPassword
and other fields are public, has also been removed. This is already
broken in combination with basically any extension that messes with
authentication, and the major use outside of that was in creating
system users like MassMessage's "MediaWiki message delivery" user.

Password setting methods are silently deprecated, since most of the
replacements won't be available until AuthManager. But uses in unit
testing can be replaced with TestUser::setPasswordForUser() immediately.

User::randomPassword() and User::getPasswordFactory() don't really
belong in User either. For the former a new PasswordFactory method has
been created, while the latter should just be replaced by the two lines
to create a PasswordFactory via its constructor.

Bug: T47716
Change-Id: I2c736ad72d946fa9b859e6cd335fa58aececc0d5
28 files changed:
RELEASE-NOTES-1.27
includes/User.php
includes/password/PasswordFactory.php
includes/specials/SpecialChangePassword.php
includes/specials/SpecialPasswordReset.php
includes/specials/SpecialUserlogin.php
maintenance/cleanupCaps.php
maintenance/cleanupSpam.php
maintenance/cleanupTable.inc
maintenance/deleteBatch.php
maintenance/deleteEqualMessages.php
maintenance/edit.php
maintenance/importImages.php
maintenance/importSiteScripts.php
maintenance/moveBatch.php
maintenance/protect.php
maintenance/rollbackEdits.php
maintenance/tables.sql
maintenance/undelete.php
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/BlockTest.php
tests/phpunit/includes/TestUser.php
tests/phpunit/includes/UserTest.php
tests/phpunit/includes/api/ApiBlockTest.php
tests/phpunit/includes/api/ApiCreateAccountTest.php
tests/phpunit/includes/api/UserWrapper.php
tests/phpunit/includes/cache/GenderCacheTest.php
tests/phpunit/includes/password/PasswordTest.php