Deletion of inactive accounts Deletion of inactive accounts
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Deletion of inactive accounts

Started by nakren, January 29, 2008, 07:38:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nakren

Hello,
The Gallery's version is 1.4..
i want some kind of a mode for un-used accounts for example to erase accounts who have not been online for a couple of days

François Keller

yes, i had made a plugin (but forgotten to share it  :D in the english board)
see attached files (but be carrefull with this feature, there is no undo possibility)
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Nibbler

Comment deletion is not complete. From the plugin:

cpg_db_query("DELETE FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' LIMIT 1");

That will only delete one comment per picture and not any of the comments the user posted. :)

There are some other stats that need updating too I think.

François Keller

Oh yes Nibbler, thank's for pointing this, the plugin is still in alpha stage and i must look forward to correct this
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Nibbler

Here's an updated version that includes everything I can see that needs deleting. There is still no confirmation so be very careful. If you delete a large number of users you might want to run an optimize on your database afterwards.

François Keller

Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

nakren

How can I modify it in order to delete only the acounts, that have never been used? (never been activated)

Nibbler

Change the SQL query to check for user_active set to 'NO'

eXess

In which file should I change/add this query?  ::)
.

Nibbler


eXess

#10
I can't find user_active query anywhere in the file. Maybe I annoy you with my stupid questions, but PHP is not my best side...  ::)

If I modify this line in this way:

{$CONFIG['TABLE_USERS']} WHERE user_id = $user_id $user_active='NO' LIMIT 1");

Will it work?
.

Nibbler

Change this code


$result = cpg_db_query("SELECT user_id, user_name, user_lastvisit FROM {$CONFIG['TABLE_USERS']} WHERE user_group <> 1 AND user_lastvisit < NOW() - INTERVAL $d DAY");


To this


$result = cpg_db_query("SELECT user_id, user_name, user_lastvisit FROM {$CONFIG['TABLE_USERS']} WHERE user_group <> 1 AND user_lastvisit < NOW() - INTERVAL $d DAY AND user_active = 'NO'");


ie, you add AND user_active = 'NO' to the end.

eXess

.

eXess

Hello, I tested the mod, it deleted some users, hopefully, who have never been online, but bots are still standing.

Here is an example bot registration:

User name: efmujawr         
Group: Registered        
Registration: 12 Nov 2007        
Last Visit: never
Files: 0               
Space used: 0 KB   
Space Quota: 4096 KB
          

I enter 61 days in the text field. But it doesn't works... What to do ?        
.

Nibbler

The account is probably activated. Perhaps at that time you did not require activation so the account is active by default.

eXess

.

François Keller

Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Nibbler


nointerest

I have translated the Plug-In into German. I add the language as txt-file.

(I do not use this plug-in, therefore I could not test my translation for smoothness. If someone has suggestions for phrases please let me know).

Hein Traag

Frantz,

attached the dutch lang file for this plugin plus a updated english lang file (corrected some minor typos hope you don't mind).

Excellent little plugin, useful for cpg's which have a large user pool.

Cheers
Hein