Modifying Silverstripe 3 Member Lock Out

By default, Silverstripe gives 10 attempts for user to sign in.

The easiest way to modify the lock out delay and number of attempt in Silverstripe 3 is through config.yml

Go to mysite/_config/config.yml and add the following code:

And voila, your silverstripe lock out system is updated without the need to update the Silverstripe’s core.

If you ever need to access Member’s attribute regarding to lock out, you can use the following: (assuming $member is an instance of Member class)

  • $member->LockedOutUntil
    Get the date and time of lock validity
  • $member->FailedLoginCount
    Get number of incorrect login attempts that has been done
  • $member->isLockedOut()
    Check if member is locked
  • Member::config()->lock_out_after_incorrect_logins
    Get the maximum incorrect login attempts from config

Leave a reply:

Your email address will not be published.