Roundcube Community Forum

 

userbase management

Started by albunix, January 26, 2010, 03:07:17 PM

Previous topic - Next topic

albunix

Hello,

we've moved a big installation from Atmail Pearl version
to RoundCube latest.  So far so good.

However, here's a pressing issue which will be forced upon us down the road
eventually.

How to purge inactive users?  E.g we're a small hosting company and users come & go.  With such our DB grows steadily little by little, but eventually it'll need a good purge.

Atmail used to have a decent feature to purge inactive users by a given amount of time, and I wonder how to do such on RoundCube.

Please advise with ideas/directions

Thanks

JohnDoh

#1
You could run an SQL query on a regular basis and delete based on the last_login field. Something like:
DELETE FROM users WHERE last_login < (CURDATE() - INTERVAL 3 MONTH);I haven't tested it but I think as long as you have all the constraints setup then once you delete a user it will cascade and delete all related data in the db.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

albunix

Hi,

thanks for the hint.

Hopefully something more accepted than running DB back end scripts will be officially be developed or agreed upon as the proper way to clean up stale users.

Something which would eventually consider all aspects of extracting a user and purging them, such as Address Book, any potential preferences linked to them etc.

Thanks

rosali

Posted via Mobile Device
If all constraints in the database then all things related to the user will be wiped out.
Regards,
Rosali

albunix

Hi Rosali,

I did not understand you.

Did you imply that the query provided by JohnDoh is enough
to maintain a 'clean' DB in respect to stale users?

What about their address book etc, it seems that query does not affect
them, or does it?

Thanks

rosali

MySQL InnoDB:

If the the database type is InnoDB and all constrainsts are linked to users.user_id then all items in all tables are deleted if you delete a user in users table.
Regards,
Rosali