Password Expiration
authorcsteipp <csteipp@wikimedia.org>
Wed, 9 Oct 2013 18:09:28 +0000 (11:09 -0700)
committercsteipp <csteipp@wikimedia.org>
Thu, 20 Feb 2014 17:41:51 +0000 (09:41 -0800)
commit01c8c421f8bc20b358e8612227151e845e0109f3
tree44cfe5efefe21e1b57fefb162c4bba5458cac524
parentefcf0a3f61b5bcdf5f9f6f716fa732b6afb9336e
Password Expiration

Add functionality to expire users' passwords:
 * Adds column to the user table to keep a password expiration
 * Adds $wgPasswordExpirationDays, which will force users to reset
   their passwords after a set number of days. By default, this set
   to false, so passwords never expire.
 * Adds a default grace period of 7 days, where if the user's password
   is expired, they can still login, but are encouraged to reset their
   password.
 * Adds hook 'LoginPasswordResetMessage' to update reset message, in
   case an extension wants to vary the message on a particular reset
   event.
 * Adds hook 'ResetPasswordExpiration' to allow extensions to change
   the expiration date when the user resets their password. E.g., if
   an extension wants to vary the expiration based on the user's group.

If the user is in the grace period, they get a password reset form
added to the login successful page. If an extension prevents showing
the login successful page (like CentralAuth), it should be updated to
show a password change form during the grace period. After the grace
period, the user will not be able to login without changing their
password.

Also prevents a successful reset if the user is "changing" their
password to their existing password.

No passwords will expire by default. Sites will have to call
User->expirePassword() from their own maintenance script to trigger a
password reset for a user.

Bug: 54997
Change-Id: I92a9fc63b409b182b1d7b48781d73fc7216f8061
18 files changed:
RELEASE-NOTES-1.23
docs/hooks.txt
includes/DefaultSettings.php
includes/User.php
includes/installer/MysqlUpdater.php
includes/installer/PostgresUpdater.php
includes/installer/SqliteUpdater.php
includes/specials/SpecialChangePassword.php
includes/specials/SpecialUserlogin.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/archives/patch-user_password_expire.sql [new file with mode: 0644]
maintenance/language/messages.inc
maintenance/mssql/tables.sql
maintenance/oracle/tables.sql
maintenance/postgres/tables.sql
maintenance/tables.sql
tests/phpunit/includes/UserTest.php