MyBB Community Forums
How to obtain the date of the last login attempt? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: How to obtain the date of the last login attempt? (/thread-218752.html)



How to obtain the date of the last login attempt? - Augustino7 - 2018-07-18

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


RE: How to obtain the date of the last login attempt? - linguist - 2018-07-18

The time of the last failed login attempt is not stored in the database.


RE: How to obtain the date of the last login attempt? - Augustino7 - 2018-07-19

(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?


RE: How to obtain the date of the last login attempt? - Serpius - 2018-07-19

(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.


RE: How to obtain the date of the last login attempt? - linguist - 2018-07-19

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


RE: How to obtain the date of the last login attempt? - Serpius - 2018-07-19

(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.


RE: How to obtain the date of the last login attempt? - Augustino7 - 2018-07-19

(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?


RE: How to obtain the date of the last login attempt? - Shade - 2018-07-19

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.


RE: How to obtain the date of the last login attempt? - Augustino7 - 2018-07-19

(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