Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Deletion of inactive accounts  (Read 41824 times)

0 Members and 1 Guest are viewing this topic.

nakren

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Deletion of inactive accounts
« on: January 29, 2008, 07:38:31 pm »

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
« Last Edit: January 29, 2008, 08:25:42 pm by Nibbler »
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9097
  • aka Frantz
    • Ma galerie
Re: unactive accounts
« Reply #1 on: January 29, 2008, 08:11:15 pm »

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)
Logged
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

  • Guest
Re: unactive accounts
« Reply #2 on: January 29, 2008, 08:25:26 pm »

Comment deletion is not complete. From the plugin:

Code: [Select]
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.
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9097
  • aka Frantz
    • Ma galerie
Re: Deletion of inactive accounts
« Reply #3 on: January 29, 2008, 08:28:35 pm »

Oh yes Nibbler, thank's for pointing this, the plugin is still in alpha stage and i must look forward to correct this
Logged
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

  • Guest
Re: Deletion of inactive accounts
« Reply #4 on: January 29, 2008, 09:23:38 pm »

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

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9097
  • aka Frantz
    • Ma galerie
Re: Deletion of inactive accounts
« Reply #5 on: January 29, 2008, 09:36:44 pm »

thank's Nibbler i'll test
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Deletion of inactive accounts
« Reply #6 on: January 29, 2008, 10:40:40 pm »

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

Nibbler

  • Guest
Re: Deletion of inactive accounts
« Reply #7 on: January 29, 2008, 10:47:52 pm »

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

eXess

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 41
  • Bulgarian
    • ..:: portal.pazardjik.com - Пазарджишкият портал ::..
Re: Deletion of inactive accounts
« Reply #8 on: January 30, 2008, 03:56:16 pm »

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

Nibbler

  • Guest
Re: Deletion of inactive accounts
« Reply #9 on: January 30, 2008, 03:59:46 pm »

plugin_config.php
Logged

eXess

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 41
  • Bulgarian
    • ..:: portal.pazardjik.com - Пазарджишкият портал ::..
Re: Deletion of inactive accounts
« Reply #10 on: January 30, 2008, 04:23:41 pm »

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?
« Last Edit: January 30, 2008, 04:29:16 pm by eXess »
Logged
.

Nibbler

  • Guest
Re: Deletion of inactive accounts
« Reply #11 on: January 30, 2008, 04:29:09 pm »

Change this code

Code: [Select]
$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

Code: [Select]
$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.
Logged

eXess

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 41
  • Bulgarian
    • ..:: portal.pazardjik.com - Пазарджишкият портал ::..
Re: Deletion of inactive accounts
« Reply #12 on: January 30, 2008, 04:34:13 pm »

Thank you, I'll try now.  ;D
Logged
.

eXess

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 41
  • Bulgarian
    • ..:: portal.pazardjik.com - Пазарджишкият портал ::..
Re: Deletion of inactive accounts
« Reply #13 on: January 30, 2008, 04:53:17 pm »

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 ?        
Logged
.

Nibbler

  • Guest
Re: Deletion of inactive accounts
« Reply #14 on: January 30, 2008, 05:02:54 pm »

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

eXess

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 41
  • Bulgarian
    • ..:: portal.pazardjik.com - Пазарджишкият портал ::..
Re: Deletion of inactive accounts
« Reply #15 on: January 30, 2008, 07:34:45 pm »

So how can I delete them?  ::)
Logged
.

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9097
  • aka Frantz
    • Ma galerie
Re: Deletion of inactive accounts
« Reply #16 on: January 30, 2008, 07:48:35 pm »

via usermgr.php
Logged
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

  • Guest
Re: Deletion of inactive accounts
« Reply #17 on: January 30, 2008, 07:51:13 pm »

So how can I delete them?  ::)

Revert the change to the plugin.
Logged

nointerest

  • Translator
  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Female
  • Posts: 91
    • Karateschule Okinawa (Bayreuth, Kulmbach, Pegnitz, Auerbach)
Re: Deletion of inactive accounts
« Reply #18 on: February 01, 2008, 03:25:34 am »

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).
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Deletion of inactive accounts
« Reply #19 on: February 03, 2009, 04:32:11 pm »

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
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.