Piwik\Plugins\Login\

PasswordVerifier

Verifies the password of the current user and requires a recent verification before sensitive actions.

Get an instance via dependency injection.

Methods

The class defines the following methods:

hasBeenVerified()

Returns whether the current user confirmed the password within the last 30 minutes after being asked to by requirePasswordVerifiedRecently().

Signature

  • Returns: bool — True if the confirmation is still valid.

requirePasswordVerifiedRecently()

Checks if the user has verified the password within the last 15 minutes. If not, the user will be redirected.

The password verify will be valid for at least another 15 minutes giving the user some time to perform an action.

Signature

  • It accepts the following parameter(s):

    • $redirectParams (array) — The query parameters (e.g. module and action) of the page the user is sent to after confirming the password. Must not be empty.
  • Returns: null|true — if password has been verified recently, will redirect if not