When a user is blocked due to password expiration, the administrator can unblock the user via the "Expired accounts" page. The user will then have one day to log in and change their password. If the user does not log in within one day, they will be blocked again. At this point an administrator should be able to unblock the user again, but it does not work.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AohRveTPV’s picture

Test to reproduce the bug. Requires first applying the patch in #2467941: Mock time retrievals for testing, which allows the test to control time.

AohRveTPV’s picture

Updated test to reproduce the bug. No longer requires applying a second patch as did previous patch.

AohRveTPV’s picture

Status: Active » Needs review
FileSize
4.89 KB

Fixed bug.

The problem was the existing code expected "unblocked" to be null for a user who had been blocked due to password expiration. But when a user was blocked after being unblocked, "unblocked" is not null; it is the time the user was unblocked. So we add a condition that detects when a user has been reblocked after being unblocked.

Also expanded test to actually attempt logins.

AohRveTPV’s picture

Updated to apply on latest code.

Status: Needs review » Needs work
AohRveTPV’s picture

Status: Needs work » Needs review
FileSize
4.16 KB

Attempted to fix previous patch.

  • AohRveTPV committed 937d4ab on 7.x-1.x
    Issue #2468449 by AohRveTPV: Cannot unblock reblocked expired account
    
AohRveTPV’s picture

Status: Needs review » Patch (to be ported)
AohRveTPV’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
AohRveTPV’s picture

Status: Patch (to be ported) » Closed (won't fix)

6.x-1.x is no longer supported.