PDA

View Full Version : Query to update passwords for inactive users


Piloux
01-16-2020, 10:37 AM
Hi,

I would like to know if it's possible to execute a query directly on the database in order to update a usergroup's users passwords if their date of last activity (last time they made a post) is before let's say 1st december of 2019. And yes please don't tell me to make password expiration like 7 days because if the accounts original passwords have been compromised, it means that the hacker could potentially change again the new password.

I had already done that before with that kind of request :

UPDATE users SET password = 'the-same-md5-password-for-every-update' WHERE usergroupid=3


Since the salt is different for every member, that means they all should have a different password even by putting the same md5 pass.

The thing is that I don't think using "<" in the query's condition would have an effect on the lastpost entry since it's not a single number (it's something like "1578136140" and I don't know how to interpret that).


Thanks for your help

Dave
01-16-2020, 10:40 AM
When you say date of last activity, you mean the last time they logged in or the last time they made a post/thread?

Piloux
01-16-2020, 10:58 AM
Last time they made a post/thread yes.

--------------- Added 1579184184 at 1579184184 ---------------

When you say date of last activity, you mean the last time they logged in or the last time they made a post/thread?


The thing is that I don't think using "<" in the query's condition would have an effect on the lastpost entry since it's not a single number (it's something like "1578136140" and I don't know how to interpret that).

--------------- Added 1579187292 at 1579187292 ---------------

Edit problem solved thanks.