MyBB Community Forums

Full Version: How to obtain the date of the last login attempt?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

In the table mybb_users there is a field called "loginattempts" that stores the attempts where you tried to log in failed, but my question is in which field of which table is stored the date of the last failed attempt

Greetings and thanks in advance
The time of the last failed login attempt is not stored in the database.
(2018-07-18, 03:40 PM)linguist Wrote: [ -> ]The time of the last failed login attempt is not stored in the database.

Then where is stored the time of the last failed login attempt?
(2018-07-19, 12:01 PM)Augustino7 Wrote: [ -> ]
(2018-07-18, 03:40 PM)linguist Wrote: [ -> ]The time of the last failed login attempt is not stored in the database.

Then where is stored the time of the last failed login attempt?

Hmm... linguist just answered that question already.

Repeating the same question is going get you the same answer.
The only table field you might find useful is "loginlockoutexpiry", but that only tells you when someone's lockout will be over so you can calculate back (from the lockout time you configured) when their last "one too many" attempt was and they thriggered the lockout. Other than that, failed logins are not tracked by default and people who failed only once and then logged in successfully will have no record anywhere.

You might want to use this plugin: "Security Log" by Starpaul: https://community.mybb.com/mods.php?action=view&pid=740
(2018-07-19, 12:01 PM)Augustino7 Wrote: [ -> ]
(2018-07-18, 03:40 PM)linguist Wrote: [ -> ]The time of the last failed login attempt is not stored in the database.

Then where is stored the time of the last failed login attempt?

Hmm... linguist just answered that question already.

Repeating the same question is going get you the same answer.
(2018-07-19, 12:59 PM)linguist Wrote: [ -> ]The only table field you might find useful is "loginlockoutexpiry", but that only tells you when someone's lockout will be over so you can calculate back (from the lockout time you configured) when their last "one too many" attempt was and they thriggered the lockout. Other than that, failed logins are not tracked by default and people who failed only once and then logged in successfully will have no record anywhere.

You might want to use this plugin: "Security Log" by Starpaul: https://community.mybb.com/mods.php?action=view&pid=740

I would not like to use a plugin, I prefer to understand how it works

Intentionally block a test user and the loginlockoutexpiry field is 0, the time that was the last failed attempt will be saved in a cookie?
The last login attempt is not stored, but you can calculate it using the loginlockoutexpiry field.

$loginlockoutexpiry - ($mybb->settings['failedlogintime'] * 60)

This would be the math. It assumes you are obtaining the loginlockoutexpiry field in an homonym variable.
(2018-07-19, 04:14 PM)Shade Wrote: [ -> ]The last login attempt is not stored, but you can calculate it using the loginlockoutexpiry field.

$loginlockoutexpiry - ($mybb->settings['failedlogintime'] * 60)

This would be the math. It assumes you are obtaining the loginlockoutexpiry field in an homonym variable.

Thank you very much, I will try, any doubt that I have, I will bother you again

Best Regards