Use case: As user support, I first set Force Password Change on a user, then I masquerade as that user. While masquerading, I expect to be able to use the site just like this user but instead I am taken to the Force Password Change screen ("An administrator has required that you change your password. Please change your password to proceed.").

Are there cases when a given user has masquerade permission but should also be forced to change that masquerading-as user's password?

(I saw #2839202: Support the masquerade module, but this is different)

Comments

texas-bronius created an issue. See original summary.

texas-bronius’s picture

The check masquerade module does is against $_SESSION['masquerading'])) . Is it too simplistic to add that check like:

/**
 * Checks whether or not user has a pending password change
 */
function force_password_change_check()
{
	global $user;

  if (isset($_SESSION['masquerading'])) {
    return FALSE;
  }
  ...

In this way, at least my use case as described works (masquerading user can use the site as if there were no pending password change forced), and when not masquerading but actually logging in as that user, I am still prompted and forced to change password.

Thoughts?

texas-bronius’s picture

Version: 7.x-2.1 » 7.x-2.2
texas-bronius’s picture

Here is a patch against 7.x-2.2 equivalent to #2 above.

  • Jaypan committed 3d132a3 on 7.x-2.x authored by texas-bronius
    Issue #2870496 by texas-bronius: Forced password change should not...
jaypan’s picture

Status: Active » Fixed

Thanks Bronius. I've added it to dev, and it will be part of the next release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.