Have a weekly (or whatever) process to check for for any accounts that are older than a week (or whatever time you want) and are still bogus -- those are the ones you want to purge.Is there some timer functionality in modx to do this? I mean that can this be done somehow with just modx and php? Or would it have to be some automated-shell-script-thingy at the server?
Quote from: vbrilon at Feb 28, 2006, 12:03 AMHave a weekly (or whatever) process to check for for any accounts that are older than a week (or whatever time you want) and are still bogus -- those are the ones you want to purge.Is there some timer functionality in modx to do this? I mean that can this be done somehow with just modx and php? Or would it have to be some automated-shell-script-thingy at the server?
Quote from: vbrilon at Feb 28, 2006, 12:03 AMHave a weekly (or whatever) process to check for for any accounts that are older than a week (or whatever time you want) and are still bogus -- those are the ones you want to purge.Is there some timer functionality in modx to do this? I mean that can this be done somehow with just modx and php? Or would it have to be some automated-shell-script-thingy at the server?
I’m thinking that I should make it like this: When someone uses WebSingup to "request" an account, the account is made, set to be blocked and have a "waiting for verification" usergroup that has no special rights (and the verification email is sent to the given address). Then there would be a document with a verification snippet, that gets the users id from querystring and sets the corresponding user unblocked if it is found in the "waiting for verification" usergroup and then sets it to the correct usergroup. The usergroup thing is there to make sure, that the verification document can’t be "exploited" to unblock just any user. Then there would have to be a snippet that gets run on every page request What goes through all users in "waiting for verification" usergroup and checks if the lastlogin date is older than a week. If it is, then delete the user.
)
Sounds much better.. As I’m coming from Etomite, I didn’t know about the plugins yet.. but I’m in the works of going through the modx documentation!
Yes it’s do able, but my suggestion will be to use plugin instead of snippet to check the current user data on every page request, with this, you don’t have to include the snippet on every pages that you have, instead you can just set the plugin to listen to onwebpageinit event, than i will run everytime somebody requested a page.
Yes, this will be much better. I think I will also check all registered webusers in the cleaning script, so that if a user have not logged in for a long time, it would send a email remainder to the user that he should login to the site asap to keep the account, and if they don’t do it in a certain time span, they get deleted..
Yes it will cause too much overhead to check user database table on every page request. My suggestion will be to create a simple log file.....SO now on every page request, all you need is to compare the current date with the last date that you run user database cleaning script, if it’s over 1 week, than you run the script and write a log again at the begining of this file.
Basically you will have 1 plain text file as a log file. This file will keep the last time your run the script to clean user database. Everytime you run a user database cleaning script, you need to write the date and time on this log file. SO now on every page request, all you need is to compare the current date with the last date that you run user database cleaning script, if it’s over 1 week, than you run the script and write a log again at the begining of this file. I’m pretty sure it will be a lot more efficient, compare to hitting database back and forth on every page request.
A more so[hiticated approach will be to use config database table to store your last cleaning time. Basically it will be stored in array $modx->config[’var_db_name’]. Just don’t forget to clean up the cache everytime you write a data to the config database table.
That’s what I was talking about in my original post. I think this is a much better approach.